You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
fromlearnemall.datasetsimportirisfromlearnemall.linearimportLogisticRegressionfromlearnemall.metricsimportaccuracymodel=LogisticRegression()
X,y=iris.load_dataset()
# Take 2 classes onlyX=X [ : , :-2]
y= (y!=0)*1# train the modelmodel.fit(X,y)
# predict using modely_pred=model.predict(X)
# Evaluateprint(accuracy(y, y_pred))
The text was updated successfully, but these errors were encountered:
accuracy
function should take two argumentsy_true
andy_pred
and calculate the accuracy score of binary or multiclass classification (ignore multilabel classification for now).Example code:
The text was updated successfully, but these errors were encountered: