1. Introduction to Machine Learning with Keras
Activity 1.01: Adding Regularization to the Model
In this activity, we will utilize the same logistic regression model from the scikit-learn package. This time, however, we will add regularization to the model and search for the optimum regularization parameter - a process often called hyperparameter tuning
. After training the models, we will test the predictions and compare the model evaluation metrics to the ones that were produced by the baseline model and the model without regularization.
- Load the feature data from Exercise 1.03, Appropriate Representation of the Data, and the target data from Exercise 1.02, Cleaning the Data:
import pandas as pd feats = pd.read_csv('../data/OSI_feats_e3.csv') target = pd.read_csv('../data/OSI_target_e2.csv')
- Create a
test
andtrain
dataset. Train the data using the training dataset. This time, however, use part of thetraining
dataset for validation in order to choose...