Kernel: Python 3 (ipykernel)
Machine Learning with PyTorch and Scikit-Learn
-- Code Examples
Package version checks
Add folder to path in order to load from the check_packages.py script:
In [1]:
Check recommended package versions:
In [2]:
Out[2]:
[OK] Your Python version is 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:35:11)
[Clang 11.1.0 ]
[OK] numpy 1.22.0
[OK] matplotlib 3.5.1
[OK] pandas 1.3.5
Chapter 2 - Training Machine Learning Algorithms for Classification
Overview
In [3]:
Artificial neurons - a brief glimpse into the early history of machine learning
In [4]:
Out[4]:
The formal definition of an artificial neuron
In [5]:
Out[5]:
The perceptron learning rule
In [6]:
Out[6]:
In [7]:
Out[7]:
Implementing a perceptron learning algorithm in Python
An object-oriented perceptron API
In [8]:
In [9]:
Out[9]:
0.0
Training a perceptron model on the Iris dataset
...
Reading-in the Iris data
In [10]:
Out[10]:
From URL: https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data
Plotting the Iris data
In [11]:
Out[11]:
Training the perceptron model
In [12]:
Out[12]:
A function for plotting decision regions
In [13]:
In [14]:
Out[14]:
Adaptive linear neurons and the convergence of learning
...
Minimizing cost functions with gradient descent
In [15]:
Out[15]:
In [16]:
Out[16]:
Implementing an adaptive linear neuron in Python
In [17]:
In [18]:
Out[18]:
In [19]:
Out[19]:
Improving gradient descent through feature scaling
In [20]:
Out[20]:
In [21]:
In [22]:
Out[22]:
Large scale machine learning and stochastic gradient descent
In [23]:
In [24]:
Out[24]:
In [25]:
Out[25]:
<__main__.AdalineSGD at 0x127b2f280>
Summary
...
---
Readers may ignore the following cell
In [26]:
Out[26]:
[NbConvertApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `NbConvertApp`.
[NbConvertApp] Converting notebook ch02.ipynb to script
[NbConvertApp] Writing 16083 bytes to ch02.py
In [ ]: