sexta-feira, 26 de janeiro de 2018

Decision Trees

In this article we create a decision tree to classify the gender of people based on their height, weight and size of footwear.

To begin we import from the tree from framework sklearn.

from sklearn import tree

Then we create a vector X with the values ​​that allow us to create a trend.


To these values ​​we have to join the classification of each element, so we created the vector Y.


Now we can create an object of type DecisionTreeClassifier.


We enter values ​​and ratings.,Y)

Finally we can make a prediction based on a new example.


Just change the values ​​to get a different rating.

Code on Github

Video on YouTube

Sem comentários:

Enviar um comentário