Press "Enter" to skip to content

Decision Tree

Decision Tree is a machine learning algorithm which you can make the classification and raegression. Implementation of this algorithm very easy. In decision tree algorithm, Decision were made by looking at the value which given at the start. The given root separated to the two branches and process goes with these branches.

I want to make prediction using by the decision tree algorithm. I have a dataset which contains experience and salary of the employees. Using by this dataset, I want to determine the salary of the employees who has fraactional experience.

You can see the libraries which i can use in the prediction in the above. By using Pandas, I added the my csv file. This data has two columns and i would like to initilaze x and y value for that I define these variables using the iloc.

By using the Sklearn library, I added the Decision Tree Regressor to the my project and then i fitted the my data using by this regression model. To predict year values, i should make the interval between the 1 and 10 years and then i added a variable and then i increase the this variable by 0.01 between the 1 and 10 to predict salary. Lastly i made the graphical output of this prediction.

We should get the graphic like above. You can ask your questions via e-mail or comments.

Be First to Comment

Leave a Reply

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