Class UnderSamplingByMaskingPreProcessor
- java.lang.Object
-
- org.nd4j.linalg.dataset.api.preprocessor.classimbalance.BaseUnderSamplingPreProcessor
-
- org.nd4j.linalg.dataset.api.preprocessor.classimbalance.UnderSamplingByMaskingPreProcessor
-
- All Implemented Interfaces:
Serializable
,DataSetPreProcessor
public class UnderSamplingByMaskingPreProcessor extends BaseUnderSamplingPreProcessor implements DataSetPreProcessor
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.nd4j.linalg.dataset.api.preprocessor.classimbalance.BaseUnderSamplingPreProcessor
tbpttWindowSize
-
-
Constructor Summary
Constructors Constructor Description UnderSamplingByMaskingPreProcessor(double targetDist, int windowSize)
The target distribution to approximate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
overrideMinorityDefault()
Will change the default minority label from "1" to "0" and correspondingly the majority class from "0" to "1"void
preProcess(DataSet toPreProcess)
Pre process a dataset-
Methods inherited from class org.nd4j.linalg.dataset.api.preprocessor.classimbalance.BaseUnderSamplingPreProcessor
adjustMasks, donotMaskAllMajorityWindows, donotMaskMinorityWindows
-
-
-
-
Constructor Detail
-
UnderSamplingByMaskingPreProcessor
public UnderSamplingByMaskingPreProcessor(double targetDist, int windowSize)
The target distribution to approximate. Valid values are between (0,0.5]. Eg. For a targetDist = 0.25 and tbpttWindowSize = 100: Every 100 time steps (starting from the last time step) will randomly mask majority time steps to approximate a 25:75 ratio of minorityLabel to majority classes- Parameters:
targetDist
-windowSize
- Usually set to the size of the tbptt
-
-
Method Detail
-
overrideMinorityDefault
public void overrideMinorityDefault()
Will change the default minority label from "1" to "0" and correspondingly the majority class from "0" to "1"
-
preProcess
public void preProcess(DataSet toPreProcess)
Description copied from interface:DataSetPreProcessor
Pre process a dataset- Specified by:
preProcess
in interfaceDataSetPreProcessor
- Parameters:
toPreProcess
- the data set to pre process
-
-