{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Deep Learning with PyTorch\n", "\n", "Classical machine learning relies on using statistics to determine relationships between features and labels, and can be very effective for creating predictive models. However, a massive growth in the availability of data coupled with advances in the computing technology required to process it has led to the emergence of new machine learning techniques that mimic the way the brain processes information in a structure called an artificial neural network.\n", "\n", "PyTorch is a framework for creating machine learning models, including deep neural networks (DNNs). In this example, we'll use PyTorch to create a simple neural network that classifies penguins into species based on the length and depth of their culmen (bill), their flipper length, and their body mass.\n", "\n", "> **Citation**: The penguins dataset used in the this exercise is a subset of data collected and made available by [Dr. Kristen\n", "Gorman](https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php)\n", "and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/), a\n", "member of the [Long Term Ecological Research\n", "Network](https://lternet.edu/).\n", "\n", "## Explore the Dataset\n", "\n", "Before we start using PyTorch to create a model, let's load the data we need from the Palmer Islands penguins dataset, which contains observations of three different species of penguin.\n", "\n", "> **Note**: In reality, you can solve the penguin classification problem easily using classical machine learning techniques without the need for a deep learning model; but it's a useful, easy to understand dataset with which to demonstrate the principles of neural networks in this notebook." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | CulmenLength | \n", "CulmenDepth | \n", "FlipperLength | \n", "BodyMass | \n", "Species | \n", "
---|---|---|---|---|---|
56 | \n", "39.0 | \n", "17.5 | \n", "18.6 | \n", "35.50 | \n", "0 | \n", "
107 | \n", "38.2 | \n", "20.0 | \n", "19.0 | \n", "39.00 | \n", "0 | \n", "
302 | \n", "50.5 | \n", "18.4 | \n", "20.0 | \n", "34.00 | \n", "2 | \n", "
109 | \n", "43.2 | \n", "19.0 | \n", "19.7 | \n", "47.75 | \n", "0 | \n", "
284 | \n", "46.0 | \n", "18.9 | \n", "19.5 | \n", "41.50 | \n", "2 | \n", "
28 | \n", "37.9 | \n", "18.6 | \n", "17.2 | \n", "31.50 | \n", "0 | \n", "
73 | \n", "45.8 | \n", "18.9 | \n", "19.7 | \n", "41.50 | \n", "0 | \n", "
8 | \n", "34.1 | \n", "18.1 | \n", "19.3 | \n", "34.75 | \n", "0 | \n", "
70 | \n", "33.5 | \n", "19.0 | \n", "19.0 | \n", "36.00 | \n", "0 | \n", "
97 | \n", "40.3 | \n", "18.5 | \n", "19.6 | \n", "43.50 | \n", "0 | \n", "