/Machine_Learning

Data Analysis and ML in Python.

Primary LanguageJupyter Notebook

machine_learning

Assignment 31


Assignment 32

3d Scatter

  • A set of random numbers with three properties of length, width and weight for balloons and melons.
  • Display the generated data in three dimensions.

3dscatter

Fruit Visualization

  • python visualization (case) fruit classification (banana and Apple war).

1 2 3 4 5 6 7 8


Assignment 33

Know Your Metrics

1 2 3


Assignment 34

Covid

  • The eight countries with the highest number of covid cases in the fourth month of 2020.

countries

  • Draw a graph that shows the mortality rate in relation to the number of cases in Iran on different days.

new cases vs new deaths in iran

KNN

  • Write KNN(K Nearest Neighbors) algorithm from scratch then compare with sklearn KNeighborsClassifier.
  • Working on weight-height Dataset on kaggle.

KNN OCR

  • use kNN to build a basic OCR (Optical Character Recognition) application.
  • In this case we work on mnist(Modified National Institute of Standards and Technology dataset) numbers.
  • result -> accuracy: 91.76

Assignment 35

Nemo

  • Train kNN algorithm with Clownfish1 image and test it on another Clownfish image.
  • written in Python using opencv, matplotlib.

Iris EDA2

  • Doing kNN algorithm on sckit-learn Iris dataset with different k and plot the accuracy.

accuracy-bar

Abalone EDA2

  • Doing kNN algorithm on Abalone Dataset and obtain the accuracy of the algorithm.
  • NOTE: In this exercise, I solved the problem in the form of classification.
  • NOTE: This problem is solved in form of regression in Assignment 37

Assignment 36

Iris

  • Drawing confusion matrix for the iris problem from last assignment.

iris-confmat iris-confmat-prettyconfmat

LLS (Linear Least-Squares)

  • Creating continuous random data for students' study hours and their grades.

data

  • Obtaining line slope by LLS methods. (formula and scipy library)

fittedline scipy-fittedline

  • Draw both of them in one figure.

both-fittedlines

LLS - 2 independent

  • Implementing the LLS method on the Boston dataset from the Scikit-learn library.
  • This database offers thirteen features per house, I chose 'CRIM' and 'TAX'.
  • Lets scatter the data.

data

  • Apply the LLS method on data and get the predicted-surface and plot it.

plot-surface

  • Lets plot data and predicted-surface in one figure.

both-dataSurface

  • Lets generate the three different figures from different views to see better.

3-views


Assignment 37

DigiKala

  • EDA2 on DigiKala's order dataset.
  • Number of orders per month:

orderspermonth

  • Separate customers by city:

separate-customers-by-city

Abalone Regression

  • Doing LLS algorithm on Abalone Dataset and calculate MAE, MSE, Huber, and Hinge Errors.

QR Code reader

  • QR Code reader written in python using opencv detectAndDecode method that can decode QR Codes and Barcodes.

QR-code detector


Assignment 38

Perceptrone

scatter-lossPlot


Assignment 39

Weather Forecast: (Linear Regression)

  • The climate of a particular city is recorded every hour during different years. So, weather information is recorded 24 times per day.
  • Draw an output table on a chart.
  • Teach a linear model3 on the above data using the perceptron algorithm

LinearReg

  • Plot Loss and R2-score diagrams.

loss r2


Assignment 40

Titanic4

Algorithm KNN Perceptron MLP (Multi Layer Perceptron)
Accuracy 72.66% 43.16% 92.57%

Assignment 41

MLP-Weather

epoch 5 10 100 800
Loss 1.10 0.69 0.17 0.13

Footnotes

  1. Clownfish in wikipedia

  2. EDA stands for Exploratory Data Analysis 2 3

  3. I am aware of linear model can not fit the data perfectly. This assignment solved with mlp in Assignment 41.

  4. Titanic Dataset