From 9a46cfe9223c9c1370744a6fb12257a86699c082 Mon Sep 17 00:00:00 2001 From: Oskar Neumann Date: Fri, 24 Apr 2020 19:08:07 +0200 Subject: [PATCH] replace deprecated method --- tools/email_preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/email_preprocess.py b/tools/email_preprocess.py index 2528b995904..c2c43a57237 100644 --- a/tools/email_preprocess.py +++ b/tools/email_preprocess.py @@ -4,7 +4,7 @@ import cPickle import numpy -from sklearn import cross_validation +from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_selection import SelectPercentile, f_classif @@ -39,7 +39,7 @@ def preprocess(words_file = "../tools/word_data.pkl", authors_file="../tools/ema ### test_size is the percentage of events assigned to the test set ### (remainder go into training) - features_train, features_test, labels_train, labels_test = cross_validation.train_test_split(word_data, authors, test_size=0.1, random_state=42) + features_train, features_test, labels_train, labels_test = train_test_split(word_data, authors, test_size=0.1, random_state=42)