Add support for math

This commit is contained in:
2024-11-26 11:09:27 +01:00
parent d9d476faef
commit b3d6907b1e
5 changed files with 142 additions and 14 deletions

View File

@@ -68,9 +68,15 @@ Once the model type is defined, the next step is to delve into the full workflow
A machine learning project generally follows these steps:
1. **Data Preparation** Splitting data into training and testing sets.\* Preprocessing: scaling, handling missing values, etc.
2. **Model Training** Fitting the model on training data: `model.fit(X, y)`.\* Optimising parameters and hyperparameters.
3. **Prediction and Evaluation** Making predictions on unseen data: `model.predict(X)`.\* Comparing predictions ($\hat{y}$) with actual values ($y$).
1. **Data Preparation**
- Splitting data into training and testing sets.
- Preprocessing: scaling, handling missing values, etc.
2. **Model Training**
- Fitting the model on training data: `model.fit(X, y)`.
- Optimising parameters and hyperparameters.
3. **Prediction and Evaluation**
- Making predictions on unseen data: `model.predict(X)`.
- Comparing predictions ($$\hat{y}$$) with actual values ($$y$$).
![Modelization in Prog.png](/portfolio/ML/model.png)
@@ -80,14 +86,12 @@ Evaluation is a crucial step to verify the performance of a model. For regressio
For regression problems, the **R² score** measures the proportion of the targets variance explained by the model:
$R2 = 1 - \frac{\text{SS}\_{\text{residual}}}{\text{SS}\_{\text{total}}}$
$$R2 = 1 - \frac{\text{SS}_{\text{residual}}}{\text{SS}_{\text{total}}}$$ where:
Where:
- $$\text{SS}\_{\text{residual}}$$ : Sum of squared residuals between actual and predicted values.
- $$\text{SS}\_{\text{total}}$$ : Total sum of squares relative to the targets mean.
- $\text{SS}\_{\text{residual}}$: Sum of squared residuals between actual and predicted values.
- $\text{SS}\_{\text{total}}$: Total sum of squares relative to the targets mean.
A $R^2$ close to 1 indicates a good fit.
A $$R^2$$ close to 1 indicates a good fit.
![R2 Score.png](/portfolio/ML/r2.png)
@@ -95,4 +99,4 @@ With these concepts in mind, you are better equipped to understand and apply ML
## Conclusion
Machine learning is revolutionising how we solve complex problems using data. Supervised, unsupervised, and reinforcement learning approaches allow us to tackle a wide variety of use cases. In supervised learning, the model choice depends on the problem type, its complexity, and the appropriate algorithmic approach. Finally, a structured workflow and metrics like the R² score ensure the quality of predictions and analyses.
Machine learning is revolutionising how we solve complex problems using data. Supervised, unsupervised, and reinforcement learning approaches allow us to tackle a wide variety of use cases. In supervised learning, the model choice depends on the problem type, its complexity, and the appropriate algorithmic approach. Finally, a structured workflow and metrics like the R² score ensure the quality of predictions and analyses.