Skip to content

Implement accuracy metric #9

Description

@dabasajay

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions