Package si.ijs.kt.clus.selection
Class BagSelection
java.lang.Object
si.ijs.kt.clus.selection.ClusSelection
si.ijs.kt.clus.selection.BagSelection
- Direct Known Subclasses:
BagSelectionSemiSupervised
-
Field Summary
FieldsFields inherited from class si.ijs.kt.clus.selection.ClusSelection
m_NbRows -
Constructor Summary
ConstructorsConstructorDescriptionBagSelection(int nbrows) Creates a new bag selection of sizenbrowsfrom a total ofnbrowsinstances.BagSelection(int nbrows, int nbselected, ClusRandomNonstatic rnd) Create a new bag of sizenbselectedfrom a total ofnbrowsinstances. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal intgetCount(int row) intdoublegetWeight(int row) booleanisSelected(int row) Methods inherited from class si.ijs.kt.clus.selection.ClusSelection
getIndex, getNbRows, supportsReplacement
-
Field Details
-
m_Counts
protected int[] m_Counts -
m_NbSel
protected int m_NbSel
-
-
Constructor Details
-
BagSelection
public BagSelection(int nbrows) Creates a new bag selection of sizenbrowsfrom a total ofnbrowsinstances. This constructor does NOT take in to account the BagSize setting users can set in the settings file. If you want to take this in to account, you should useBagSelection(nbrows, getSettings().getEnsembleBagSize())instead.- Parameters:
nbrows- the number of instances
-
BagSelection
Create a new bag of sizenbselectedfrom a total ofnbrowsinstances. Ifnbselected== 0, a bag of sizenbrowsis created.- Parameters:
nbrows- the total number of instancesnbselected- the size of the bagging selectionrnd- random generator object that is used for creating the bag. May be null. In that case, ClusRandom is used instead, which might result in non-reproducibility if the number of cores is greater than one.
-
-
Method Details
-
changesDistribution
public boolean changesDistribution()- Overrides:
changesDistributionin classClusSelection
-
getWeight
public double getWeight(int row) - Overrides:
getWeightin classClusSelection
-
getNbSelected
public int getNbSelected()- Specified by:
getNbSelectedin classClusSelection
-
isSelected
public boolean isSelected(int row) - Specified by:
isSelectedin classClusSelection
-
getCount
public final int getCount(int row)
-