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 sizenbrows
from a total ofnbrows
instances.BagSelection
(int nbrows, int nbselected, ClusRandomNonstatic rnd) Create a new bag of sizenbselected
from a total ofnbrows
instances. -
Method Summary
Modifier and TypeMethodDescriptionboolean
final int
getCount
(int row) int
double
getWeight
(int row) boolean
isSelected
(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 sizenbrows
from a total ofnbrows
instances. 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 sizenbselected
from a total ofnbrows
instances. Ifnbselected
== 0, a bag of sizenbrows
is 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:
changesDistribution
in classClusSelection
-
getWeight
public double getWeight(int row) - Overrides:
getWeight
in classClusSelection
-
getNbSelected
public int getNbSelected()- Specified by:
getNbSelected
in classClusSelection
-
isSelected
public boolean isSelected(int row) - Specified by:
isSelected
in classClusSelection
-
getCount
public final int getCount(int row)
-