-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTesting.py
More file actions
19 lines (15 loc) · 760 Bytes
/
Testing.py
File metadata and controls
19 lines (15 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pandas as pd
import joblib as job
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.impute import SimpleImputer
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.metrics import f1_score, accuracy_score, precision_score, recall_score, classification_report
testdata = pd.read_csv('/Users/kylow/Dev/Data Mining/test_data.csv')
best_model = job.load('best_prediction_model.joblib')
testdatapred = best_model.predict(testdata)
tdpdf = pd.DataFrame(testdatapred)
tdpdf = tdpdf.iloc[1:].reset_index(drop=True)
#Change to preferred destination
tdpdf.to_csv('/Users/kylow/Dev/Data Mining/testdatapredictions.csv', index=False)