Skip to content

Commit 34f4093

Browse files
committed
Test the implementation is correct
1 parent 3df9ec4 commit 34f4093

2 files changed

Lines changed: 311 additions & 20 deletions

File tree

h2o-algos/src/main/java/hex/glm/GLM.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,10 +3414,12 @@ private void scorePostProcessingRestrictedModel(Frame train, long t1) {
34143414
if (_valid != null) {
34153415
Frame valid = DKV.<Frame>getGet(_parms._valid);
34163416
try {
3417-
//_model._useControlVariables = true;
3417+
_model._useControlVariables = _model._parms._control_variables != null;
3418+
_model._useRemoveOffsetEffects = _model._parms._remove_offset_effects;
34183419
_model.score(_parms.valid(), null, CFuncRef.from(_parms._custom_metric_func)).delete();
34193420
} finally {
3420-
//_model._useControlVariables = true;
3421+
_model._useControlVariables = _model._parms._control_variables != null;
3422+
_model._useRemoveOffsetEffects = _model._parms._remove_offset_effects;
34213423
}
34223424
_model._output._validation_metrics = ModelMetrics.getFromDKV(_model, valid); //updated by model.scoreAndUpdateModel
34233425
ScoreKeeper validScore = new ScoreKeeper(Double.NaN);
@@ -3875,8 +3877,8 @@ private void doCompute() {
38753877
scoringHistoryEarlyStop, scoringHistoryEarlyStopRestricted, sm, null != _parms._valid);
38763878
_model._output._scoring_history_unrestricted_model = combineScoringHistory(_model._output._scoring_history_unrestricted_model, scoringHistoryEarlyStopRestricted);
38773879
_model._output._scoring_history_unrestricted_model.setTableHeader(_model._output._scoring_history_unrestricted_model.getTableHeader()+" unrestricted model");
3878-
// set control variables flag to true for scoring after training
3879-
_model._useControlVariables = !_model._parms._remove_offset_effects;
3880+
// set control variables and remove offset effects flag to true for scoring after training
3881+
_model._useControlVariables = _model._parms._control_variables != null;
38803882
_model._useRemoveOffsetEffects = _model._parms._remove_offset_effects;
38813883
_model._output._varimp = _model._output.calculateVarimp(_model._useControlVariables);
38823884
_model._output._variable_importances_unrestricted_model = calcVarImp(_model._output.calculateVarimp(false));

0 commit comments

Comments
 (0)