23 lines
625 B
Python
23 lines
625 B
Python
|
|
# 1. Importing new CSV data in pandas dataframes
|
|
import pandas as pd
|
|
data = pd.read_csv("iris_extension.csv")
|
|
|
|
# 2. Separating labels from data
|
|
y = data["label"]
|
|
data = data.drop(columns=["label"])
|
|
x = data.to_numpy()
|
|
|
|
# 3. Loading a trained model
|
|
import pickle
|
|
model = pickle.load(open('iris_classif_model.sav', 'rb'))
|
|
y_pred = model.predict(x)
|
|
|
|
# 4. Evaluating the model with the new data
|
|
from sklearn.metrics import classification_report, confusion_matrix
|
|
print("\n *************** MODEL EVALUATION ****************")
|
|
print("Confusion matrix:")
|
|
print(confusion_matrix(y, y_pred))
|
|
print(classification_report(y,y_pred))
|
|
|