原书出处
Natural Language Processing in Action, Second Edition
>>> X_train_16d, X_test_16d, y_train_16d, y_test_16d = train_test_split( ... svd_topic_vectors, comments.toxic.values, test_size=0.5, ... random_state=271828) >>> lda_lsa = LinearDiscriminantAnalysis(n_components=1) >>> lda_lsa = lda_lsa.fit(X_train_16d, y_train_16d) >>> round(float(lda_lsa.score(X_train_16d, y_train_16d)), 3) 0.881 >>> round(float(lda_lsa.score(X_test_16d, y_test_16d)), 3) 0.88 Wow, what a difference! The classifier’s accuracy on the training set dropped from 99.9% for TF–IDF vectors to 88.1%, but the test set accuracy jumped by 33%! That’s quite an improvement. Let’s check
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-4.html
EPUB SHA-256:0e9a35e49ca446e322e5524e53f39fb6bee5b2b23d9cda10ef052aca770b0b36