"svm_big_base_clement_confusion_matrix")

# %%
base_cv_results = cross_validate(base_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(base_cv_results, title="svm_big_base_clement_cv_score_bar")

# %%
util.plot_learning_curve(base_model,
                         "svm_big_base_clement_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(base_model, "svm_big_base_clement_word_cloud")

# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = svm.TFIDFSVMModel(ngram=(1, 2))
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y, pred_Y, label="svm_big_tfidf_clement")

# %%
util.visualize_confusion_matrix(tfidf_model, test_X, test_Y,
                                "svm_big_tfidf_clement_confusion_matrix")
Esempio n. 2
0
# %%
base_cv_results = cross_validate(base_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(base_cv_results,
                   title="naive_bayes_uni_base_clement_cv_score_bar")

# %%
util.plot_learning_curve(base_model,
                         "naive_bayes_uni_base_clement_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(base_model, "naive_bayes_uni_base_clement_word_cloud")

# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = nb.TFIDFNaiveBayesModel()
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y,
                             pred_Y,
                             label="naive_bayes_uni_tfidf_clement")

# %%
Esempio n. 3
0
                                "log_reg_big_base_comp_confusion_matrix")

# %%
base_cv_results = cross_validate(base_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(base_cv_results, title="log_reg_big_base_comp_cv_score_bar")

# %%
util.plot_learning_curve(base_model,
                         "log_reg_big_base_comp_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(base_model, "log_reg_big_base_comp_word_cloud")

# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = lr.TFIDFLogRegModel(ngram=(1, 2))
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y, pred_Y, label="log_reg_big_tfidf_comp")

# %%
util.visualize_confusion_matrix(tfidf_model, test_X, test_Y,
                                "log_reg_big_tfidf_comp_confusion_matrix")
Esempio n. 4
0
                                "svm_uni_base_comp_confusion_matrix")

# %%
base_cv_results = cross_validate(base_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(base_cv_results, title="svm_uni_base_comp_cv_score_bar")

# %%
util.plot_learning_curve(base_model,
                         "svm_uni_base_comp_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(base_model, "svm_uni_base_comp_word_cloud")

# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = svm.TFIDFSVMModel()
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y, pred_Y, label="svm_uni_tfidf_comp")

# %%
util.visualize_confusion_matrix(tfidf_model, test_X, test_Y,
                                "svm_uni_tfidf_comp_confusion_matrix")
Esempio n. 5
0
# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = lr.TFIDFLogRegModel()
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y, pred_Y, label="log_reg_uni_tfidf_clement")

# %%
util.visualize_confusion_matrix(tfidf_model, test_X, test_Y,
                                "log_reg_uni_tfidf_clement_confusion_matrix")

# %%
tfidf_cv_results = cross_validate(tfidf_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(tfidf_cv_results,
                   title="log_reg_uni_tfidf_clement_cv_score_bar")

# %%
util.plot_learning_curve(tfidf_model,
                         "log_reg_uni_tfidf_clement_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(tfidf_model, "log_reg_uni_tfidf_clement_word_cloud")
# %%
base_cv_results = cross_validate(base_model, train_X, train_Y, cv=KFold(5))
util.plot_cv_score(base_cv_results,
                   title="naive_bayes_big_base_comp_cv_score_bar")

# %%
util.plot_learning_curve(base_model,
                         "naive_bayes_big_base_comp_learning_curve",
                         train_X,
                         train_Y,
                         cv=KFold(5),
                         n_jobs=4)

# %%
util.plot_word_cloud(base_model, "naive_bayes_big_base_comp_word_cloud")

# %% [markdown]
# <h2> Adding TFIDF </h2>

# %%
tfidf_model = nb.TFIDFNaiveBayesModel(ngram=(1, 2))
tfidf_model.fit(train_X, train_Y)

# %%
pred_Y = tfidf_model.predict(test_X)
util.print_accuracy_measures(test_Y,
                             pred_Y,
                             label="naive_bayes_big_tfidf_comp")

# %%