public class GLMModel extends hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput> implements hex.Model.Contributions
Modifier and Type | Class and Description |
---|---|
static class |
GLMModel.GLMOutput |
static class |
GLMModel.GLMParameters |
static class |
GLMModel.GLMWeights |
static class |
GLMModel.GLMWeightsFun |
static class |
GLMModel.RegularizationPath |
static class |
GLMModel.Submodel |
hex.Model.AdaptFrameParameters, hex.Model.BigScore, hex.Model.BigScoreChunkPredict, hex.Model.BigScorePredict, hex.Model.Contributions, hex.Model.DeepFeatures, hex.Model.ExemplarMembers, hex.Model.FeatureFrequencies, hex.Model.GetMostImportantFeatures, hex.Model.GetNTrees, hex.Model.GLRMArchetypes, hex.Model.GridSortBy, hex.Model.H2OModelDescriptor, hex.Model.InteractionBuilder, hex.Model.InteractionPair, hex.Model.InteractionSpec, hex.Model.JavaModelStreamWriter, hex.Model.JavaScoringOptions, hex.Model.LeafNodeAssignment, hex.Model.Output, hex.Model.Parameters, hex.Model.PredictScoreResult, hex.Model.RowToTreeAssignment, hex.Model.StagedPredictions, hex.Model.UpdateAuxTreeWeights
Modifier and Type | Field and Description |
---|---|
double[] |
_betaCndCheckpoint |
static double |
_EPS |
boolean |
_finalScoring |
double |
_lambda_max |
long |
_nobs |
long |
_nullDOF |
static double |
_OneOEPS |
double[] |
_ymu |
double |
_ySigma |
Constructor and Description |
---|
GLMModel(water.Key selfKey,
GLMModel.GLMParameters parms,
GLM job,
double[] ymu,
double ySigma,
double lambda_max,
long nobs) |
Modifier and Type | Method and Description |
---|---|
void |
addScoringInfo(GLMModel.GLMParameters parms,
int nclasses,
long currTime,
int iter) |
GLMModel |
addSubmodel(int idx,
GLMModel.Submodel sm) |
protected double[] |
beta_internal() |
double[] |
beta_std(double lambda) |
double[] |
beta() |
double[] |
beta(double lambda) |
java.lang.String[] |
buildVariableInflationFactors(water.fvec.Frame train,
DataInfo dinfo)
This method will calculate the variable inflation factor of each numerical predictor using the following
procedure:
1.
|
java.lang.String[] |
buildVariableInflationFactors(GLMModel.GLMParameters parms,
java.lang.String[] validPredictors,
java.lang.String[] predictorNames) |
long |
checksum_impl() |
java.util.HashMap<java.lang.String,java.lang.Double> |
coefficients()
get beta coefficients in a map indexed by name
|
java.util.HashMap<java.lang.String,java.lang.Double> |
coefficients(boolean standardized) |
protected GLMModel |
deepClone(water.Key<GLMModel> result) |
double |
deviance(double w,
double y,
double f) |
DataInfo |
dinfo() |
water.util.TwoDimTable |
generateSummary(water.Key train,
int iter)
Re-do the TwoDim table generation with updated model.
|
GLMMojoWriter |
getMojo() |
GLMModel.RegularizationPath |
getRegularizationPath() |
water.fvec.Frame |
getRIDFrame() |
hex.ScoringInfo[] |
getScoringInfo() |
boolean |
haveMojo() |
boolean |
havePojo() |
void |
initActualParamValues() |
protected boolean |
isFeatureUsedInPredict(int featureIdx) |
double |
likelihood(double w,
double y,
double[] f) |
hex.ModelMetrics.MetricBuilder |
makeMetricBuilder(java.lang.String[] domain) |
java.lang.String[] |
makeScoringNames() |
java.lang.String[] |
names() |
protected boolean |
needsPostProcess() |
protected hex.Model.PredictScoreResult |
predictScoreImpl(water.fvec.Frame fr,
water.fvec.Frame adaptFrm,
java.lang.String destination_key,
water.Job j,
boolean computeMetrics,
water.udf.CFuncRef customMetricFunc)
Score an already adapted frame.
|
protected water.Keyed |
readAll_impl(water.AutoBuffer ab,
water.Futures fs) |
protected water.Futures |
remove_impl(water.Futures fs,
boolean cascade) |
double |
score(double[] data) |
protected double[] |
score0(double[] data,
double[] preds) |
protected double[] |
score0(double[] data,
double[] preds,
double o) |
water.fvec.Frame |
scoreContributions(water.fvec.Frame frame,
water.Key<water.fvec.Frame> destination_key,
water.Job<water.fvec.Frame> j,
hex.Model.Contributions.ContributionsOptions options,
water.fvec.Frame backgroundFrame) |
hex.ScoreKeeper[] |
scoreKeepers() |
protected hex.ModelMetrics.MetricBuilder |
scoreMetrics(water.fvec.Frame adaptFrm)
Score an already adapted frame.
|
protected java.lang.String[][] |
scoringDomains() |
void |
setDispersion(double dispersion,
boolean dispersionEstimated) |
void |
setVcov(double[][] inv) |
void |
setZValues(double[] zValues,
double dispersion,
boolean dispersionEstimated) |
protected boolean |
toJavaCheckTooBig() |
protected water.util.SBPrintStream |
toJavaInit(water.util.SBPrintStream sb,
water.codegen.CodeGeneratorPipeline fileCtx) |
protected void |
toJavaPredictBody(water.util.SBPrintStream body,
water.codegen.CodeGeneratorPipeline classCtx,
water.codegen.CodeGeneratorPipeline fileCtx,
boolean verboseCode) |
void |
update(double[] beta,
double[] ubeta,
double devianceTrain,
double devianceTest,
int iter) |
void |
update(double[] beta,
double devianceTrain,
double devianceTest,
int iter) |
GLMModel |
updateSubmodel(int idx,
GLMModel.Submodel sm) |
protected water.AutoBuffer |
writeAll_impl(water.AutoBuffer ab) |
adaptFrameForScore, adaptTestForJavaScoring, adaptTestForTrain, adaptTestForTrain, adaptTestForTrain, addMetrics, addModelMetrics, addWarning, aic, auc, AUCPR, classification_error, compareTo, computeDeviances, containsResponse, data, defaultThreshold, defaultThreshold, deleteCrossValidationFoldAssignment, deleteCrossValidationModels, deleteCrossValidationPreds, deviance, evaluateAutoModelParameters, exportBinaryModel, exportMojo, fetchAll, fillScoringInfo, getDefaultGridSortBy, getGenModelEncoding, getPojoInterfaces, getToEigenVec, importBinaryModel, isDistributionHuber, isFeatureUsedInPredict, isGeneric, isSupervised, last_scored, lift_top_group, logloss, loss, mae, makeAdaptFrameParameters, makeBigScoreTask, makeInteraction, makeInteractions, makeInteractions, makePojoWriter, makeSchema, makeScoringDomains, makeScoringNames, mean_per_class_error, modelDescriptor, mse, postProcessPredictions, r2, resetThreshold, result, rmsle, score, score, score, score, score, score, score, score0, score0, score0PostProcessSupervised, scoring_history, setInputParms, setupBigScorePredict, testJavaScoring, testJavaScoring, testJavaScoring, testJavaScoring, testJavaScoring, toJava, toJava, toJava, toJavaAlgo, toJavaModelClassName, toJavaTransform, toJavaUUID, toMojo, toMojo, toString, transform, uploadBinaryModel, writeTo
delete_and_lock, delete_and_lock, delete_and_lock, delete_and_lock, delete, delete, delete, delete, read_lock, read_lock, read_lock, unlock_all, unlock, unlock, unlock, unlock, update, update, update, write_lock_to_read_lock, write_lock, write_lock, write_lock
checksum_impl, checksum, checksum, getKey, readAll, remove_impl, remove_self_key_impl, remove, remove, remove, remove, remove, remove, removeQuietly, writeAll
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public static final double _EPS
public static final double _OneOEPS
public final double _lambda_max
public final double[] _ymu
public final long _nullDOF
public final double _ySigma
public final long _nobs
public double[] _betaCndCheckpoint
public boolean _finalScoring
public GLMModel(water.Key selfKey, GLMModel.GLMParameters parms, GLM job, double[] ymu, double ySigma, double lambda_max, long nobs)
public water.fvec.Frame getRIDFrame()
public void initActualParamValues()
initActualParamValues
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public hex.ScoreKeeper[] scoreKeepers()
public hex.ScoringInfo[] getScoringInfo()
public void addScoringInfo(GLMModel.GLMParameters parms, int nclasses, long currTime, int iter)
public void setVcov(double[][] inv)
public java.lang.String[] buildVariableInflationFactors(water.fvec.Frame train, DataInfo dinfo)
public java.lang.String[] buildVariableInflationFactors(GLMModel.GLMParameters parms, java.lang.String[] validPredictors, java.lang.String[] predictorNames)
public water.fvec.Frame scoreContributions(water.fvec.Frame frame, water.Key<water.fvec.Frame> destination_key, water.Job<water.fvec.Frame> j, hex.Model.Contributions.ContributionsOptions options, water.fvec.Frame backgroundFrame)
scoreContributions
in interface hex.Model.Contributions
public GLMModel.RegularizationPath getRegularizationPath()
protected boolean toJavaCheckTooBig()
toJavaCheckTooBig
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public DataInfo dinfo()
public hex.ModelMetrics.MetricBuilder makeMetricBuilder(java.lang.String[] domain)
makeMetricBuilder
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected double[] beta_internal()
public double[] beta()
public double[] beta(double lambda)
public double[] beta_std(double lambda)
public java.lang.String[] names()
public double deviance(double w, double y, double f)
deviance
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public double likelihood(double w, double y, double[] f)
likelihood
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public GLMModel addSubmodel(int idx, GLMModel.Submodel sm)
public GLMModel updateSubmodel(int idx, GLMModel.Submodel sm)
public void update(double[] beta, double devianceTrain, double devianceTest, int iter)
public void update(double[] beta, double[] ubeta, double devianceTrain, double devianceTest, int iter)
protected java.lang.String[][] scoringDomains()
scoringDomains
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public void setZValues(double[] zValues, double dispersion, boolean dispersionEstimated)
public void setDispersion(double dispersion, boolean dispersionEstimated)
public java.util.HashMap<java.lang.String,java.lang.Double> coefficients()
public java.util.HashMap<java.lang.String,java.lang.Double> coefficients(boolean standardized)
public water.util.TwoDimTable generateSummary(water.Key train, int iter)
public long checksum_impl()
checksum_impl
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected double[] score0(double[] data, double[] preds)
score0
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected double[] score0(double[] data, double[] preds, double o)
score0
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected boolean needsPostProcess()
needsPostProcess
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public double score(double[] data)
score
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected void toJavaPredictBody(water.util.SBPrintStream body, water.codegen.CodeGeneratorPipeline classCtx, water.codegen.CodeGeneratorPipeline fileCtx, boolean verboseCode)
toJavaPredictBody
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected water.util.SBPrintStream toJavaInit(water.util.SBPrintStream sb, water.codegen.CodeGeneratorPipeline fileCtx)
toJavaInit
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected hex.Model.PredictScoreResult predictScoreImpl(water.fvec.Frame fr, water.fvec.Frame adaptFrm, java.lang.String destination_key, water.Job j, boolean computeMetrics, water.udf.CFuncRef customMetricFunc)
predictScoreImpl
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
adaptFrm
- Already adapted framecomputeMetrics
- public java.lang.String[] makeScoringNames()
makeScoringNames
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected hex.ModelMetrics.MetricBuilder scoreMetrics(water.fvec.Frame adaptFrm)
scoreMetrics
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
adaptFrm
- Already adapted framepublic boolean haveMojo()
haveMojo
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public boolean havePojo()
havePojo
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
public GLMMojoWriter getMojo()
getMojo
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected boolean isFeatureUsedInPredict(int featureIdx)
isFeatureUsedInPredict
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected water.Futures remove_impl(water.Futures fs, boolean cascade)
remove_impl
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected water.AutoBuffer writeAll_impl(water.AutoBuffer ab)
writeAll_impl
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>
protected water.Keyed readAll_impl(water.AutoBuffer ab, water.Futures fs)
readAll_impl
in class hex.Model<GLMModel,GLMModel.GLMParameters,GLMModel.GLMOutput>