Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
import pickle
import pandas as pd
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
def Testing( model, file):
test_ = pd.read_csv(file)
p_model = pickle.load(open(model, 'rb'))
predicted_class = p_model.predict(test_['Sym'])
accuracy = model_assessment(Y, predicted_class)
return accuracy
def model_assessment(y_test, predicted_class):
accuracy = accuracy_score(y_test, predicted_class)
accuracy = round(accuracy, 2)
precision=(precision_score(y_test, predicted_class, average='micro'))
precision = round(precision, 2)
recall=(recall_score(y_test, predicted_class, average='micro'))
recall = round(recall, 2)
fscore=(f1_score(y_test, predicted_class, average='micro's))
fscore = round(fscore, 2)