/
GLM_Vignette.R
134 lines (90 loc) · 3.9 KB
/
GLM_Vignette.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#---------------------------------------------------------------------
#
# Include and run all the R code snippets from the H2O GLM Vignette.
#
# The snippets are broken out into separate files so the exact same
# piece of code both shows up in the document and is run by this
# script.
#
#---------------------------------------------------------------------
setwd("/Users/tomk/0xdata/ws/h2o-3/h2o-docs/src/booklets/v2_2015/source")
library(h2o)
h2o.init()
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_gaussian_example.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_binomial_example.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_poisson_example.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_gamma_example.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_tweedie_example.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/coerce_column_to_factor.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_stopping_criteria.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_cross_validation.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_grid_search_over_alpha.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_grid_search_over_lambda.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_model_output_10.R", echo = T)
source("glm/glm_model_output_20.R", echo = T)
source("glm/glm_model_output_30.R", echo = T)
source("glm/glm_model_output_40.R", echo = T)
source("glm/glm_accessors.R", echo = T)
source("glm/glm_confusion_matrix.R", echo = T)
source("glm/glm_scoring_history.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_binomial_predictions_with_response.R", echo = T)
source("glm/glm_binomial_predictions_without_response.R", echo = T)
source("glm/glm_recalculate_predict.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_download_pojo.R", echo = T)
#---------------------------------------------------------------------
#---------------------------------------------------------------------
h2o.removeAll()
rm(list=ls())
source("glm/glm_compare_cross_validation_folds.R", echo = T)