step build the models predicted value actual value number of correctly predicted cases figure confusion matrixit shows how many cases were correctly classified and incorrectly classified by comparing the prediction with the real values remarkthe classes ( , , were added in the figure for clarification the confusion matrix shows we have correctly predicted + + casesso that' good but is it really surprisenofor the following reasonsfor onethe classifier had but three optionsmarking the difference with last time np around(will round the data to its nearest integer in this case that' either or with only optionsyou can' do much worse than correct on guesseseven for real random distribution like flipping coin secondwe cheated againcorrelating the response variable with the predictors because of the way we did thiswe get most observations being " by guessing " for every case we' already have similar result we compared the prediction with the real valuestruebut we never predicted based on fresh data the prediction was done using the same data as the data used to build the model this is all fine and dandy to make yourself feel goodbut it gives you no indication of whether your model will work when it encounters truly new data for this we need holdout sampleas will be discussed in the next section don' be fooled typing this code won' work miracles by itself it might take while to get the modeling part and all its parameters right to be honestonly handful of techniques have industry-ready implementations in python but it' fairly easy to use models that are available in within python with the help of the rpy library rpy provides an interface from python to is free software environmentwidely used for statistical computing if you haven' alreadyit' worth at least lookbecause in it was still one of the most popular