Conventions used
There are several text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “The code is almost identical to our classification example – instead of a classifier, we use DecisionTreeRegressor
as our model and calculate mean_absolute_error
instead of the F1 score.”
A block of code is set as follows:
import numpy as np import pandas as pd from matplotlib import pyplot as plt import seaborn as sns from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_absolute_error
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
model = DecisionTreeRegressor(random_state=157, max_depth=3, min_samples_split=2) model = model.fit(X_train, y_train) mean_absolute_error(y_test, model.predict(X_test))
Any command-line input or output is written as follows:
conda create -n your_env_name python=3.9
Bold: Indicates a new term, an important word, or words you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Therefore, data preparation and cleaning are essential parts of the machine-learning process.”
Tips or important notes
Appear in blocks such as these.