public final class MathUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MathUtils.PredictionOutcomePair |
| Modifier and Type | Field and Description |
|---|---|
static double |
EPS |
| Modifier and Type | Method and Description |
|---|---|
static double |
computeAUC(List<MathUtils.PredictionOutcomePair> outcomePredictedPairs)
This is actually taken from Kaggle's C# implementation:
://www.kaggle.com/c/SemiSupervisedFeatureLearning
/forums/t/919/auc-implementation/6136#post6136. |
static de.jungblut.math.dense.DenseDoubleMatrix |
createPolynomials(de.jungblut.math.dense.DenseDoubleMatrix seed,
int num)
Creates a new matrix consisting out of polynomials of the input matrix.
Considering you want to do a 2 polynomial out of 3 columns you get: (SEED: x^1 | y^1 | z^1 )| x^2 | y^2 | z^2 for the columns of the returned matrix. |
static double |
guardedLogarithm(double input) |
static de.jungblut.math.DoubleMatrix |
logMatrix(de.jungblut.math.DoubleMatrix input) |
static de.jungblut.math.DoubleVector |
logVector(de.jungblut.math.DoubleVector input) |
static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> |
meanNormalizeColumns(Dataset dataset)
Normalizes the given dataset (inplace), by subtracting the mean and
dividing by the stddev.
|
static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> |
meanNormalizeColumns(Dataset dataset,
java.util.function.Predicate<FeatureOutcomePair> filterPredicate)
Normalizes the given dataset (inplace), by subtracting the mean and
dividing by the stddev.
|
static de.jungblut.math.tuple.Tuple3<de.jungblut.math.DoubleMatrix,de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> |
meanNormalizeColumns(de.jungblut.math.DoubleMatrix x) |
static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleMatrix,de.jungblut.math.DoubleVector> |
meanNormalizeRows(de.jungblut.math.DoubleMatrix pMatrix) |
static double |
minMaxScale(double x,
double fromMin,
double fromMax,
double toMin,
double toMax)
Scales a single input into the interval given by min and max.
|
static de.jungblut.math.DoubleMatrix |
minMaxScale(de.jungblut.math.DoubleMatrix input,
double fromMin,
double fromMax,
double toMin,
double toMax)
Scales a matrix into the interval given by min and max.
|
static de.jungblut.math.DoubleVector |
minMaxScale(de.jungblut.math.DoubleVector input,
double fromMin,
double fromMax,
double toMin,
double toMax)
Scales a vector into the interval given by min and max.
|
static de.jungblut.math.DoubleVector |
numericalGradient(de.jungblut.math.DoubleVector vector,
CostFunction f)
Calculates the numerical gradient from a cost function using the central
difference theorem.
|
public static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleMatrix,de.jungblut.math.DoubleVector> meanNormalizeRows(de.jungblut.math.DoubleMatrix pMatrix)
public static de.jungblut.math.tuple.Tuple3<de.jungblut.math.DoubleMatrix,de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> meanNormalizeColumns(de.jungblut.math.DoubleMatrix x)
public static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> meanNormalizeColumns(Dataset dataset)
public static de.jungblut.math.tuple.Tuple<de.jungblut.math.DoubleVector,de.jungblut.math.DoubleVector> meanNormalizeColumns(Dataset dataset, java.util.function.Predicate<FeatureOutcomePair> filterPredicate)
public static de.jungblut.math.dense.DenseDoubleMatrix createPolynomials(de.jungblut.math.dense.DenseDoubleMatrix seed,
int num)
seed - matrix to add polynoms of it.num - how many polynoms, 2 for quadratic, 3 for cubic and so forth.public static de.jungblut.math.DoubleVector numericalGradient(de.jungblut.math.DoubleVector vector,
CostFunction f)
vector - the parameters to derive.f - the costfunction to return the cost at a given parameterset.public static de.jungblut.math.DoubleMatrix logMatrix(de.jungblut.math.DoubleMatrix input)
public static de.jungblut.math.DoubleVector logVector(de.jungblut.math.DoubleVector input)
public static de.jungblut.math.DoubleMatrix minMaxScale(de.jungblut.math.DoubleMatrix input,
double fromMin,
double fromMax,
double toMin,
double toMax)
input - the input value.fromMin - the lower bound of the input interval.fromMax - the upper bound of the input interval.toMin - the lower bound of the target interval.toMax - the upper bound of the target interval.public static de.jungblut.math.DoubleVector minMaxScale(de.jungblut.math.DoubleVector input,
double fromMin,
double fromMax,
double toMin,
double toMax)
input - the input vector.fromMin - the lower bound of the input interval.fromMax - the upper bound of the input interval.toMin - the lower bound of the target interval.toMax - the upper bound of the target interval.public static double minMaxScale(double x,
double fromMin,
double fromMax,
double toMin,
double toMax)
x - the input value.fromMin - the lower bound of the input interval.fromMax - the upper bound of the input interval.toMin - the lower bound of the target interval.toMax - the upper bound of the target interval.public static double guardedLogarithm(double input)
public static double computeAUC(List<MathUtils.PredictionOutcomePair> outcomePredictedPairs)
://www.kaggle.com/c/SemiSupervisedFeatureLearning
/forums/t/919/auc-implementation/6136#post6136.outcomePredictedPairs - the list of PredictionOutcomePair: class (0 or
1) -> predicted valueCopyright © 2016. All rights reserved.