{"_id":"@__username/decision-tree","_rev":"1-f5316a5e05c6a3825a781d91412453ba","name":"@__username/decision-tree","dist-tags":{"latest":"0.4.0"},"versions":{"0.4.0":{"name":"@__username/decision-tree","scripts":{"test":"NODE_PATH=. ./node_modules/.bin/mocha -R spec tst/*"},"version":"0.4.0","directories":{"example":"examples","lib":"lib"},"dependencies":{"lodash":"^4.17.15","npm":"^6.12.0"},"deprecated":false,"description":"NodeJS implementation of decision tree using ID3 algorithm","devDependencies":{"mocha":"^6.2.0"},"engines":{"node":"*"},"homepage":"https://github.com/serendipious/nodejs-decision-tree-id3#readme","keywords":["decision","tree","classifier","classification","machine","learning","decision tree","machine learning","ID3"],"main":"./lib/decision-tree","author":{"name":"Ankit Kuwadekar"},"_id":"@__username/decision-tree@0.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"__username","email":"ila28655@gmail.com"},"dist":{"integrity":"sha512-Rl/KP0COLEpIsl8Hp2uvT+vuxOrbQ4KCNBhVNopNzZ+pryZ/Wh30TZEBylIj9GpfC3s/I85JkJ719h193nnnvg==","shasum":"1ff9283f70c5639cb480cf4aeafdd7dd6464c947","tarball":"https://registry.npmjs.org/@__username/decision-tree/-/decision-tree-0.4.0.tgz","fileCount":13,"unpackedSize":6336239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqKuuCRA9TVsSAnZWagAApOkP/2twPeRT8wobCv+NZoiv\nZqEUPxDy5SGtZ0fy0c4ZZc/F/fFIyGkNSJ9gdgjxF4D+sKq9+bRj2O0BuUOT\nVCJn127KzsXGqeV2g4iwA95zLo2c71X8uHI0bGhxHWR6qT4MCltyCOONdrXJ\nYRSrqLAUA/YGS55ZoaHEbcMnRFQy4zfIFIyIp4H1J9Zx9RNtTzWNXCTJCYQY\nRcNFbNwfj7CiqAgtoFxDdbtBpnHCtMrM8q1vrd8kgZuRvnJv9cVPXgb2lEKU\ngktKQm+W5Cg8BfULU34UXCKzoaXXztx7CZyvkdvrBLIsEh9qy4HzVVOTkO4K\nJVorc1T4cgm9PS03uqxeX/RZVLWEAaICDUvyeSCvMc7IfcBdVxrautTU42nT\niZnbEevv5RdwkwX0mf3hM89SnXL7tBhFGkKM9hnlZp8we1mCR9vb2Xwg8dpb\nhJPswmhf1ScNpNthAKgdmgbd5iQ8t0j1P/dsuB0hBTGbMZg/5yKuV9TNwsxc\n2bIpxMeKcFfIKFP5T8kZYvtkNIkEKAtUGNz0237pA1qjxeOtASUsONf1KJCH\npkrm3mXf/Prv30K1DeV40LvlfhVn6YHHS4Xj5qO+SCxFvUs2ifLhEDbFLWGE\nQkMfeB0I90pelX6eebX0ZSTxKjxxcWmTn8Brcjca9Tz40DUcDSQ501xSOIUo\nmu6T\r\n=IN28\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9TErKPKyBEmIMeOaSpYuLig0Wnu4dzOR8Zx2l3XXWhAIhAM83BEoAsbL0omMw5fYPZpCqiw2y00mC++pdS7jj91+C"}]},"maintainers":[{"name":"__username","email":"ila28655@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/decision-tree_0.4.0_1571335085647_0.4573612738941488"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-17T17:58:05.423Z","0.4.0":"2019-10-17T17:58:05.849Z","modified":"2022-04-04T10:51:25.210Z"},"maintainers":[{"name":"__username","email":"ila28655@gmail.com"}],"description":"NodeJS implementation of decision tree using ID3 algorithm","homepage":"https://github.com/serendipious/nodejs-decision-tree-id3#readme","keywords":["decision","tree","classifier","classification","machine","learning","decision tree","machine learning","ID3"],"author":{"name":"Ankit Kuwadekar"},"readme":"Decision Tree for NodeJS\n========================\n\nThis module contains the NodeJS Implementation of Decision Tree using [ID3 Algorithm](http://en.wikipedia.org/wiki/ID3_algorithm)\n\n# Table Of Contents\n* [`Installation`](#installation)\n* [`Usage`](#usage)\n\t* [`Import Module`](#installation)\n\t* [`Prepare`](#installation)\n\t* [`Installation`](#installation)\n\n# [Installation](id:installation)\n\tnpm install decision-tree\n\n# [Usage](id:usage)\n\n* Import the module:\n\n\t\tvar DecisionTree = require('decision-tree');\n\t\n* Prepare training dataset:\n\n\t\tvar training_data = [\n\t\t\t{\"color\":\"blue\", \"shape\":\"square\", \"liked\":false},\n\t\t\t{\"color\":\"red\", \"shape\":\"square\", \"liked\":false},\n\t\t\t{\"color\":\"blue\", \"shape\":\"circle\", \"liked\":true},\n\t\t\t{\"color\":\"red\", \"shape\":\"circle\", \"liked\":true},\n\t\t\t{\"color\":\"blue\", \"shape\":\"hexagon\", \"liked\":false},\n\t\t\t{\"color\":\"red\", \"shape\":\"hexagon\", \"liked\":false},\n\t\t\t{\"color\":\"yellow\", \"shape\":\"hexagon\", \"liked\":true},\n\t\t\t{\"color\":\"yellow\", \"shape\":\"circle\", \"liked\":true}\n\t\t];\n\t\n* Prepare test dataset:\n\n\t\tvar test_data = [\n\t\t\t{\"color\":\"blue\", \"shape\":\"hexagon\", \"liked\":false},\n\t\t\t{\"color\":\"red\", \"shape\":\"hexagon\", \"liked\":false},\n\t\t\t{\"color\":\"yellow\", \"shape\":\"hexagon\", \"liked\":true},\n\t\t\t{\"color\":\"yellow\", \"shape\":\"circle\", \"liked\":true}\n\t\t];\n\t\n* Setup Target Class used for prediction:\n\t\n\t\tvar class_name = \"liked\";\n\n* Setup Features to be used by decision tree:\n\n\t\tvar features = [\"color\", \"shape\"];\n\t\n* Create decision tree and train model:\n\t\n\t\tvar dt = new DecisionTree(training_data, class_name, features);\n\t\n* Predict class label for an instance:\n\n\t\tvar predicted_class = dt.predict({\n\t\t\tcolor: \"blue\",\n\t\t\tshape: \"hexagon\"\n\t\t});\n\t\n* Evaluate model on a dataset:\n\t\n\t\tvar accuracy = dt.evaluate(test_data);\n\n* Export underlying model for visualization or inspection:\n\n\t\tvar treeModel = dt.toJSON();","readmeFilename":"README.md"}