Chapter 1, Getting Started with Artificial Intelligence in Python, goes through the requirements and a suitable setup, along with the installation of an environment in detail, and you'll also learn a lot of practical tricks to become more productive. Generally, you'll need to set up Python with libraries such as scikit-learn, PyTorch, and TensorFlow. We recommend a GPU or online services such as Google Colab. All code samples have been tested on Linux and macOS. Where necessary, however, we comment in relation to Windows operating systems.
Some of the software and libraries most prominently covered in this book are listed in the following table:
Software/hardware covered in the book |
OS requirements |
Python 3.6 or later |
Windows, macOS X, and Linux (any) |
TensorFlow 2.0 or later |
Windows, macOS X, and Linux (any) |
PyTorch 1.6 or later |
Windows, macOS X, and Linux (any) |
Pandas 1.0 or later |
Windows, macOS X, and Linux (any) |
Scikit-learn 0.22.0 or later |
Windows, macOS X, and Linux (any) |
If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
Download the example code files
You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Artificial-Intelligence-with-Python-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.
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
You can download the example code files for this book from GitHub at https://static.packt-cdn.com/downloads/9781789133967_ColorImages.pdf. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.
CodeInText: 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: "Here is the simplified code for RangeTransformer."
A block of code is set as follows:
import openml
dataset = openml.datasets.get_dataset(40536)
X, y, categorical_indicator, _ = dataset.get_data(
dataset_format='DataFrame',
target=dataset.default_target_attribute
)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
import operator
operator.sub(1, 2) == 1 - 2
# True
Any command-line input or output is written as follows:
$ mkdir css
$ cd css
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."