Public
Edited
Mar 14, 2024
2 forks
1 star
Insert cell
Insert cell
rf = import('https://cdn.skypack.dev/ml-random-forest@2.1.0?min')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
regression = new rf.RandomForestRegression(options)
Insert cell
a = await regression.train(trainingSet, predictions);
Insert cell
result = a, regression.predict(trainingSet);
Insert cell
result2 = a, regression.predict([[2,2200,7200,2,100,140,110]]);
Insert cell
a, regression.featureImportance()
Insert cell
a, regression.toJSON()
Insert cell
SP - Materials for Machine Learning - Sheet3 (2).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
spMaterialsForMachineLearningSheet3

Insert cell
fullDataSet = {
return spMaterialsForMachineLearningSheet3
}
Insert cell
formattedData = {

var fullSet = []

for (let i = 0; i < fullDataSet.length; i++) {

var currentLine = [Number(fullDataSet[i].col1),Number(fullDataSet[i].col2),Number(fullDataSet[i].col3),Number(fullDataSet[i].col4),Number(fullDataSet[i].col5),Number(fullDataSet[i].col6),Number(fullDataSet[i].col7),Number(fullDataSet[i].result)]

fullSet.push(currentLine)
}

return fullSet
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more