{"id":82276,"library":"decisiontree","title":"DecisionTree","description":"ID3-based implementation of the M.L. Decision Tree algorithm.","status":"active","version":"0.5.0","language":"ruby","source_language":null,"source_url":"https://github.com/igrigorik/decisiontree","tags":["machine-learning","decision-tree","id3","classification"],"install":[{"cmd":"gem install decisiontree","lang":"bash","label":"gem install"},{"cmd":"# Gemfile\ngem 'decisiontree', '~> 0.5.0'","lang":"ruby","label":"Gemfile"}],"dependencies":[],"imports":[{"symbol":"DecisionTree","correct":"require 'decisiontree'"}],"quickstart":{"code":"require 'decisiontree'\n\n# Example: predict whether to play tennis based on weather\nattributes = ['outlook', 'temperature', 'humidity', 'wind']\ntraining = [\n  ['sunny', 'hot', 'high', 'weak', 'no'],\n  ['sunny', 'hot', 'high', 'strong', 'no'],\n  ['overcast', 'hot', 'high', 'weak', 'yes'],\n  ['rainy', 'mild', 'high', 'weak', 'yes'],\n  ['rainy', 'cool', 'normal', 'weak', 'yes'],\n  ['rainy', 'cool', 'normal', 'strong', 'no'],\n  ['overcast', 'cool', 'normal', 'strong', 'yes'],\n  ['sunny', 'mild', 'high', 'weak', 'no'],\n  ['sunny', 'cool', 'normal', 'weak', 'yes'],\n  ['rainy', 'mild', 'normal', 'weak', 'yes'],\n  ['sunny', 'mild', 'normal', 'strong', 'yes'],\n  ['overcast', 'mild', 'high', 'strong', 'yes'],\n  ['overcast', 'hot', 'normal', 'weak', 'yes'],\n  ['rainy', 'mild', 'high', 'strong', 'no']\n]\n\ndec_tree = DecisionTree::ID3Tree.new(attributes, training, 'no', :continuous)\ndec_tree.train\ntest = ['sunny', 'hot', 'high', 'weak']\nprediction = dec_tree.predict(test)\nputs prediction","lang":"ruby","description":"Train a decision tree and make a prediction"},"warnings":[],"env_vars":null,"search_vec":"'algorithm':11 'base':4 'classif':19 'decis':9,16 'decision-tre':15 'decisiontre':1 'id3':3,18 'id3-based':2 'implement':5 'learn':14 'm.l':8 'machin':13 'machine-learn':12 'tree':10,17","created_at":"2026-06-19T05:16:41.109426+00:00","updated_at":"2026-06-19T05:16:41.109426+00:00","problems":[],"ecosystem":"rubygems","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/igrigorik/decisiontree","github":"https://github.com/igrigorik/decisiontree","docs":"http://www.rubydoc.info/gems/decisiontree/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["other"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-19","next_check":"2026-12-16","install_tag":null}}