Applicazioni pratiche di machine learning/Previsione di reati: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
|||
Riga 167:
<syntaxhighlight lang="rsplus">
test <- as.h2o(testing)
for (i in 1:
m<-h2o.getModel(lb[i,1])
p1 = h2o.predict(m, newdata=test)
Riga 174:
}
</syntaxhighlight>
|======================================================================| 100%
|======================================================================| 100%
[1] 0.5007081
|======================================================================| 100%
[1] 0.4525141
|======================================================================| 100%
[1] 0.519948
|======================================================================| 100%
[1] 0.4719323
|======================================================================| 100%
[1] 0.5122583
|======================================================================| 100%
Il modello XGBoost_grid__1_AutoML_20201007_033612_model_1 ha l'Accuracy maggiore pari al 52% quindi lo si sceglie :
<syntaxhighlight lang="rsplus">
test <- as.h2o(testing)
model <- h2o.getModel(lb[3,1])
p1 = h2o.predict(model, newdata=test)
df2 <- as.data.frame(p1$predict)
confusionMatrix(df2$predict,testing$UCR_PART)
</syntaxhighlight>
Confusion Matrix and Statistics
Reference
Prediction Part One Part Three Part Two
Part One 1621 844 640
Part Three 15359 43627 24315
Part Two 1508 3094 4315
Overall Statistics
Accuracy : 0.5199
95% CI : (0.5168, 0.5231)
No Information Rate : 0.499
P-Value [Acc > NIR] : < 2.2e-16
Kappa : 0.0924
Mcnemar's Test P-Value : < 2.2e-16
Statistics by Class:
Class: Part One Class: Part Three Class: Part Two
Sensitivity 0.08768 0.9172 0.14742
Specificity 0.98069 0.1693 0.93033
Pos Pred Value 0.52206 0.5237 0.48391
Neg Pred Value 0.81710 0.6724 0.71119
Prevalence 0.19395 0.4990 0.30706
Detection Rate 0.01701 0.4577 0.04527
Detection Prevalence 0.03257 0.8739 0.09355
Balanced Accuracy 0.53418 0.5432 0.53887
{{avanzamento|75%|8 ottobre 2020}}
[[Categoria:Applicazioni pratiche di machine learning|/Previsioni di reati]]
|