Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

export sklearn.metrics.classification_report as csv

report = classification_report(y_test, y_pred, output_dict=True)
Comment

from sklearn.metrics import classification_report

>>> from sklearn.metrics import classification_report
>>> y_true = [0, 1, 2, 2, 2]
>>> y_pred = [0, 0, 2, 2, 1]
>>> target_names = ['class 0', 'class 1', 'class 2']
>>> print(classification_report(y_true, y_pred, target_names=target_names))
             precision    recall  f1-score   support

    class 0       0.50      1.00      0.67         1
    class 1       0.00      0.00      0.00         1
    class 2       1.00      0.67      0.80         3

avg / total       0.70      0.60      0.61         5
Comment

PREVIOUS NEXT
Code Example
Python :: how to do channel first in pytorch 
Python :: how to make a never ending loop in python 
Python :: django.core.exceptions.FieldError: Unknown field(s) (author) specified for Comment 
Python :: change all columns in dataframe to string 
Python :: prime number program in python print 1 to 100 
Python :: NameError: name ‘pd’ is not defined 
Python :: python delete the last line of console 
Python :: what is a module computer science 
Python :: pyqt5 change table widget column width 
Python :: create np nan array 
Python :: data science standard deviation 
Python :: docker pyinstaller windowa 
Python :: python download video from url requests 
Python :: django setup allowed hosts 
Python :: system commands in python windwos 
Python :: python sort list in reverse 
Python :: dire Bonjour en python 
Python :: scanning 2d array in python 
Python :: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable. 
Python :: python get min max value from a dictionary 
Python :: numpy replace 
Python :: how to make a complex calculator in python 
Python :: pythion code for finding all string lengths in a code 
Python :: get values using iloc 
Python :: write json to file python 
Python :: how to print a float with only 2 digits after decimal in python 
Python :: how to pick a random number in a list python 
Python :: find duplicate in dataset python 
Python :: python pil get pixel 
Python :: python finite difference approximation backward difference 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =