Code Monkey home page Code Monkey logo

iris-classifiaction's Introduction

Iris Classification

Dataset

Dataset contains three classes (Iris-setosa, Iris-versicolor, Iris-virginica). These are classified based on sepal and petal features such as length and width.

Screenshot (258)

We convert Species to int values for classification

Screenshot (258)

Tools Used

  • Pandas
  • Numpy
  • Matplotlib
  • Seaborn
  • Sikit Learn

Algorithm

KNeighborsClassifier

We use Euclidean distance to calculate nearest neighbour and based on smallest distance we can classify their class.

DecisionTreeClassifier

  • We start at the tree root and split the data on the feature that results in the largest information gain (IG).

  • We can then repeat this splitting procedure at each child node until the leaves are pure. This means that the samples at each leaf node all belong to the same class.

  • We may set a limit on the depth of the tree to prevent overfitting. We compromise on purity here somewhat as the final leaves may still have some impurity.

Result

KNeighborsClassifier

Using n_neighbour= 11 in our model we get an accuracy of 1.0 and f1 score of 0.93.

Screenshot (258)

Confusion Matrix

Screenshot (258)

DecisionTreeClassifier

Using default values for our model we get accuracy of 0.96 and f1 score of 0.97.

Confusion Matrix

Screenshot (258)

iris-classifiaction's People

Contributors

abbasvora avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.