smile.sampling
Class Bagging
- java.lang.Object
-
- smile.sampling.Bagging
-
public class Bagging extends java.lang.ObjectBagging (Bootstrap aggregating) is a way to improve the classification by combining classifications of randomly generated training sets.
-
-
Field Detail
-
size
public int size
The number of samples in this bag.
-
samples
public int[][] samples
Samples. The first column is the sample index while the second column is the number of samples.
-
-
Constructor Detail
-
Bagging
public Bagging(int k, int[] y, int[] classWeight, double subsample)Stratified sampling.- Parameters:
k- the number of classes.y- class labels.classWeight- Priors of the classes. The weight of each class is roughly the ratio of samples in each class. For example, if there are 400 positive samples and 100 negative samples, the classWeight should be [1, 4] (assuming label 0 is of negative, label 1 is of positive).subsample- sampling rate. Draw samples with replacement if it is 1.0.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG