Package ai.sklearn4j.utils
Class ExtMath
- java.lang.Object
-
- ai.sklearn4j.utils.ExtMath
-
public class ExtMath extends Object
Helper class that implements scikit-learn functionalities in utils/extmath.py.
-
-
Constructor Summary
Constructors Constructor Description ExtMath()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NumpyArray<Double>dot(NumpyArray<Double> v1, NumpyArray<Double> v2)Dot product of the NumpyArray.static NumpyArray<Double>rowNorm(NumpyArray<Double> x)Row-wise (squared) Euclidean norm of X.static NumpyArray<Double>rowNorm(NumpyArray<Double> x, boolean squared)Row-wise (squared) Euclidean norm of X.
-
-
-
Method Detail
-
dot
public static NumpyArray<Double> dot(NumpyArray<Double> v1, NumpyArray<Double> v2)
Dot product of the NumpyArray.- Parameters:
v1- Left-hand side of the expression.v2- Right-hand side of the expression.- Returns:
- The dot product of the two numpy array.
-
rowNorm
public static NumpyArray<Double> rowNorm(NumpyArray<Double> x)
Row-wise (squared) Euclidean norm of X. Equivalent to np.sqrt((X * X).sum(axis=1))- Parameters:
x- The input array.- Returns:
- The row-wise (squared) Euclidean norm of x.
-
rowNorm
public static NumpyArray<Double> rowNorm(NumpyArray<Double> x, boolean squared)
Row-wise (squared) Euclidean norm of X. Equivalent to np.sqrt((X * X).sum(axis=1))- Parameters:
x- The input array.squared- If True, return squared norms.- Returns:
- The row-wise (squared) Euclidean norm of x.
-
-