Update Model training authored by Mykyta Kostohryz's avatar Mykyta Kostohryz
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
2. **Random Forest (RF):** A robust ensemble method that aggregates the predictions of multiple decision trees, ensuring better generalization. 2. **Random Forest (RF):** A robust ensemble method that aggregates the predictions of multiple decision trees, ensuring better generalization.
3. **Logistic Regression:** A fundamental method for binary classification that provides a clear probability-based output. 3. **Logistic Regression:** A fundamental method for binary classification that provides a clear probability-based output.
4. **k-Nearest Neighbors (kNN):** A non-parametric model that predicts based on the closest neighbors, effective for classification tasks. 4. **k-Nearest Neighbors (kNN):** A non-parametric model that predicts based on the closest neighbors, effective for classification tasks.
5. **Ensemble Model (SVM + Random Forest):**
- Combines the strengths of both SVM and Random Forest to improve the accuracy and robustness of predictions.
- The ensemble method uses **voting** or **stacking** to combine the individual predictions from SVM and Random Forest.
- **Voting Classifier:** Predicts the class by taking a majority vote from both SVM and Random Forest predictions.
- **Hyperparameter Tuning:** - **Hyperparameter Tuning:**
- **GridSearchCV:** A search over a specified parameter grid is used to identify the best hyperparameters for each model. - **GridSearchCV:** A search over a specified parameter grid is used to identify the best hyperparameters for each model.
...@@ -32,9 +36,7 @@ ...@@ -32,9 +36,7 @@
- **Random Forest:** Number of trees (n_estimators), maximum depth (max_depth), and minimum samples for splits. - **Random Forest:** Number of trees (n_estimators), maximum depth (max_depth), and minimum samples for splits.
- **Logistic Regression:** Regularization strength (C) and solver. - **Logistic Regression:** Regularization strength (C) and solver.
- **kNN:** Number of neighbors (n_neighbors) and distance metric. - **kNN:** Number of neighbors (n_neighbors) and distance metric.
- **Ensemble Model (SVM + Random Forest):** Combines the strengths of both SVM and Random Forest to improve the accuracy and robustness of predictions. - **Ensemble Model:** Hyperparameters for both SVM and Random Forest models are optimized separately before being combined in the ensemble method.
- The ensemble method uses **voting** or **stacking** to combine the individual predictions from SVM and Random Forest.
- **Voting Classifier:** Predicts the class by taking a majority vote from both SVM and Random Forest predictions.
### Step 4: Model Evaluation ### Step 4: Model Evaluation
- After training, models are evaluated using multiple metrics: - After training, models are evaluated using multiple metrics:
... ...
......