step build the models of what variables will help you construct good model many modeling techniques are availableand choosing the right model for problem requires judgment on your part you'll need to consider model performance and whether your project meets all the requirements to use your modelas well as other factorsmust the model be moved to production environment andif sowould it be easy to implementhow difficult is the maintenance on the modelhow long will it remain relevant if left untoucheddoes the model need to be easy to explainwhen the thinking is doneit' time for action model execution once you've chosen model you'll need to implement it in code remark this is the first time we'll go into actual python code execution so make sure you have virtual env up and running knowing how to set this up is required knowledgebut if it' your first timecheck out appendix all code from this can be downloaded from com/books/introducing-data-science this comes with an ipython ipynbnotebook and python pyfile luckilymost programming languagessuch as pythonalready have libraries such as statsmodels or scikit-learn these packages use several of the most popular techniques coding model is nontrivial task in most casesso having these libraries available can speed up the process as you can see in the following codeit' fairly easy to use linear regression (figure with statsmodels or scikit-learn doing this yourself would require much more effort even for the simple techniques the following listing shows the execution of linear prediction model listing executing linear prediction model on semi-random data import statsmodels api as sm imports required import numpy as np python modules predictors np random random( reshape( , target predictors dot(np array([ ])np random random( lmregmodel sm ols(target,predictorsresult lmregmodel fit(fits linear creates random data for result summary(regression predictors ( -valuesand shows model fit statistics on data semi-random data for the target ( -valuesof the model we use predictors as input to create the target so we infer correlation here