Machine Learning Linear and Logistic Rgression K-Mean
Machine Learning Linear and Logistic Rgression K-Mean
Mam Iram
Table of content
Accuracy
performance metrics
Supervised learning algorithms
Linear Regression
supervised learning algorithms
Logistic Regression
Unsupervised learning algorithms:
K mean Clustering
1. Accuracy
Accuracy is a performance metric used to
evaluate a machine learning model. It is the
ratio of the number of correct predictions made
by the model to the total number of predictions.
Accuracy = Number of Correct Predictions
Total Predictions
Pros: Simple and easy to understand.
Cons: Not reliable for imbalanced datasets.
For example: in a dataset with 95% of one class,
a model predicting only that class would have
95% accuracy but poor performance overall.
2. Performance Metrics
Performance metrics are measures used to
evaluate how well a machine learning model
is performing. They vary depending on the
task (classification, regression, clustering,
etc.):
For Classification Problems:
Precision: True Positives
True Positives + False Positives
Measures correctness of positive predictions.
Recall: True Positives
True Positives + False Negatives
Measures the ability to find all relevant
cases.
F1 Score: Harmonic mean of precision and
recall. Useful when there is an imbalance in
the dataset.
ROC-AUC: Evaluates the trade-off between
sensitivity and specificity.
For Regression Problems:
Mean Absolute Error (MAE): Average of
absolute differences between actual and
predicted values.
Mean Squared Error (MSE): Average of
squared differences between actual and
predicted values. Penalizes larger errors
more.
R² Score (Coefficient of Determination):
Measures how well the model explains the
variance in the data.
For Clustering Problems:
Silhouette Score: Measures how well-
separated clusters are.
Inertia: Measures within-cluster variance.
Lower inertia indicates tighter clusters.
Here's an explanation of the listed topics in
Machine Learning:
4. Unsupervised Learning Algorithms