This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const csv = require('csv/lib/sync'); | |
const fs = require('fs'); | |
// Naive single decision tree implementation in javascript | |
// Train.csv can be acquired in kaggle's blue book for bulldozers competition | |
class DecisionTree { | |
constructor(csvData, independentVariables, dependentVariable, options) { | |
this.options = options; | |
this.depth = 0; | |
this.columns = csvData.shift(); |