Reading the training and testing data sets

Data Cleaning/Encoding/Preprocessing

Let’s create a function for cleaning the training and testing data .Here we are doing two things. 1. Imputing the missing values in Age,fare and Embarked variable. 2. Encoding the categorical variables manually

Plotting Cross-validation Results

Mean Accuracy for cross-validation folds

Let’s check the mean model accuracy of all five folds

print(modelLogisticCV.mean())

0.787851316429

Model Initialization & Fitting

Once you are satisfied with the crossvalidation results,you can fit the model with the same parameters you used during cross-validation.Here I have not chosen any parameter. Let’s now fit the model with the same parameters on the whole data set instead of 4/5th part of data set as we did in crossvalidation

analyticsdataexploration.com is your Data Analytics,Machine Learning and Artificial intelligence website. We provide you with the information and tutorials on latest Machine Learning technologies and videos straight from the data analytics industry.