Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement accuracy metric #9

Open
dabasajay opened this issue Jul 2, 2019 · 1 comment
Open

Implement accuracy metric #9

dabasajay opened this issue Jul 2, 2019 · 1 comment

Comments

@dabasajay
Copy link
Collaborator

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))
@prince776
Copy link

I would like to solve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants