diff --git a/src/P1/processing.py b/src/P1/processing.py index fd41bdf..7edbbd0 100644 --- a/src/P1/processing.py +++ b/src/P1/processing.py @@ -8,7 +8,7 @@ from sklearn.metrics import confusion_matrix, roc_auc_score, roc_curve from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.neural_network import MLPClassifier -from sklearn.preprocessing import scale +from sklearn.preprocessing import MinMaxScaler from sklearn.svm import LinearSVC from sklearn.tree import DecisionTreeClassifier @@ -32,7 +32,8 @@ def predict_data(data, target, model, results): model_name = model model = choose_model(model=model) if model_name == "knn": - data = scale(data) + scaler = MinMaxScaler() + data[data.columns] = scaler.fit_transform(data[data.columns]) confusion_matrices, auc, fpr, tpr = [], [], [], [] for train_index, test_index in split_k_sets(data): model.fit(data.iloc[train_index], target.iloc[train_index])