Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Mikunics/Pystachio

Repository files navigation

PYstachio

A project created by: Group 29 - Iron Giant as a submission requirement for CS180


This project contains:

Prerequisites


requirements.txt

Introduction


PYstachio is a machine learning classification model designed to distinguish pistachio species to aid our farmers in classifying their crops. The model uses a logistic regression based neural network to clasify two pistachio species based on their shape, color, and morphological features.

Outline


  1. Fetching the Dataset

Fetches the feature extracted data from an arff file and puts it into a Pandas dataframe.

  1. Preprocessing

Prepares the dataset for use in the neural network. First we separate the features from the class (the result), we then hot encode our targets, split the data into a test and a train set and lastly we scale the data using StandardScaler function from scikitlearn.

  1. Model

Here we describe the model we want to use, in our case a logistic regression based neural network. We define parameters here such as the amount of hidden layers and their amount of nodes, our activation function, our initial learning rate and etc.

  1. Cross-Validation

This block cross-validates our data through Stratified K-fold cross-validation with our K being 5. It prints our model's accuracy, recall, precision and f1 scores.

  1. Test

This block uses the test data in order to get our model's predictions on new data it has not seen yet. It also prints recall, precision and f1 scores.

  1. Classification Report

Better formatted and more detailed version of test results.

  1. Confusion Matrix

A confusion matrix of the model's predicted class and their actual class.

Results


Classification Report:

report

Confusion Matrix:

matrix

References


  1. OZKAN IA., KOKLU M. and SARACOGLU R. (2021). Classification of Pistachio Species Using Improved K-NN Classifier. Progress in Nutrition, Vol. 23, N. 2, pp. DOI:10.23751/pn.v23i2.9686. (Open Access) https://www.mattioli1885journals.com/index.php/progressinnutrition/article/view/9686/9178

  2. SINGH D, TASPINAR YS, KURSUN R, CINAR I, KOKLU M, OZKAN IA, LEE H-N., (2022). Classification and Analysis of Pistachio Species with Pre-Trained Deep Learning Models, Electronics, 11 (7), 981. https://doi.org/10.3390/electronics11070981. (Open Access)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published