In this section, we will introduce boilerplate code for the implementation of the following algorithms by using Patsy and scikit-learn. The reason for doing this is that most of the code for the following algorithms is repeatable.
In the following sections, the workings of the algorithms will be described together with the code specific to each algorithm:
- First, let's make sure that we're in the correct folder by using the following command line. Assuming that the working directory is located at ~/devel/Titanic, we have the following:
In [17]: %cd ~/devel/Titanic /home/youruser/devel/sandbox/Learning/Kaggle/Titanic
- Here, we import the required packages and read in our training and test datasets: