{"id":27026910,"url":"https://github.com/serengil/decision-trees-for-ml","last_synced_at":"2025-04-04T23:16:23.658Z","repository":{"id":102977083,"uuid":"148640860","full_name":"serengil/decision-trees-for-ml","owner":"serengil","description":"Building Decision Trees From Scratch In Python","archived":false,"fork":false,"pushed_at":"2019-11-03T19:26:37.000Z","size":380,"stargazers_count":61,"open_issues_count":0,"forks_count":51,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-05-02T00:53:23.901Z","etag":null,"topics":["adaboost","bagging","boosting","c45","cart","decision-tree","gbm","gradient-boosting","gradient-boosting-machine","id3","lightgbm","machine-learning","random-forest","regression-trees","xgboost"],"latest_commit_sha":null,"homepage":"https://sefiks.com/tag/decision-tree/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serengil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-13T13:21:23.000Z","updated_at":"2024-04-17T10:13:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6d6cdae-452d-42e0-a4dd-63562c691dcb","html_url":"https://github.com/serengil/decision-trees-for-ml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2Fdecision-trees-for-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2Fdecision-trees-for-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2Fdecision-trees-for-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2Fdecision-trees-for-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serengil","download_url":"https://codeload.github.com/serengil/decision-trees-for-ml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261594,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adaboost","bagging","boosting","c45","cart","decision-tree","gbm","gradient-boosting","gradient-boosting-machine","id3","lightgbm","machine-learning","random-forest","regression-trees","xgboost"],"created_at":"2025-04-04T23:16:23.191Z","updated_at":"2025-04-04T23:16:23.647Z","avatar_url":"https://github.com/serengil.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decision Trees for Machine Learning\n\n**Disclaimer:** This repository is a sketchbook learning the background of decision tree algorithms. It is neither clean nor readable. Please direct yourself to [**Chefboost**](https://github.com/serengil/chefboost) repository to have clean one. \n\nThis is the repository of **[Decision Trees for Machine Learning](https://www.udemy.com/course/decision-trees-for-machine-learning/?referralCode=FDC9B836EC6DAA1A663A)** online course published on Udemy. In this course, the following algorithms will be covered. All project is going to be developed on Python (3.6.4), and neither out-of-the-box library nor framework will be used to build decision trees.\n\n1- [ID3](https://sefiks.com/2017/11/20/a-step-by-step-id3-decision-tree-example/)\n\n2- [C4.5](https://sefiks.com/2018/05/13/a-step-by-step-c4-5-decision-tree-example/)\n\n3- [CART (Classification And Regression Trees)](https://sefiks.com/2018/08/27/a-step-by-step-cart-decision-tree-example/)\n\n4- [Regression Trees (CART for regression)](https://sefiks.com/2018/08/28/a-step-by-step-regression-decision-tree-example/)\n\n5- [Random Forest](https://sefiks.com/2017/11/19/how-random-forests-can-keep-you-from-decision-tree/)\n\n6- [Gradient Boosting Decision Trees for Regression](https://sefiks.com/2018/10/04/a-step-by-step-gradient-boosting-decision-tree-example/)\n\n7- [Gradient Boosting Decision Trees for Classification](https://sefiks.com/2018/10/29/a-step-by-step-gradient-boosting-example-for-classification/)\n\n8- [Adaboost](https://sefiks.com/2018/11/02/a-step-by-step-adaboost-example/)\n\nJust call the [decision.py](/python/decision.py) file to run the program. You might want to change the running algorithm. You just need to set algorithm variable.\n\n```\nalgorithm = \"ID3\" #Please set this variable to ID3, C4.5, CART or Regression\n```\n\nMoreover, you might want to apply random forest. Please set this to True in this case.\n\n```\nenableRandomForest = False\n```\n\nFurthermore, you can apply gradient boosting regression trees.\n\n```\nenableGradientBoosting = True\n```\n\nBesides, adaptive boosting is allowed to run\n\n```\nenableAdaboost = True\n```\n\nFinally, you can change the data set to build different decision trees. Just pass the file name, and its column names if it does not exist.\n\n```\ndf = pd.read_csv(\"car.data\"\n  #column names can either be defined in the source file or names parameter in read_csv command\n  ,names=[\"buying\",\"maint\",\"doors\",\"persons\",\"lug_boot\",\"safety\",\"Decision\"] \n)\n```\n\n# Prerequisites\n\nPandas and numpy python libraries are used to load data sets in this repository. You might run the following commands to install these packages if you are going to use them first time.\n\n```\npip install pandas\npip install numpy\n```\n\n# Updates\n\nTo keep yourself up-to-date you might check posts in my blog about [decision trees](https://sefiks.com/tag/decision-tree/) \n\n# License\n\nThis repository is licensed under the MIT License - see [LICENSE](https://github.com/serengil/decision-trees-for-ml/blob/master/LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Fdecision-trees-for-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserengil%2Fdecision-trees-for-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Fdecision-trees-for-ml/lists"}