Skip to content

Commit f80fe56

Browse files
authored
Create MlAlgoCheatSheet.md
1 parent 0f63db8 commit f80fe56

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

DataScience/MlAlgoCheatSheet.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
## Popular Algorithms in Data Science
2+
3+
In data science, various algorithms are employed for tasks such as regression and classification. Each algorithm has associated loss functions and performance metrics that help evaluate its effectiveness. Below is a detailed overview of popular algorithms, their loss functions, performance metrics, and caveats for their use.
4+
5+
### 1. **Linear Regression**
6+
- **Loss Function:** Mean Squared Error (MSE)
7+
- **Performance Metrics:** R-squared (R²), Adjusted R², Mean Absolute Error (MAE)
8+
- **Caveats:** Sensitive to outliers; performs poorly when the relationship between features and target is non-linear.
9+
10+
### 2. **Logistic Regression**
11+
- **Loss Function:** Binary Cross-Entropy Loss (Log Loss)
12+
- **Performance Metrics:** Accuracy, Precision, Recall, F1 Score
13+
- **Caveats:** Assumes linearity between the independent variables and the log odds of the dependent variable; not suitable for multi-class problems without modification.
14+
15+
### 3. **Decision Trees**
16+
- **Loss Function:** Gini Impurity (for classification), Mean Squared Error (for regression)
17+
- **Performance Metrics:** Accuracy, Mean Absolute Error (MAE), Root Mean Squared Error (RMSE)
18+
- **Caveats:** Prone to overfitting; sensitive to small changes in data which can lead to different tree structures.
19+
20+
### 4. **Support Vector Machines (SVM)**
21+
- **Loss Function:** Hinge Loss (for classification), Epsilon-insensitive Loss (for regression)
22+
- **Performance Metrics:** Accuracy, Precision, Recall
23+
- **Caveats:** Computationally expensive for large datasets; requires careful tuning of hyperparameters like the kernel choice.
24+
25+
### 5. **Random Forest**
26+
- **Loss Function:** Mean Squared Error (for regression), Gini Impurity or Cross-Entropy Loss (for classification)
27+
- **Performance Metrics:** Out-of-Bag Error, Accuracy
28+
- **Caveats:** Can be less interpretable than simpler models; may require significant computational resources.
29+
30+
### 6. **Gradient Boosting Machines (GBM)**
31+
- **Loss Function:** Log Loss (for classification), Mean Squared Error (for regression)
32+
- **Performance Metrics:** Log-Likelihood, RMSE
33+
- **Caveats:** Sensitive to overfitting if not properly regularized; requires careful tuning of learning rate and tree depth.
34+
35+
### 7. **Neural Networks**
36+
- **Loss Function:** Cross-Entropy Loss (for classification), Mean Squared Error (for regression)
37+
- **Performance Metrics:** Accuracy, F1 Score, Area Under Curve (AUC)
38+
- **Caveats:** Requires large amounts of data; can be prone to overfitting if not regularized properly; less interpretable compared to traditional models.
39+
40+
### 8. **K-Means Clustering**
41+
- **Loss Function:** Sum of Squared Errors (SSE)
42+
- **Performance Metrics:** Silhouette Score, Davies-Bouldin Index
43+
- **Caveats:** Assumes spherical clusters; sensitive to initial centroid placement; requires specifying the number of clusters in advance.
44+
45+
## Summary of Loss Functions and Performance Metrics
46+
47+
| Algorithm | Loss Function | Performance Metrics |
48+
|------------------------|------------------------------------|----------------------------------------|
49+
| Linear Regression | Mean Squared Error | R², MAE |
50+
| Logistic Regression | Binary Cross-Entropy | Accuracy, F1 Score |
51+
| Decision Trees | Gini Impurity / MSE | Accuracy, MAE |
52+
| Support Vector Machines | Hinge Loss | Accuracy, Precision |
53+
| Random Forest | MSE / Gini Impurity | Out-of-Bag Error |
54+
| Gradient Boosting | Log Loss / MSE | RMSE |
55+
| Neural Networks | Cross-Entropy / MSE | Accuracy, AUC |
56+
| K-Means Clustering | Sum of Squared Errors | Silhouette Score |
57+
58+
## Conclusion
59+
60+
The choice of algorithm depends on the specific characteristics of the dataset and the nature of the problem being solved. Understanding the strengths and weaknesses of each algorithm helps in selecting the most appropriate one for a given task. For instance, while linear regression is simple and interpretable, it may not capture complex relationships in the data. Conversely, neural networks can model intricate patterns but require more data and computational power.
61+
62+
Citations:
63+
64+
[1] https://www.datacamp.com/tutorial/loss-function-in-machine-learning <br/>
65+
[2] https://builtin.com/machine-learning/common-loss-functions <br/>
66+
[3] https://www.ibm.com/think/topics/loss-function <br/>
67+
[4] https://neptune.ai/blog/performance-metrics-in-machine-learning-complete-guide <br/>
68+
[5] https://www.geeksforgeeks.org/ml-common-loss-functions/ <br/>
69+
[6] https://www.linkedin.com/pulse/performance-metrics-loss-function-machine-learning-alok-choudhary-zou7c <br/>
70+
[7] https://towardsdatascience.com/estimators-loss-functions-optimizers-core-of-ml-algorithms-d603f6b0161a <br/>

0 commit comments

Comments
 (0)