accuracy function should take two arguments y_true and y_pred and calculate the accuracy score of binary or multiclass classification (ignore multilabel classification for now).
Example code:
from learnemall.datasets import iris
from learnemall.linear import LogisticRegression
from learnemall.metrics import accuracy
model = LogisticRegression()
X,y = iris.load_dataset()
# Take 2 classes only
X = X [ : , :-2]
y = (y!=0)*1
# train the model
model.fit(X,y)
# predict using model
y_pred = model.predict(X)
# Evaluate
print(accuracy(y, y_pred))
accuracyfunction should take two argumentsy_trueandy_predand calculate the accuracy score of binary or multiclass classification (ignore multilabel classification for now).Example code: