Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

precision recall python

import numpy as np
from sklearn.metrics import precision_recall_fscore_support
y_true = np.array(['cat', 'dog', 'pig', 'cat', 'dog', 'pig'])
y_pred = np.array(['cat', 'pig', 'dog', 'cat', 'cat', 'dog'])
precision_recall_fscore_support(y_true, y_pred, average='macro')

precision_recall_fscore_support(y_true, y_pred, average='micro')

precision_recall_fscore_support(y_true, y_pred, average='weighted')
Comment

precision accuracy recall python example

1
print('Accuracy: %.3f' % accuracy_score(y_test, y_pred))
Comment

PREVIOUS NEXT
Code Example
Python :: import gpio raspberry pi 
Python :: list all files in a folder 
Python :: how to do more than or less than as a condition in pythonb 
Python :: how to become python developer 
Python :: python interview questions and answers pdf 
Python :: Converting 12 hour clock time to 24 hour clock time 
Python :: List Get a Element 
Python :: keras transfer learning 
Python :: how to read specific words from a file in python 
Python :: how to import somthing from another directory in pyhon 
Python :: change the format of date in python 
Python :: iterate through dict with condition 
Python :: python map 
Python :: Program to Compute LCM Using GCD 
Python :: python ravel function 
Python :: Lambda Functions using for loop 
Python :: how to get the length of a string in python stack overflow 
Python :: WARNING: Ignoring invalid distribution c program files python39libsite-packages 
Python :: sort dataframe by function 
Python :: How to JOIN three tables with Django ORM 
Python :: f string 
Python :: spark mllib tutorial 
Python :: find position of key in dictionary python 
Python :: for _ in range() in python 
Python :: Example 1: Reset Index & Drop Old Index pandas 
Python :: json diff python 
Python :: python return multiple value from a function 
Python :: python max of two numbers 
Python :: min and max in python 
Python :: django.core.exceptions.ImproperlyConfigured: Field name is not valid for model 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =