weka.core
Class ResampleUtils
- java.lang.Object
-
- weka.core.ResampleUtils
-
public class ResampleUtils extends java.lang.ObjectHelper class for resampling.
-
-
Constructor Summary
Constructors Constructor and Description ResampleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static booleanhasInstanceWeights(Instances insts)Checks whether there are any instance weights other than 1.0 set.static InstancesresampleWithWeightIfNecessary(Instances insts, java.util.Random rand)Resamples the dataset usingInstances.resampleWithWeights(Random)if there are any instance weights other than 1.0 set.
-
-
-
Method Detail
-
hasInstanceWeights
public static boolean hasInstanceWeights(Instances insts)
Checks whether there are any instance weights other than 1.0 set.- Parameters:
insts- the dataset to check- Returns:
- true if instance weights other than 1.0 are set
-
resampleWithWeightIfNecessary
public static Instances resampleWithWeightIfNecessary(Instances insts, java.util.Random rand)
Resamples the dataset usingInstances.resampleWithWeights(Random)if there are any instance weights other than 1.0 set. Simply returns the dataset if no instance weights other than 1.0 are set.- Parameters:
insts- the dataset to resamplerand- the random number generator to use- Returns:
- the (potentially) resampled dataset
-
-
DataMelt 3.0 © DataMelt by jWork.ORG