public class LinearAlgebraicCalculations
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAXIMAL_INDEX
Index of the maximal value in the
double array returned by
getMinAndMaxValuesFromMatrix(Matrix) |
static int |
MINIMAL_INDEX
Index of the minimal value in the
double array returned by
getMinAndMaxValuesFromMatrix(Matrix) |
static double |
NUMERIC_CUTOFF
the numeric cutoff used to limit calculations
|
Modifier and Type | Method and Description |
---|---|
static Vector |
add(Vector summand1,
Vector summand2) |
static Matrix |
calculateCovarianceFromMeanVector(java.util.List<DataPoint> dataPoints)
calculates the covariance matrix based on the definition of
|
static double |
calculateSquaredEuclideanDistance(Vector frist,
Vector second)
calculates the squared euclidean distance between 2 double
vectors/arrays of the same dimension
this is the some what low-level function used to find nearest prototypes to a given data point |
static java.util.List<DataPoint> |
collectDatapointsWithClassLabel(java.util.List<DataPoint> datapoints,
double classLabel)
return all data points with a requested class label
|
static double[] |
createMeanVectorFromListOfVectors(java.util.List<DataPoint> datapoints)
computes the average vector of a set of vectors - each feature is set to
the average of these feature for all input data points
|
static Matrix |
dyadicProduct(Vector vector)
calculates the outer product respectively dyadic product of a
Vector with itself |
static double[] |
getMinAndMaxValuesFromMatrix(Matrix matrix)
Retrieves the minimal and maximal values in the given matrix at the same
time, traversing every value only once.
|
static Vector |
multiply(Vector vector,
double scalar)
multiplies a vector by a scalar
|
static Vector |
multiply(Vector vector,
Matrix matrix)
multiplies a vector with a matrix - is used to map a
Vector to an
EmbeddedSpaceVector |
static void |
normalizeWithMaximalValue(java.util.List<Prototype> prototypes)
used to normalize the prototype update
|
static void |
normalizeWithMaximalValue(Matrix matrix)
used to normalized the omega update
|
static Vector |
scaledTranslate(Vector originalInstance,
double factor,
Vector delta)
condensed addition of one vector with another vector multiplied by a
scalar - used e.g.
|
static Vector |
substract(Vector subtrahend,
Vector minuend) |
public static final double NUMERIC_CUTOFF
public static final int MINIMAL_INDEX
double
array returned by
getMinAndMaxValuesFromMatrix(Matrix)
public static final int MAXIMAL_INDEX
double
array returned by
getMinAndMaxValuesFromMatrix(Matrix)
public static Vector multiply(Vector vector, double scalar)
vector
- scalar
- public static Vector multiply(Vector vector, Matrix matrix)
Vector
to an
EmbeddedSpaceVector
vector
- a data point or prototypematrix
- the mapping rulepublic static Matrix dyadicProduct(Vector vector)
Vector
with itselfvector
- public static Matrix calculateCovarianceFromMeanVector(java.util.List<DataPoint> dataPoints)
dataPoints
- http://www.itl.nist.gov/div898/handbook/pmc/section5/pmc541.htm
public static Vector scaledTranslate(Vector originalInstance, double factor, Vector delta)
originalInstance
- the original prototypesfactor
- the prototype learning ratedelta
- the prototype deltapublic static double calculateSquaredEuclideanDistance(Vector frist, Vector second)
frist
- the first vectorsecond
- the second vectorpublic static void normalizeWithMaximalValue(java.util.List<Prototype> prototypes)
prototypes
- public static void normalizeWithMaximalValue(Matrix matrix)
matrix
- public static double[] createMeanVectorFromListOfVectors(java.util.List<DataPoint> datapoints)
datapoints
- public static java.util.List<DataPoint> collectDatapointsWithClassLabel(java.util.List<DataPoint> datapoints, double classLabel)
datapoints
- what data points to process?classLabel
- what class label are we interested in?public static double[] getMinAndMaxValuesFromMatrix(Matrix matrix)
MINIMAL_INDEX
= 0 and the maximal value at MAXIMAL_INDEX
= 1.matrix
- The matrix to retrieve minimal and maximal value from.