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 :: opencv histogram equalization 
Python :: jupyter themes 
Python :: sum all values of a dictionary python 
Python :: concat dictionary of dataframes 
Python :: pathlib recursive search 
Python :: replace multiple spaces with single space python 
Python :: save image url to png python 
Python :: selenium scroll to element python 
Python :: how to make game on python 
Python :: how to print something with tkinter 
Python :: connect to mysql database jupyter 
Python :: python dict order a dict by key 
Python :: python aritmethic print 
Python :: how to move a column to last in pandas 
Python :: how to sort values in numpy by one column 
Python :: flask return html 
Python :: calculate root mean square error python 
Python :: flask clear session 
Python :: random number pythn 
Python :: pygame hide cursor 
Python :: how to Take Matrix input from user in Python 
Python :: pythondatetime cheatsheet 
Python :: python read arguments 
Python :: pyhton turtle kill 
Python :: how to construct simple timedelta 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 :: on member leave event in discord.py 
Python :: build url python 
Python :: django all urls 
Python :: django wait for database 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =