Skip to content

Commit 9b4cde0

Browse files
committed
implement review suggestions
1 parent 8f29aa4 commit 9b4cde0

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,7 +3416,8 @@ private void scoreAndUpdateModel() {
34163416
_model._useRemoveOffsetEffects = false;
34173417
}
34183418
}
3419-
_model.update(_job._key);
3419+
_model.update(_job._key);
3420+
_model.generateSummary(_parms._train, _state._iter);
34203421
}
34213422

34223423
private void scorePostProcessingRestrictedModel(Frame train, long t1) {
@@ -3467,7 +3468,6 @@ private void scorePostProcessingRestrictedModel(Frame train, long t1) {
34673468
_state.alpha());
34683469
}
34693470
}
3470-
_job.update(_workPerIteration, _state.toString());
34713471
}
34723472
_model._output._scoring_history = _scoringHistory != null ? _scoringHistory.to2dTable(_parms, null, null) : null;
34733473
}
@@ -3766,7 +3766,8 @@ public void computeImpl() {
37663766
if (_parms._keepBetaDiffVar)
37673767
keepFrameKeys(keep, _model._output._betadiff_var);
37683768
Scope.untrack(keep.toArray(new Key[keep.size()]));
3769-
}
3769+
}_model.update(_job._key);
3770+
_model.generateSummary(_parms._train, _state._iter);
37703771
_model.unlock(_job);
37713772
}
37723773
}

h2o-docs/src/product/data-science/algo-params/control_variables.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ To get the unrestricted model with its own metrics use ``glm.make_unrestricted_g
2121

2222
The control variables' coefficients are set to zero in the variable importance table. Use the unrestricted model to get the variable importance table with all variables included.
2323

24+
If you set up ``control_variables`` together with ``remove_offset_effects`` feature, model metrics and scoring history is calculated with both effects enabled.
25+
If you need to get model only with one feature enabled, you can get it using ``glm.make_unrestricted_glm_model(control_variables_enabled=True)`` or ``glm.make_unrestricted_glm_model(remove_offset_effects_enabled=True)``
26+
2427

2528
**Notes**:
2629

h2o-docs/src/product/data-science/algo-params/remove_offset_effects.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Model metrics and scoring history are calculated for both the restricted model (
1313

1414
To get the unrestricted model with its own metrics use ``glm.make_unrestricted_glm_model()`` / ``h2o.make_unrestricted_glm_model(glm)``.
1515

16+
If you set up ``remove_offset_effects`` together with ``control_variables`` feature, model metrics and scoring history is calculated with both effects enabled.
17+
If you need to get model only with one feature enabled, you can get it using ``glm.make_unrestricted_glm_model(control_variables_enabled=True)`` or ``glm.make_unrestricted_glm_model(remove_offset_effects_enabled=True)``
1618

1719
**Notes**:
1820

@@ -48,7 +50,7 @@ Example
4850
airlines['FlightNum'] <- as.factor(airlines['FlightNum'])
4951

5052
# set the predictor names and the response column name
51-
predictors <- c("Origin", "Dest", "Year", "UniqueCarrier", "DayOfWeek", "Month", "Distance", "FlightNum")
53+
predictors <- c("Origin", "Dest", "Year", "UniqueCarrier", "DayOfWeek", "Month", "FlightNum")
5254
response <- "IsDepDelayed"
5355

5456
# split into train and validation
@@ -94,7 +96,7 @@ Example
9496
airlines['FlightNum'] = airlines['FlightNum'].asfactor()
9597

9698
# set the predictor names and the response column name
97-
predictors = ["Origin", "Dest", "Year", "UniqueCarrier", "DayOfWeek", "Month", "Distance", "FlightNum"]
99+
predictors = ["Origin", "Dest", "Year", "UniqueCarrier", "DayOfWeek", "Month", "FlightNum"]
98100
response = "IsDepDelayed"
99101

100102
# split into train and validation sets

0 commit comments

Comments
 (0)