Python Forum

Full Version: dummy classifier accuracy and recall score
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear Python Experts,
I have been searching for a few hours now how to use a dummy classifier to get the accuracy and recall score
but cant find any parameters or methods to get them.

def x():
    from sklearn.dummy import DummyClassifier
    from sklearn.metrics import recall_score    dummy_classifier = DummyClassifier(strategy="most_frequent")
    dummy_classifier.fit(X_train,y_train)    #recall--------------
    dummy_classifier.score(X_test, y_test)   
    #accuracy-----------
   
    return dummy_classifier.score(X_test, y_test)x()