_index.org

AIBridge Iris Variance Worksheet

Last edited: August 8, 2025

SPOILER ALERT for future labs!! Don’t scroll down!

We are going to create a copy of the iris dataset with a random variance.

import sklearn
from sklearn.datasets import load_iris

Let’s load the iris dataset:

x,y = load_iris(return_X_y=True)

Because we need to generate a lot of random data, let’s import random

import random

Put this in a df

import pandas as pd
df = pd.DataFrame(x)
df
       0    1    2    3
0    5.1  3.5  1.4  0.2
1    4.9  3.0  1.4  0.2
2    4.7  3.2  1.3  0.2
3    4.6  3.1  1.5  0.2
4    5.0  3.6  1.4  0.2
..   ...  ...  ...  ...
145  6.7  3.0  5.2  2.3
146  6.3  2.5  5.0  1.9
147  6.5  3.0  5.2  2.0
148  6.2  3.4  5.4  2.3
149  5.9  3.0  5.1  1.8

[150 rows x 4 columns]

Let’s make 150 random numbers with pretty low variance:

AIBridge Packages and Tools

Last edited: August 8, 2025

This is usually not needed if you are using Google Colab. If you are following the instructions provided during our lecture series, please disregard this page.

However, students have expressed interest in working with their own system’s copy of Jupyter or local installation. We therefore provide a set of very tenuous instructions for installing the tools used in our session using vanilla C-Python (i.e. not anaconda/conda/miniconda.)

Python

Our tools target Python 3.8+. Use your system’s package manager to install Python at least version 3.8, or use Python Foundation’s universal installers.

AIBridge Student Presentations

Last edited: August 8, 2025

Rewa Rai

Nitin Lab, Dept. of Food Sci + Tech - Davis

Wine

Classification Task

Whole data:

  • Decision Tree: 98.46%
  • Random Forest: 99.84%
  • Gaussian NB: 97.08%

Regression Task

Feature selection with 2 best features actually improved.

Talkthrough

Detecting berry infection by leaf classification. Use FTIR spectroscopy as a means of infection classification.

Tana Hernandez

PHD Student, Nitin Lab, Dept. of Food Sci + Tech - Davis

Talkthrough

Given input for reaction, predict resulting gell strength from protein+carbo+lactic acid.

AIBridgeLab D2Aft

Last edited: August 8, 2025

Welcome to the Day-2 Afternoon Lab! We are super excited to work through tasks in linear regression and logistic regression, as well as familiarize you with the Iris dataset.

Iris Dataset

Let’s load the Iris dataset! Begin by importing the load_iris tool from sklearn. This is an easy loader scheme for the iris dataset.

from sklearn.datasets import load_iris

Then, we simply execute the following to load the data.

x,y = load_iris(return_X_y=True)

We use the return_X_y argument here so that, instead of dumping a large CSV, we get the neat-cleaned input and output values.

AIBridgeLab D3/D4

Last edited: August 8, 2025

Woah! We talked about a lot of different ways of doing classification today! Let’s see what we can do about this for the Iris dataset!

Iris Dataset

Let’s load the Iris dataset! Begin by importing the load_iris tool from sklearn. This is an easy loader scheme for the iris dataset.

from sklearn.datasets import load_iris

Then, we simply execute the following to load the data.

x,y = load_iris(return_X_y=True)

We use the return_X_y argument here so that, instead of dumping a large CSV, we get the neat-cleaned input and output values.