Package org.nd4j.linalg.util
Class FeatureUtil
- java.lang.Object
-
- org.nd4j.linalg.util.FeatureUtil
-
public class FeatureUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description FeatureUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
normalizeMatrix(INDArray toNormalize)
static void
scaleByMax(INDArray toScale)
Divides each row by its maxstatic void
scaleMinMax(double min, double max, INDArray toScale)
Scales the ndarray columns to the given min/max valuesstatic INDArray
toOutcomeMatrix(int[] index, long numOutcomes)
Creates an out come vector from the specified inputsstatic INDArray
toOutcomeVector(long index, long numOutcomes)
Creates an out come vector from the specified inputs
-
-
-
Method Detail
-
toOutcomeVector
public static INDArray toOutcomeVector(long index, long numOutcomes)
Creates an out come vector from the specified inputs- Parameters:
index
- the index of the labelnumOutcomes
- the number of possible outcomes- Returns:
- a binary label matrix used for supervised learning
-
toOutcomeMatrix
public static INDArray toOutcomeMatrix(int[] index, long numOutcomes)
Creates an out come vector from the specified inputs- Parameters:
index
- the index of the labelnumOutcomes
- the number of possible outcomes- Returns:
- a binary label matrix used for supervised learning
-
normalizeMatrix
public static void normalizeMatrix(INDArray toNormalize)
-
scaleByMax
public static void scaleByMax(INDArray toScale)
Divides each row by its max- Parameters:
toScale
- the matrix to divide by its row maxes
-
scaleMinMax
public static void scaleMinMax(double min, double max, INDArray toScale)
Scales the ndarray columns to the given min/max values- Parameters:
min
- the minimum numbermax
- the max number
-
-