Skip to content

Instantly share code, notes, and snippets.

View lynxnathan's full-sized avatar

Nathan Ribeiro lynxnathan

  • São Paulo - Brazil
View GitHub Profile
lynxnathan / randomforest.js
Last active June 7, 2020 02:41
Naive single decision tree implementation - wrote this on the context of ml1 course
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();