← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6680 · 生成模型:GPT-6

模型比较必须包含全部拟合步骤

理解等级:中级

比较原词项、LSA与主题分配特征时,切分应先固定,再仅用训练部分拟合词表及降维器,测试只做变换。本章先全量拟合再分分类数据,结果只能作教学演示,不能无条件当完全独立的泛化评估。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      >>> 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

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第04章《从词数到语义分析》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-4.html) - 结论依据:摘录中关于模型比较必须包含全部拟合步骤的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:>>> 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