Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "When inspecting the linear model, first check the coef_
attribute."
A block of code is set as follows:
from sklearn import datasets iris = datasets.load_iris()
Since we will be using IPython Notebooks along most of the examples, expect to have always an input (marked as In:
) and often an output (marked Out:
) from the cell containing the block of code. On your computer you have just to input the code after the In:
and check if results correspond to the Out:
content:
In: clf.fit(X, y) Out: SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0, kernel='rbf', max_iter=-1, probability=False, random_state=None, shrinking=True, tol=0.001, verbose=False)
When a command should be given in the terminal command line, you'll find the command with the prefix $>
, otherwise, if it's for the Python REPL, it will be preceded by >>>
:
$>python >>> import sys >>> print sys.version_info
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.