public final class Gram extends water.Iced<Gram>
Modifier and Type | Class and Description |
---|---|
static class |
Gram.Cholesky |
static class |
Gram.CollinearColumnsException |
static class |
Gram.GramTask
Task to compute gram matrix normalized by the number of observations (not counting rows with NAs).
|
static class |
Gram.InPlaceCholesky |
static class |
Gram.NonSPDMatrixException |
static class |
Gram.OuterGramTask
Task to compute outer product of a matrix normalized by the number of observations (not counting rows with NAs).
|
Modifier and Type | Field and Description |
---|---|
double[] |
_diag |
double |
_diagAdded |
int |
_diagN |
double[][] |
_frame2DProduce |
double[][] |
_xx |
hex.gram.Gram.XXCache |
_xxCache |
Constructor and Description |
---|
Gram(DataInfo dinfo) |
Gram(double[][] xxCacheNew) |
Gram(int N,
int diag,
int dense,
int sparse,
boolean hasIntercept) |
Modifier and Type | Method and Description |
---|---|
void |
add(Gram grm) |
void |
addDiag(double d) |
void |
addDiag(double[] ds) |
void |
addDiag(double d,
boolean add2Intercept) |
void |
addGAMPenalty(double[][][] ds,
int[][] gamIndices,
double[][] xmatrix) |
void |
addGAMPenalty(java.lang.Integer[] activeColumns,
double[][][] ds,
int[][] gamIndices)
Add the effect of gam column smoothness factor.
|
void |
addRow(DataInfo.Row row,
double w) |
void |
addRowDense(DataInfo.Row row,
double w) |
void |
addRowSparse(DataInfo.Row r,
double w) |
Gram.Cholesky |
cholesky(Gram.Cholesky chol) |
Gram.Cholesky |
cholesky(Gram.Cholesky chol,
boolean parallelize,
java.lang.String id)
Compute the Cholesky decomposition.
|
Gram |
deep_clone() |
double |
diagSum() |
void |
dropCols(int[] cols) |
void |
dropIntercept() |
int[] |
findZeroCols() |
int |
fullN() |
double |
get(int i,
int j) |
double[][] |
getXX() |
double[][] |
getXX(boolean lowerDiag,
boolean icptFist) |
double[][] |
getXX(double[][] xalloc) |
double[][] |
getXX(double[][] xalloc,
boolean lowerDiag,
boolean icptFist) |
double[][] |
getXXCPM(double[][] xalloc,
boolean lowerDiag,
boolean icptFirst)
This method will copy the xx matrix into a matrix xalloc which is of bigger size than the actual xx by 1 in both
row and column.
|
boolean |
hasNaNsOrInfs() |
void |
mul(double x) |
double[] |
mul(double[] x) |
void |
mul(double[] x,
double[] res) |
Gram.Cholesky |
qrCholesky(java.util.ArrayList<java.lang.Integer> dropped_cols,
boolean standardized)
Compute Cholesky decompostion by computing partial QR decomposition (R == LU).
|
double |
sparseness() |
java.lang.String |
toString() |
public double[][] _xx
public double[] _diag
public double[][] _frame2DProduce
public int _diagN
public transient hex.gram.Gram.XXCache _xxCache
public double _diagAdded
public Gram(DataInfo dinfo)
public Gram(int N, int diag, int dense, int sparse, boolean hasIntercept)
public Gram(double[][] xxCacheNew)
public void dropIntercept()
public Gram deep_clone()
public final int fullN()
public void addDiag(double[] ds)
public void addGAMPenalty(java.lang.Integer[] activeColumns, double[][][] ds, int[][] gamIndices)
activeColumns:
- store active columnsds:
- store penalty matrix per columngamIndices:
- penalty column indices taken into account categorical column offsetpublic void addGAMPenalty(double[][][] ds, int[][] gamIndices, double[][] xmatrix)
public double get(int i, int j)
public void addDiag(double d)
public void addDiag(double d, boolean add2Intercept)
public double sparseness()
public double diagSum()
public Gram.Cholesky qrCholesky(java.util.ArrayList<java.lang.Integer> dropped_cols, boolean standardized)
dropped_cols
- - empty list which will be filled with collinear columns removed during computationpublic void dropCols(int[] cols)
public int[] findZeroCols()
public java.lang.String toString()
toString
in class java.lang.Object
public Gram.Cholesky cholesky(Gram.Cholesky chol)
public Gram.Cholesky cholesky(Gram.Cholesky chol, boolean parallelize, java.lang.String id)
chol
- public double[][] getXX()
public double[][] getXX(boolean lowerDiag, boolean icptFist)
public double[][] getXX(double[][] xalloc)
public double[][] getXX(double[][] xalloc, boolean lowerDiag, boolean icptFist)
public double[][] getXXCPM(double[][] xalloc, boolean lowerDiag, boolean icptFirst)
public void add(Gram grm)
public final boolean hasNaNsOrInfs()
public final void addRowSparse(DataInfo.Row r, double w)
public final void addRow(DataInfo.Row row, double w)
public final void addRowDense(DataInfo.Row row, double w)
public void mul(double x)
public double[] mul(double[] x)
public void mul(double[] x, double[] res)