public class GamUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GamUtils.AllocateType |
Modifier and Type | Field and Description |
---|---|
static double |
EPS |
static java.lang.String |
SPLINENOTIMPL |
Constructor and Description |
---|
GamUtils() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
allocate2DArray(GamUtils.AllocateType fileMode,
int numKnots) |
static double[][][] |
allocate3DArray(int num2DArrays,
GAMModel.GAMParameters parms,
GamUtils.AllocateType fileMode) |
static double[][][] |
allocate3DArrayCS(int num2DArrays,
GAMModel.GAMParameters parms,
GamUtils.AllocateType fileMode) |
static double[][][] |
allocate3DArrayTP(int num2DArrays,
GAMModel.GAMParameters parms,
int[] secondDim,
int[] thirdDim) |
static water.Key[] |
buildCVGamModels(GAMModel model,
GLMModel glmModel,
GAMModel.GAMParameters parms,
java.lang.String foldColumn) |
static water.fvec.Frame |
buildGamFrame(GAMModel.GAMParameters parms,
water.fvec.Frame train,
water.Key<water.fvec.Frame>[] gamFrameKeysCenter,
java.lang.String foldColumn) |
static water.fvec.Frame |
concateGamVecs(water.Key<water.fvec.Frame>[] gamFrameKeysCenter) |
static void |
copyCVGLMtoGAMModel(GAMModel model,
GLMModel glmModel,
GAMModel.GAMParameters parms,
java.lang.String foldColumn) |
static boolean |
equalColNames(java.lang.String[] name1,
java.lang.String[] standardN,
java.lang.String response_column) |
static java.lang.String[] |
generateGamColNames(int gamColIndex,
GAMModel.GAMParameters parms) |
static java.lang.String[] |
generateGamColNamesThinPlateKnots(int gamColIndex,
GAMModel.GAMParameters parms,
int[][] polyBasisDegree,
java.lang.String nameStub) |
static double[] |
generateKnotsOneColumn(water.fvec.Frame gamFrame,
int knotNum) |
static java.lang.String |
genPolyBasisNames(java.lang.String[] gam_columns,
int[] oneBasis) |
static void |
keepFrameKeys(java.util.List<water.Key> keep,
water.Key<water.fvec.Frame>... keyNames) |
static GAMModel.GAMParameters |
makeGAMParameters(GAMModel.GAMParameters parms) |
static water.fvec.Frame |
prepareGamVec(int gam_column_index,
GAMModel.GAMParameters parms,
water.fvec.Frame fr) |
static void |
removeCenteringIS(double[][][] penaltyMatCenter,
GAMModel.GAMParameters parms)
This function is used to remove the dimension change due to centering for I-splines
|
static void |
setDefaultBSType(GAMModel.GAMParameters parms) |
static void |
setDefaultScale(GAMModel.GAMParameters parms) |
static void |
setGamParameters(GAMModel.GAMParameters parms,
int gamIndex,
int splineIndex) |
static void |
setGamPredSize(GAMModel.GAMParameters parms,
int singleSplineOffset)
For each spline type, calculate the gam columns in each gam column group.
|
static void |
setParamField(hex.Model.Parameters parms,
hex.Model.Parameters glmParam,
boolean superClassParams,
java.lang.reflect.Field[] gamFields,
java.util.List<java.lang.String> excludeList) |
static void |
setThinPlateParameters(GAMModel.GAMParameters parms,
int thinPlateNum) |
static java.lang.Integer[] |
sortCoeffMags(int arrayLength,
double[] coeffMags) |
static void |
sortGAMParameters(GAMModel.GAMParameters parms,
int csGamCol,
int isGamCol,
int msGamCol)
move CS spline smoothers to the front and TP spline smoothers to the back for arrays:
gam_columns, bs, scale, num_knots.
|
public static final java.lang.String SPLINENOTIMPL
public static final double EPS
public static double[][][] allocate3DArrayCS(int num2DArrays, GAMModel.GAMParameters parms, GamUtils.AllocateType fileMode)
public static double[][][] allocate3DArray(int num2DArrays, GAMModel.GAMParameters parms, GamUtils.AllocateType fileMode)
public static void removeCenteringIS(double[][][] penaltyMatCenter, GAMModel.GAMParameters parms)
public static double[][][] allocate3DArrayTP(int num2DArrays, GAMModel.GAMParameters parms, int[] secondDim, int[] thirdDim)
public static double[][] allocate2DArray(GamUtils.AllocateType fileMode, int numKnots)
public static java.lang.Integer[] sortCoeffMags(int arrayLength, double[] coeffMags)
public static boolean equalColNames(java.lang.String[] name1, java.lang.String[] standardN, java.lang.String response_column)
public static void copyCVGLMtoGAMModel(GAMModel model, GLMModel glmModel, GAMModel.GAMParameters parms, java.lang.String foldColumn)
public static water.Key[] buildCVGamModels(GAMModel model, GLMModel glmModel, GAMModel.GAMParameters parms, java.lang.String foldColumn)
public static GAMModel.GAMParameters makeGAMParameters(GAMModel.GAMParameters parms)
public static void setParamField(hex.Model.Parameters parms, hex.Model.Parameters glmParam, boolean superClassParams, java.lang.reflect.Field[] gamFields, java.util.List<java.lang.String> excludeList)
public static void keepFrameKeys(java.util.List<water.Key> keep, water.Key<water.fvec.Frame>... keyNames)
public static void setDefaultBSType(GAMModel.GAMParameters parms)
public static void setThinPlateParameters(GAMModel.GAMParameters parms, int thinPlateNum)
public static void setGamPredSize(GAMModel.GAMParameters parms, int singleSplineOffset)
public static double[] generateKnotsOneColumn(water.fvec.Frame gamFrame, int knotNum)
public static water.fvec.Frame prepareGamVec(int gam_column_index, GAMModel.GAMParameters parms, water.fvec.Frame fr)
public static java.lang.String[] generateGamColNames(int gamColIndex, GAMModel.GAMParameters parms)
public static java.lang.String[] generateGamColNamesThinPlateKnots(int gamColIndex, GAMModel.GAMParameters parms, int[][] polyBasisDegree, java.lang.String nameStub)
public static java.lang.String genPolyBasisNames(java.lang.String[] gam_columns, int[] oneBasis)
public static water.fvec.Frame buildGamFrame(GAMModel.GAMParameters parms, water.fvec.Frame train, water.Key<water.fvec.Frame>[] gamFrameKeysCenter, java.lang.String foldColumn)
public static water.fvec.Frame concateGamVecs(water.Key<water.fvec.Frame>[] gamFrameKeysCenter)
public static void sortGAMParameters(GAMModel.GAMParameters parms, int csGamCol, int isGamCol, int msGamCol)
public static void setGamParameters(GAMModel.GAMParameters parms, int gamIndex, int splineIndex)
public static void setDefaultScale(GAMModel.GAMParameters parms)