public class ThinPlateRegressionUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ThinPlateRegressionUtils.ScaleTPPenalty
this class performs scaling on TP penalty matrices that is done in R.
|
Constructor and Description |
---|
ThinPlateRegressionUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addPermutationList(java.util.List<java.lang.Integer[]> onePolyBasis,
java.util.List<java.util.List<java.lang.Integer>> permute1Basis) |
static int |
calculatem(int d)
For thin plate regression, given d (number of predictors for a smooth), it will return m where (m-1) is the
maximum polynomial degree in the polynomial basis functions.
|
static int |
calculateM(int d,
int m) |
static boolean |
checkFrameRowNA(water.fvec.Frame chk,
long rowIndex) |
static boolean |
checkRowNA(water.fvec.Chunk[] chk,
int rowIndex) |
static int[][] |
convertList2Array(java.util.List<java.lang.Integer[]> list2Convert,
int M,
int d) |
static void |
expandCombo(int[] oneList,
int[] polyBasis,
java.lang.Integer[] basisOrder)
Given a combo found by findOnePerm say for d = 5, m = 4, for degree = 1 to m-1 (3 in this case).
|
static java.lang.String[] |
extractColNames(java.lang.String[] src,
int srcStart,
int destStart,
int length) |
static void |
fillRowArray(water.fvec.NewChunk[] newChk,
int colWidth,
double[] fillValue) |
static void |
fillRowOneValue(water.fvec.NewChunk[] newChk,
int colWidth,
double fillValue) |
static java.util.List<java.lang.Integer[]> |
findAllPolybasis(java.util.List<java.lang.Integer[]> onePolyBasis)
For each list in onePolyBasis, we still need to find all the permutations for that list.
|
static void |
findOnePerm(int totDegree,
int[] degreeCombo,
int index,
java.util.ArrayList<int[]> allCombos,
int[] currCombo)
For a fixed degree specified as totDegree, specified a set of combination of polynomials to achieve the totDegree.
|
static void |
findPermute(int[] freqMap,
java.util.List<java.lang.Integer> prefix,
int remaining,
java.util.List<java.util.List<java.lang.Integer>> basisPerm) |
static java.util.List<java.lang.Integer[]> |
findPolyBasis(int d,
int m)
This method, given number of predictors in the smooth d, number of polynomials in the polynomial basis m, will
generate a list of integer array specifying for each predictors the degree that predictor will have.
|
static int[] |
generateOrderFreq(java.lang.Integer[] oneBasis) |
static double[][] |
generateStarT(double[][] knots,
java.util.List<java.lang.Integer[]> polyBasisDegree,
double[] gamColMeanRaw,
double[] oneOColStd,
boolean standardizeTPSmoothers) |
static double[][] |
genKnotsMultiplePreds(water.fvec.Frame predictVec,
GAMModel.GAMParameters parms,
int predIndex)
Generate knots for thin plate (TP) smoothers.
|
static java.lang.String |
genThinPlateNameStart(GAMModel.GAMParameters parms,
int gamColIndex) |
static void |
mergeCombos(java.util.ArrayList<int[]> oneCombo,
java.lang.Integer[] basisOrder,
int[] polyBasis,
java.util.List<java.lang.Integer[]> polyBasisSet) |
static void |
setCombo(int[] currCombo,
int index,
int degreeCount) |
public static int calculatem(int d)
d
- : integer denoting number of predictors for thin plate regression smooth.public static int calculateM(int d, int m)
public static java.util.List<java.lang.Integer[]> findPolyBasis(int d, int m)
d
- m
- public static java.util.List<java.lang.Integer[]> findAllPolybasis(java.util.List<java.lang.Integer[]> onePolyBasis)
onePolyBasis
- public static void addPermutationList(java.util.List<java.lang.Integer[]> onePolyBasis, java.util.List<java.util.List<java.lang.Integer>> permute1Basis)
public static void findPermute(int[] freqMap, java.util.List<java.lang.Integer> prefix, int remaining, java.util.List<java.util.List<java.lang.Integer>> basisPerm)
public static int[] generateOrderFreq(java.lang.Integer[] oneBasis)
public static void mergeCombos(java.util.ArrayList<int[]> oneCombo, java.lang.Integer[] basisOrder, int[] polyBasis, java.util.List<java.lang.Integer[]> polyBasisSet)
public static void expandCombo(int[] oneList, int[] polyBasis, java.lang.Integer[] basisOrder)
oneList
- polyBasis
- basisOrder
- public static void findOnePerm(int totDegree, int[] degreeCombo, int index, java.util.ArrayList<int[]> allCombos, int[] currCombo)
totDegree
- : integer representing degree of polynomial basisdegreeCombo
- : degrees allowed for polynomial basisindex
- allCombos
- currCombo
- public static void setCombo(int[] currCombo, int index, int degreeCount)
public static double[][] generateStarT(double[][] knots, java.util.List<java.lang.Integer[]> polyBasisDegree, double[] gamColMeanRaw, double[] oneOColStd, boolean standardizeTPSmoothers)
public static void fillRowOneValue(water.fvec.NewChunk[] newChk, int colWidth, double fillValue)
public static void fillRowArray(water.fvec.NewChunk[] newChk, int colWidth, double[] fillValue)
public static boolean checkRowNA(water.fvec.Chunk[] chk, int rowIndex)
public static boolean checkFrameRowNA(water.fvec.Frame chk, long rowIndex)
public static java.lang.String genThinPlateNameStart(GAMModel.GAMParameters parms, int gamColIndex)
public static java.lang.String[] extractColNames(java.lang.String[] src, int srcStart, int destStart, int length)
public static int[][] convertList2Array(java.util.List<java.lang.Integer[]> list2Convert, int M, int d)
public static double[][] genKnotsMultiplePreds(water.fvec.Frame predictVec, GAMModel.GAMParameters parms, int predIndex)
predictVec
- H2OFrame containing predictor columns used to build the TP smoothers.parms
- GAMParameterpredIndex
- integer denoting GAM column specificationm in parms._gam_columns