Avançar para o conteúdo principal

Mensagens

A mostrar mensagens de janeiro, 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. X=[[181,80,44],[177,70,43],[160,60,38],[154,54,37],[166,65,40],[190,90,47],[175,64,39],[177,70,40],[159,55,37],[171,75,42],[181,85,43]] To these values ​​we have to join the classification of each element, so we created the vector Y. Y=['male','female','female','female','male','male','male','female','male','female','male'] Now we can create an object of type DecisionTreeClassifier. clf=tree.DecisionTreeClassifier() We enter values ​​and ratings. clf=clf.fit(X,Y) Finally we can make a prediction based on a new example. prediction=clf.predict([[160,50,33]]) print(prediction) Just change the values ​​to get a diffe

Installing TensorFlow in Windows 10 with Anaconda

This video shows how to install TensorFlow in Windows 10 with Anaconda without the need to use the terminal window. Start by opening the Anaconda Navigator tool and create an Environment. Now, with the environment selected, search for the TensorFlow package e click install. Next install the Anaconda code editor, Spyder. When all is finished, update the TensorFlow version with this command:      conda install -c conda-forge tensorflow Don't forget that you must start Spyder through the terminal window of this environment, other wise it won't be running in the new environment and, for that, you must start the terminal window and type spyder.