Confusion Matrix | ML | AI | sklearn.metrics.classification_report | Classification Report - P8
#technologycult #confusionmatrix #pythonformachinelearning #classificationreport
Topics to be covered -
Precision, Recall and F1 Score using
1. sklearn.metrics.classification_report
Classification Report
Existing Issue - https://github.com/RasaHQ/rasa/issues...
All Playlist of this youtube channel
=============================
1. Data Preprocessing in Machine Learning
• Data Preprocessing in Machine Learnin...
2. Confusion Matrix in Machine Learning, ML, AI
• Confusion Matrix in Machine Learning,...
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
• Anaconda | Python Installation | Spyd...
4. Cross Validation, Sampling, train test split in Machine Learning
• Cross Validation | Sampling | train t...
5. Drop and Delete Operations in Python Pandas
• Drop and Delete Operations in Python ...
6. Matrices and Vectors with python
• Matrices and Vectors with python
7. Detect Outliers in Machine Learning
• Detect Outliers in Machine Learning
8. TimeSeries preprocessing in Machine Learning
• TimeSeries preprocessing in Machine L...
9. Handling Missing Values in Machine Learning
• Handling Missing Values in Machine Le...
10. Dummy Encoding Encoding in Machine Learning
• Label Encoding, One hot Encoding, Dum...
11. Data Visualisation with Python, Seaborn, Matplotlib
• Data Visualisation with Python, Matpl...
12. Feature Scaling in Machine Learning
• Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
• Python | Python 3 Basics | Python for...
14. Statistics with Python
• Statistics with Python
15. Sklearn Scikit Learn Machine Learning
• Sklearn Scikit Learn Machine Learning
16. Python Pandas Dataframe Operations
• Python Pandas Dataframe Operations
17. Linear Regression, Supervised Machine Learning
• Linear Regression | Supervised Machin...
18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
• Interview Question for Machine Learni...
19. Jupyter Notebook Operations
• Jupyter and Spyder Notebook Operation...
Code Starts Here
==============
from sklearn.metrics import precision_score, recall_score, f1_score
y = [1,0,1,1,2,2,0]
y_pred = [1,1,1,1,1,1,2]
precision_score(y,y_pred,average=None)
recall_score(y,y_pred,average=None)
f1_score(y,y_pred,average=None)
import pandas as pd
from sklearn.linear_model import LogisticRegression
X = pd.read_csv('file1.csv')
y=pd.read_csv('target.csv')
logit=LogisticRegression()
logit.fit(X,y)
y_pred=logit.predict(X)
from sklearn.metrics import confusion_matrix
mat = confusion_matrix(y,y_pred)
from sklearn.metrics import classification_report
classification_report(y,y_pred)
print(classification_report(y,y_pred))
target_names = ['Class A','Class B','Class C']
print(classification_report(y,y_pred,target_names=target_names))
print(classification_report(y,y_pred,labels=[0,1,2]))
print(classification_report(y,y_pred,labels=[0,1,2,3]))