install.packages("h2o")
Error in install.packages : Updating loaded packages
library("h2o")
h2o.init()
Connection successful!
R is connected to the H2O cluster:
H2O cluster uptime: 9 minutes 12 seconds
H2O cluster timezone: UTC
H2O data parsing timezone: UTC
H2O cluster version: 3.44.0.3
H2O cluster version age: 1 year, 1 month and 14 days
H2O cluster name: H2O_started_from_R_r2993562_yqo644
H2O cluster total nodes: 1
H2O cluster total memory: 0.18 GB
H2O cluster total cores: 1
H2O cluster allowed cores: 1
H2O cluster healthy: TRUE
H2O Connection ip: localhost
H2O Connection port: 54321
H2O Connection proxy: NA
H2O Internal Security: FALSE
R Version: R version 4.3.3 (2024-02-29)
Warning in h2o.clusterInfo() :
Your H2O cluster version is (1 year, 1 month and 14 days) old. There may be a newer version available.
Please download and install the latest version from: https://h2o-release.s3.amazonaws.com/h2o/latest_stable.html
h2o.init(nthreads = -1)
Connection successful!
R is connected to the H2O cluster:
H2O cluster uptime: 9 minutes 12 seconds
H2O cluster timezone: UTC
H2O data parsing timezone: UTC
H2O cluster version: 3.44.0.3
H2O cluster version age: 1 year, 1 month and 14 days
H2O cluster name: H2O_started_from_R_r2993562_yqo644
H2O cluster total nodes: 1
H2O cluster total memory: 0.18 GB
H2O cluster total cores: 1
H2O cluster allowed cores: 1
H2O cluster healthy: TRUE
H2O Connection ip: localhost
H2O Connection port: 54321
H2O Connection proxy: NA
H2O Internal Security: FALSE
R Version: R version 4.3.3 (2024-02-29)
Warning in h2o.clusterInfo() :
Your H2O cluster version is (1 year, 1 month and 14 days) old. There may be a newer version available.
Please download and install the latest version from: https://h2o-release.s3.amazonaws.com/h2o/latest_stable.html
datasets <- "https://raw.githubusercontent.com/DarrenCook/h2o/bk/datasets/"
data <- h2o.importFile(paste0(datasets, "iris_wheader.csv"))
|
| | 0%
|
|================================================================================================================| 100%
y <- "class"
x <- setdiff(names(data), y)
parts <- h2o.splitFrame(data, 0.8)
train <- parts[[1]]
test <- parts[[2]]
m <- h2o.deeplearning(x, y, train)
|
| | 0%
|
|======================================================== | 50%
|
|================================================================================================================| 100%
p <- h2o.predict(m, test)
|
| | 0%
|
|================================================================================================================| 100%
h2o.mse(m)
[1] 0.166816
h2o.confusionMatrix(m)
Confusion Matrix: Row labels: Actual class; Column labels: Predicted class
as.data.frame(h2o.cbind(p$predict, test$class))
mean(p$predict == test$class)
[1] 0.7575758
h2o.performance(m, test)
H2OMultinomialMetrics: deeplearning
Test Set Metrics:
=====================
MSE: (Extract with `h2o.mse`) 0.1970957
RMSE: (Extract with `h2o.rmse`) 0.4439546
Logloss: (Extract with `h2o.logloss`) 0.6533172
Mean Per-Class Error: 0.2424242
AUC: (Extract with `h2o.auc`) NaN
AUCPR: (Extract with `h2o.aucpr`) NaN
Confusion Matrix: Extract with `h2o.confusionMatrix(<model>, <data>)`)
=========================================================================
Confusion Matrix: Row labels: Actual class; Column labels: Predicted class
Hit Ratio Table: Extract with `h2o.hit_ratio_table(<model>, <data>)`
=======================================================================
Top-3 Hit Ratios:
NANANA
LS0tCnRpdGxlOiAiUiAtSDJvIgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgoKCmBgYHtyfQojaW5zdGFsbC5wYWNrYWdlcygiaDJvIikKYGBgCgoKCgpgYGB7cn0KbGlicmFyeSgiaDJvIikKYGBgCgoKYGBge3J9Cmgyby5pbml0KCkKYGBgCgoKCmBgYHtyfQpoMm8uaW5pdChudGhyZWFkcyA9IC0xKQpgYGAKCgoKYGBge3J9CmRhdGFzZXRzIDwtICJodHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vRGFycmVuQ29vay9oMm8vYmsvZGF0YXNldHMvIgpkYXRhIDwtIGgyby5pbXBvcnRGaWxlKHBhc3RlMChkYXRhc2V0cywgImlyaXNfd2hlYWRlci5jc3YiKSkKYGBgCgoKYGBge3J9CnkgPC0gImNsYXNzIiAgCnggPC0gc2V0ZGlmZihuYW1lcyhkYXRhKSwgeSkKcGFydHMgPC0gaDJvLnNwbGl0RnJhbWUoZGF0YSwgMC44K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