To get the most out of this book
A basic foundation of Python knowledge, basic machine learning algorithms, and some basic Python libraries, such as NumPy and pandas, is assumed in order to create smart cognitive actions for your projects.
Download the example code files
The code bundle for the book is hosted on GitHub at https://github.com/packtjaniceg/Python-Machine-Learning-by-Example-Fourth-Edition/. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781835085622.
Conventions used
There are a number of 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 (X) handles. Here is an example: “Besides the rating matrix data
, we also record the movie ID
to column index mapping.”
A block of REPL code is set as follows:
>>> smoothing = 1
>>> likelihood = get_likelihood(X_train, label_indices, smoothing)
>>> print('Likelihood:\n', likelihood)
Any output from the code will appear like this:
Likelihood:
{'Y': array([0.4, 0.6, 0.4]), 'N': array([0.33333333, 0.33333333, 0.66666667])}
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: “There are three types of classification based on the possibility of class output—binary, multiclass, and multi-label classification.”
Warnings or important notes appear like this.
Tips and tricks appear like this.