amazon-review-classifiers / classifiers.json
abelcetina's picture
Portable classifiers
fefb1dd verified
Raw History Blame Contribute Delete
14 kB
{
"data": {
"train_rows_raw": 3600000,
"train_rows_removed_in_test": 0,
"train_rows_removed_duplicates": 0,
"train_rows_clean": 3600000,
"test_rows": 400000,
"cv_sample": 200000,
"final_train_sample": 1000000,
"test_eval_rows": 400000,
"cv_class_counts": {
"0": 100000,
"1": 100000
},
"test_class_counts": {
"0": 200000,
"1": 200000
}
},
"machine": {
"platform": "Windows-11-10.0.26200-SP0",
"python": "3.12.6"
},
"models": {
"tfidf_logreg": {
"params": {
"max_features": 500000,
"ngram_range": [
1,
2
],
"min_df": 3,
"max_df": 0.95,
"C": 4.0,
"max_iter": 1000,
"seed": 42
},
"cv": {
"k": 5,
"seed": 42,
"folds": [
{
"accuracy": 0.9271,
"precision": 0.928686138713239,
"recall": 0.92525,
"f1": 0.926964885037319,
"macro_f1": 0.927099750498896,
"roc_auc": 0.9778334387500001,
"seconds": 35.470371400006115,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.928825,
"precision": 0.9294046963400591,
"recall": 0.92815,
"f1": 0.9287769244239862,
"macro_f1": 0.9288249675708758,
"roc_auc": 0.9779667525000001,
"seconds": 33.100827900052536,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.925425,
"precision": 0.9242159844443336,
"recall": 0.92685,
"f1": 0.9255311181566268,
"macro_f1": 0.9254248485658332,
"roc_auc": 0.97738443875,
"seconds": 33.14103190001333,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.93055,
"precision": 0.9326266077170418,
"recall": 0.92815,
"f1": 0.9303829190056134,
"macro_f1": 0.9305495999656959,
"roc_auc": 0.9783388662500001,
"seconds": 34.1310722999624,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.9239,
"precision": 0.9245793269230769,
"recall": 0.9231,
"f1": 0.9238390712570056,
"macro_f1": 0.9238999512959688,
"roc_auc": 0.9777508374999998,
"seconds": 33.133894800033886,
"n_train": 160000,
"n_val": 40000
}
],
"summary": {
"accuracy": {
"mean": 0.92716,
"sd": 0.0026412946636071963
},
"precision": {
"mean": 0.92790255082755,
"sd": 0.0035292263113757306
},
"recall": {
"mean": 0.9263,
"sd": 0.002149999999999996
},
"f1": {
"mean": 0.9270989835761103,
"sd": 0.0025837438976263234
},
"macro_f1": {
"mean": 0.927159823579454,
"sd": 0.0026412025120398524
},
"roc_auc": {
"mean": 0.9778548667500001,
"sd": 0.0003461783082014993
},
"seconds": {
"mean": 33.795439660013656,
"sd": 1.032765972743064
}
}
},
"cv_seconds": 169.04506689996924,
"fit_seconds": 182.13359199999832,
"vocabulary_size": 500000,
"predict_seconds": 44.414174400037155,
"test": {
"metrics": {
"accuracy": 0.938035,
"precision": 0.9380087194768314,
"recall": 0.938065,
"f1": 0.9380368588942332,
"macro_f1": 0.9380349999442315,
"roc_auc": 0.9826685887500002
},
"classification_report": {
"negative": {
"precision": 0.9380612836770206,
"recall": 0.938005,
"f1-score": 0.9380331409942299,
"support": 200000.0
},
"positive": {
"precision": 0.9380087194768314,
"recall": 0.938065,
"f1-score": 0.9380368588942332,
"support": 200000.0
},
"accuracy": 0.938035,
"macro avg": {
"precision": 0.938035001576926,
"recall": 0.938035,
"f1-score": 0.9380349999442315,
"support": 400000.0
},
"weighted avg": {
"precision": 0.938035001576926,
"recall": 0.938035,
"f1-score": 0.9380349999442316,
"support": 400000.0
}
},
"classification_report_text": " precision recall f1-score support\n\n negative 0.9381 0.9380 0.9380 200000\n positive 0.9380 0.9381 0.9380 200000\n\n accuracy 0.9380 400000\n macro avg 0.9380 0.9380 0.9380 400000\nweighted avg 0.9380 0.9380 0.9380 400000\n",
"confusion_matrix": [
[
187601,
12399
],
[
12387,
187613
]
]
},
"top_features": {
"negative": [
[
"not worth",
-33.13134002685547
],
[
"disappointing",
-28.9620418548584
],
[
"not",
-25.559701919555664
],
[
"2 stars",
-22.686147689819336
],
[
"not recommend",
-21.881484985351562
],
[
"disappointment",
-21.26935386657715
],
[
"awful",
-21.2116756439209
],
[
"two stars",
-21.038969039916992
],
[
"poorly",
-20.9211368560791
],
[
"horrible",
-19.031095504760742
],
[
"worst",
-18.86812400817871
],
[
"not very",
-18.684253692626953
],
[
"useless",
-18.621469497680664
],
[
"at best",
-18.3948974609375
],
[
"terrible",
-17.579355239868164
]
],
"positive": [
[
"great",
27.76874351501465
],
[
"4 stars",
20.04746437072754
],
[
"a must",
17.982744216918945
],
[
"not bad",
17.86312484741211
],
[
"not disappointed",
17.835979461669922
],
[
"excellent",
17.744455337524414
],
[
"my only",
17.331737518310547
],
[
"good",
17.178146362304688
],
[
"best",
16.079877853393555
],
[
"be disappointed",
16.032546997070312
],
[
"no problems",
14.654282569885254
],
[
"awesome",
14.313421249389648
],
[
"four stars",
14.306000709533691
],
[
"just what",
13.373373031616211
],
[
"even better",
13.221014976501465
]
]
}
},
"review_dnn": {
"config": {
"vocab_size": 30000,
"seq_len": 200,
"emb_dim": 96,
"encoder": "cnn",
"filters": 128,
"rnn_units": 64,
"dense_units": 64,
"dropout": 0.4,
"lr": 0.002,
"seed": 42
},
"fit": {
"epochs": 4,
"batch_size": 256,
"patience": 1
},
"cv": {
"k": 5,
"seed": 42,
"folds": [
{
"accuracy": 0.9125,
"precision": 0.9132852419597235,
"recall": 0.91155,
"f1": 0.9124167959561583,
"macro_f1": 0.9124999210311787,
"roc_auc": 0.97086402125,
"seconds": 173.42162570002256,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.913075,
"precision": 0.9122299286462752,
"recall": 0.9141,
"f1": 0.9131640068929348,
"macro_f1": 0.913074908674326,
"roc_auc": 0.9708592100000001,
"seconds": 171.52324439998483,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.910025,
"precision": 0.9018474053021022,
"recall": 0.9202,
"f1": 0.9109312742841587,
"macro_f1": 0.9100156838675106,
"roc_auc": 0.9693099550000001,
"seconds": 174.84280709997984,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.91055,
"precision": 0.933252427184466,
"recall": 0.88435,
"f1": 0.9081433559252413,
"macro_f1": 0.9104885557642188,
"roc_auc": 0.970956505,
"seconds": 288.10437699995236,
"n_train": 160000,
"n_val": 40000
},
{
"accuracy": 0.9119,
"precision": 0.9043388632570923,
"recall": 0.92125,
"f1": 0.9127161044236389,
"macro_f1": 0.9118922974043698,
"roc_auc": 0.9717235374999998,
"seconds": 275.6892496999935,
"n_train": 160000,
"n_val": 40000
}
],
"summary": {
"accuracy": {
"mean": 0.9116099999999999,
"sd": 0.001290179251112035
},
"precision": {
"mean": 0.9129907732699319,
"sd": 0.012351421094753599
},
"recall": {
"mean": 0.91029,
"sd": 0.015060851569549465
},
"f1": {
"mean": 0.9114743074964263,
"sd": 0.0020417854683419394
},
"macro_f1": {
"mean": 0.9115942733483207,
"sd": 0.0013053594482728683
},
"roc_auc": {
"mean": 0.97074264575,
"sd": 0.0008787500249704196
},
"seconds": {
"mean": 216.7162607799866,
"sd": 59.67473677972244
}
}
},
"cv_seconds": 1083.6313545000157,
"fit_seconds": 1573.5733835999854,
"history": {
"accuracy": [
0.908715546131134,
0.934874415397644,
0.9450677633285522
],
"auc": [
0.9689652323722839,
0.9817413687705994,
0.9860914945602417
],
"loss": [
0.22511020302772522,
0.17026671767234802,
0.14685384929180145
],
"val_accuracy": [
0.9310600161552429,
0.9336199760437012,
0.933430016040802
],
"val_auc": [
0.9798209071159363,
0.980864405632019,
0.9805585741996765
],
"val_loss": [
0.18116672337055206,
0.17459361255168915,
0.1780567616224289
],
"seconds": [
1551.7203770999913
]
},
"params": 2995073,
"predict_seconds": 33.437053100031335,
"test": {
"metrics": {
"accuracy": 0.93424,
"precision": 0.9308834181724367,
"recall": 0.938135,
"f1": 0.9344951414241529,
"macro_f1": 0.9342390023382605,
"roc_auc": 0.9814710290749998
},
"classification_report": {
"negative": {
"precision": 0.937649287953155,
"recall": 0.930345,
"f1-score": 0.933982863252368,
"support": 200000.0
},
"positive": {
"precision": 0.9308834181724367,
"recall": 0.938135,
"f1-score": 0.9344951414241529,
"support": 200000.0
},
"accuracy": 0.93424,
"macro avg": {
"precision": 0.9342663530627959,
"recall": 0.93424,
"f1-score": 0.9342390023382605,
"support": 400000.0
},
"weighted avg": {
"precision": 0.9342663530627958,
"recall": 0.93424,
"f1-score": 0.9342390023382605,
"support": 400000.0
}
},
"classification_report_text": " precision recall f1-score support\n\n negative 0.9376 0.9303 0.9340 200000\n positive 0.9309 0.9381 0.9345 200000\n\n accuracy 0.9342 400000\n macro avg 0.9343 0.9342 0.9342 400000\nweighted avg 0.9343 0.9342 0.9342 400000\n",
"confusion_matrix": [
[
186069,
13931
],
[
12373,
187627
]
]
}
}
}
}