Skip to content

Commit

Permalink
PP-85: add model training time foro GLM2.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpeck committed May 15, 2014
1 parent 87f11e3 commit 71764d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions py/testdir_single_jvm/test_model_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ def test_binary_classifiers(self):
# find all compatible frames
models = node.models(key=model_key, find_compatible_frames=1)
compatible_frames = models['models'][model_key]['compatible_frames']
self.assertNotEqual(models['models'][model_key]['training_duration_in_ms'], 0, "Expected non-zero training time for model: " + model_key)

for frame_key in compatible_frames:
print "Scoring: /2/Models?key=" + model_key + "&score_frame=" + frame_key
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hex/glm/GLM2.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,9 @@ private void nextLambda(final GLMIterationTask glmt, final double [] newBeta){
}
private class Iteration extends H2OCallback<GLMIterationTask> {
public final long _iterationStartTime;
public Iteration(){super(GLM2.this); _iterationStartTime = System.currentTimeMillis();}
public Iteration(){super(GLM2.this); _iterationStartTime = System.currentTimeMillis(); _model.start_training(null);}
@Override public void callback(final GLMIterationTask glmt){
_model.stop_training();
Log.info("GLM2 iteration(" + _iter + ") done in " + (System.currentTimeMillis() - _iterationStartTime) + "ms");
if( !isRunning(self()) ) throw new JobCancelledException();
currentLambdaIter++;
Expand Down

0 comments on commit 71764d4

Please sign in to comment.