In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text,like function names are shown as follows:
We call get_iris_data()
function to get the input data. We leverage the function train_test_split
from Scikit learn's model cross_validation
to split the input datasets into two.
A block of code is set as follows:
# Shuffle the dataset shuff_index = np.random.shuffle(range(len(y))) x_train = x[shuff_index,:].reshape(x.shape) y_train = np.ravel(y[shuff_index,:])
Formulas are typically provided as images as follows,
Typically the math section is introduced at the beginning of each recipe. In some chapters the common math required for most of the recipes in that chapter are included in the introduction section of the first recipe.
External url's are specified as follows:
http://scikit-learn.org/stable/modules/generated/sklearn.metrics.log_loss.html
Specific call-outs in some algorithm implementation details in a third party library is provided as follows.
'The predicted class of an input sample is computed as the class with the highest mean predicted probability. If base estimators do not implement a predict_proba method, then it resorts to voting.'
Where ever applicable references to scientific journals and papers are provided as follows:
Please refer to the paper by Leo Breiman for more information about bagging.
Leo Breiman. 1996. Bagging predictors.Mach. Learn.24, 2 (August 1996), 123-140. DOI=10.1023/A:1018054314350 http://dx.doi.org/10.1023/A:1018054314350
Program output and graphs are typically provided as images. For example:
Any command-line input or output is written as follows:
Counter({'Peter': 4, 'of': 4, 'Piper': 4, 'pickled': 4, 'picked': 4, 'peppers': 4, 'peck': 4, 'a': 2, 'A': 1, 'the': 1, 'Wheres': 1, 'If': 1})
In places where we would like the reader to inspect some of the variables in Python shell, we specify it as follows:
>>> print b_tuple[0] 1 >>> print b_tuple[-1] c >>>