Skip to content

Commit 2eb7e8e

Browse files
committed
Update .ipynb and .py for DL - plot classification error, not MSE
1 parent a54d6b2 commit 2eb7e8e

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

tutorials/deeplearning/deeplearning.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@
489489
"cell_type": "code",
490490
"execution_count": null,
491491
"metadata": {
492-
"collapsed": true
492+
"collapsed": false
493493
},
494494
"outputs": [],
495495
"source": [
@@ -526,7 +526,7 @@
526526
},
527527
"outputs": [],
528528
"source": [
529-
"var_df = pd.DataFrame(covtype_model_v1.varimp(return_list=True), \n",
529+
"var_df = pd.DataFrame(covtype_model_v1.varimp(), \n",
530530
" columns=[\"Variable\", \"Relative Importance\", \"Scaled Importance\", \"Percentage\"])\n",
531531
"print var_df.shape\n",
532532
"var_df.head(10)"
@@ -574,7 +574,7 @@
574574
"cell_type": "code",
575575
"execution_count": null,
576576
"metadata": {
577-
"collapsed": true
577+
"collapsed": false
578578
},
579579
"outputs": [],
580580
"source": [
@@ -590,8 +590,8 @@
590590
},
591591
"outputs": [],
592592
"source": [
593-
"plt.plot(cov_v2_df['training_MSE'], label=\"training_mse\")\n",
594-
"plt.plot(cov_v2_df['validation_MSE'], label=\"validation_mse\")\n",
593+
"plt.plot(cov_v2_df['training_classification_error'], label=\"training_classification_error\")\n",
594+
"plt.plot(cov_v2_df['validation_classification_error'], label=\"validation_classification_error\")\n",
595595
"plt.title(\"Covertype Deep Learner (Early Stop)\")\n",
596596
"plt.legend();"
597597
]
@@ -627,17 +627,17 @@
627627
"covtype_model_tuned = H2ODeepLearningEstimator(\n",
628628
" model_id=\"covtype_tuned\",\n",
629629
" overwrite_with_best_model=False,\n",
630-
" hidden=[128,128,128], # more hidden layers -> more complex interactions\n",
630+
" hidden=[128,128,128], # more hidden layers -> more complex interactions\n",
631631
" epochs=10, # to keep it short enough\n",
632632
" score_validation_samples=10000, # downsample validation set for faster scoring\n",
633633
" score_duty_cycle=0.025, # don't score more than 2.5% of the wall time\n",
634-
" adaptive_rate=False, # manually tuned learning rate\n",
634+
" adaptive_rate=False, # manually tuned learning rate\n",
635635
" rate=0.01, \n",
636636
" rate_annealing=0.000002, \n",
637637
" momentum_start=0.2, # manually tuned momentum\n",
638638
" momentum_stable=0.4, \n",
639639
" momentum_ramp=10000000, \n",
640-
" l1=0.00001, # add some L1/L2 regularization\n",
640+
" l1=0.00001, # add some L1/L2 regularization\n",
641641
" l2=0.00001,\n",
642642
" max_w2=10 # helps stability for Rectifier\n",
643643
")\n",
@@ -655,7 +655,7 @@
655655
"cell_type": "code",
656656
"execution_count": null,
657657
"metadata": {
658-
"collapsed": true
658+
"collapsed": false
659659
},
660660
"outputs": [],
661661
"source": [
@@ -672,8 +672,8 @@
672672
},
673673
"outputs": [],
674674
"source": [
675-
"plt.plot(cov_tuned_df['training_MSE'], label=\"training_mse\")\n",
676-
"plt.plot(cov_tuned_df['validation_MSE'], label=\"validation_mse\")\n",
675+
"plt.plot(cov_tuned_df['training_classification_error'], label=\"training_classification_error\")\n",
676+
"plt.plot(cov_tuned_df['validation_classification_error'], label=\"validation_classification_error\")\n",
677677
"plt.title(\"Covertype Deep Learner (Tuned)\")\n",
678678
"plt.legend();"
679679
]

tutorials/deeplearning/deeplearning.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def plot_spirals(models, model_names):
296296

297297
# In[ ]:
298298

299-
var_df = pd.DataFrame(covtype_model_v1.varimp(return_list=True),
299+
var_df = pd.DataFrame(covtype_model_v1.varimp(),
300300
columns=["Variable", "Relative Importance", "Scaled Importance", "Percentage"])
301301
print var_df.shape
302302
var_df.head(10)
@@ -332,8 +332,8 @@ def plot_spirals(models, model_names):
332332

333333
# In[ ]:
334334

335-
plt.plot(cov_v2_df['training_MSE'], label="training_mse")
336-
plt.plot(cov_v2_df['validation_MSE'], label="validation_mse")
335+
plt.plot(cov_v2_df['training_classification_error'], label="training_classification_error")
336+
plt.plot(cov_v2_df['validation_classification_error'], label="validation_classification_error")
337337
plt.title("Covertype Deep Learner (Early Stop)")
338338
plt.legend();
339339

@@ -353,17 +353,17 @@ def plot_spirals(models, model_names):
353353
covtype_model_tuned = H2ODeepLearningEstimator(
354354
model_id="covtype_tuned",
355355
overwrite_with_best_model=False,
356-
hidden=[128,128,128], # more hidden layers -> more complex interactions
356+
hidden=[128,128,128], # more hidden layers -> more complex interactions
357357
epochs=10, # to keep it short enough
358358
score_validation_samples=10000, # downsample validation set for faster scoring
359359
score_duty_cycle=0.025, # don't score more than 2.5% of the wall time
360-
adaptive_rate=False, # manually tuned learning rate
360+
adaptive_rate=False, # manually tuned learning rate
361361
rate=0.01,
362362
rate_annealing=0.000002,
363363
momentum_start=0.2, # manually tuned momentum
364364
momentum_stable=0.4,
365365
momentum_ramp=10000000,
366-
l1=0.00001, # add some L1/L2 regularization
366+
l1=0.00001, # add some L1/L2 regularization
367367
l2=0.00001,
368368
max_w2=10 # helps stability for Rectifier
369369
)
@@ -380,8 +380,8 @@ def plot_spirals(models, model_names):
380380

381381
# In[ ]:
382382

383-
plt.plot(cov_tuned_df['training_MSE'], label="training_mse")
384-
plt.plot(cov_tuned_df['validation_MSE'], label="validation_mse")
383+
plt.plot(cov_tuned_df['training_classification_error'], label="training_classification_error")
384+
plt.plot(cov_tuned_df['validation_classification_error'], label="validation_classification_error")
385385
plt.title("Covertype Deep Learner (Tuned)")
386386
plt.legend();
387387

0 commit comments

Comments
 (0)