smile.validation
Class CrossValidation
- java.lang.Object
-
- smile.validation.CrossValidation
-
public class CrossValidation extends java.lang.ObjectCross-validation is a technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly used in settings where the goal is prediction, and one wants to estimate how accurately a predictive model will perform in practice. One round of cross-validation involves partitioning a sample of data into complementary subsets, performing the analysis on one subset (called the training set), and validating the analysis on the other subset (called the validation set or testing set). To reduce variability, multiple rounds of cross-validation are performed using different partitions, and the validation results are averaged over the rounds.
-
-
Field Summary
Fields Modifier and Type Field and Description intkThe number of rounds of cross validation.int[][]testThe index of testing instances.int[][]trainThe index of training instances.
-
Constructor Summary
Constructors Constructor and Description CrossValidation(int n, int k)Constructor.CrossValidation(int n, int k, boolean permutate)Constructor.
-
-
-
Field Detail
-
k
public final int k
The number of rounds of cross validation.
-
train
public final int[][] train
The index of training instances.
-
test
public final int[][] test
The index of testing instances.
-
-
Constructor Detail
-
CrossValidation
public CrossValidation(int n, int k)Constructor.- Parameters:
n- the number of samples.k- the number of rounds of cross validation.
-
CrossValidation
public CrossValidation(int n, int k, boolean permutate)Constructor.- Parameters:
n- the number of samples.k- the number of rounds of cross validation.permutate- determiner of index permutation
-
-
DataMelt 3.0 © DataMelt by jWork.ORG