Python Machine Learning with Iris Dataset

Standard

I recently started to work with Python Scikit-Learn.
My first program was a classification of Iris flowers – as this is usually the first start for everyone 😉

I think it’s quite a good idea to start by just using the code and libraries as your tool. Do not try to understand how Machine Learning works internally. That might be frustrating in the beginning. Especially when it comes to statistics and probabilities and so on and so forth…
You should rather concentrate on the goals you want to achieve – i.e. predict the class of unknown iris flowers.
When your progamm is working and you have a lot of time left, then you could start to think about the algorithm internals.
For getting an idea how the algorithms work and when to use which one take a look at the UserGuide from SciKit-Learn.

Below you can find my code and the dataset I’m using. I got the dataset from the UCI Machine Learning Repository (Iris dataset).

The file “iris.data” with the data: iris

One thought on “Python Machine Learning with Iris Dataset

  1. Mads

    Hey, cool program!
    Unfortunately i get this error:

    DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().
    y_ = column_or_1d(y, warn=True)

    Any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">