Entradas

Mostrando entradas de 2023

Supervised Classification | hyperparameter optimization and voting ensemble

Imagen
  Supervised Classification | hyperparameter optimization and voting ensemble Using the Titanic dataset, in this exercise, we will perform GridSearchCV on five different classification algorithms to fit the models using the best-performing hyperparameters. Afterwards, we will use an ensemble voting method, a technique in machine learning where multiple individual models are combined to make predictions.  The idea behind ensemble methods is that by combining the predictions of multiple models, overall performance can be better than that of individual models. In this case we will use: Soft Voting: In this approach, each model provides a probability or confidence score for each class, and the scores are averaged or weighted to make the final decision. This is particularly useful when individual models can produce probability estimates. Hard Voting: Each model in the ensemble predicts a class, and the class with the most votes is chosen as the final prediction. #import necessary...

Supervised Learning | Binary Classification with Random Forest Classifier

Imagen
Binary Classification with Random Forest Classifier We will walk through the process of deploying a Random Forest Classifier model. We'll use a model trained on the Titanic dataset to predict passenger survival and explain each step along the way. Step 1: Model Selection and Training A Random Forest Classifier was chosen as the model for this binary classification problem. The model was trained on the preprocessed dataset with a random seed for reproducibility. The goal was to predict whether a passenger survived or not based on various features. Step 2: Data Preprocessing Before training the model, I preprocessed the data to clean and prepare it for analysis. This included: Normalizing passenger names. Extracting ticket numbers and ticket items. Handling missing data in age and embarked columns. One-hot encoding categorical variables like "Sex" and "Embarked. Step 3: Feature Selection The model used a combination of numerical features like "Pclass," ...