/machine-learning-1

Fisher’s Linear Discriminant classification algorithm that can recognize images of three classes (airplane, automobile and frog). These classes are part of the machine learning benchmark CIFAR-10 dataset. The data is available on the GitHub assignment (https://classroom.github.com/a/viOLYlS). In the Data folder, you will find two folders: “train” and “test”. The “train” folder contains 3 subfolders named “airplane”, “automobile” and “frog”, with each one containing 5000 different images of the respective classes. The “test” folder also contains the same 3 subfolders with 1000 different images of each class. The images in the “train” folder should be used to train a classifier for each class using the method given at the bottom of slide 18 in Lecture 3.pdf. After the classifiers are trained, test each classifier using the images given in the “test” folder. Use the following equation for Fisher’s Linear Discriminant w = S𝑊 −1 (m2 − m1 ). The bias term should be computed as explained in the lecture and Problem Set 3 using the equation w0 = -w T (m1 + m2)/2. You will examine Fisher’s Linear Discriminant twice. Once dealing with the provided RGB images, and once after converting them to gray-scale.

Primary LanguageJupyter NotebookBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Open in Visual Studio Code

csen1022-assignment

Template for the jupyter notebook to use in order to submit CSEN1022 assignments

Folder Structure

Data
├── test
│   └── airplane (1000 images)
│   └── automobile (1000 images)
│   └── frog (1000 images)
└── train
    └── airplane (5000 images)
    └── automobile (5000 images)
    └── frog (5000 images)
Assignment.ipynb ── This is the only file that you need to work on and submit

Prerequisites

This repository requires that you have:-

Installation of Prerequisites

Easy way (More HD space, less hassle)

Install Anaconda then just run Jupyter.

Hard way (Less HD space, more hassle)

Install Python3+

Make sure Python and pip are added to environment variables Python

From your Linux, Mac, or Windows terminal, verify that both are installed correctly.

$ python --version
$ pip --version

Using the same terminal install numpy, matplotlib, pillow and notebook

$ pip install numpy matplotlib pillow notebook

Alternative way (Cloud but you have to upload the data)

Create a New Notebook from here Google Colab

Upload the Data.zip folder

from google.colab import files
uploaded = files.upload()

Extract the zipped folder into the cloud

!unzip [foldername].zip

How To Run

From your terminal, run this command then navigate to the Assignment.ipynb file

jupyter notebook

License

BSD 3-Clause "New" or "Revised" License