You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function dressData(csvData) {
let X = [],
Y = []
csvData.forEach(row => {
let k = []
k.push(f(row['TV']))
k.push(f(row['radio']))
k.push(f(row['newspaper']))
X.push(k)
Y.push(f(row['sales']))
})
return [X, Y]
}
When I train the model, everything seems OK:
const ml = require('shaman')
function performRegression(X, Y) {
const lr = new ml.LinearRegression(X, Y, {
debug: true,
algorithm: 'NormalEquation'
})
lr.train(err => {
if (err) console.log(err)
else predictOutput(lr)
})
}
The prediction works when I use Linear Regression, but with Multiple Linear Regression it fails with the error in the title: Cannot read property 'e' of null.
Stack trace: at LinearRegression.predict (C:\Users\facun\xxxxx\node_modules\shaman\lib\linear_regression.js:263:17)
The text was updated successfully, but these errors were encountered:
First of all, thank you for this awesome lib!
Dataset (without null values)
Then gathering X and Y to analyze later:
When I train the model, everything seems OK:
The prediction works when I use Linear Regression, but with Multiple Linear Regression it fails with the error in the title:
Cannot read property 'e' of null
.Stack trace:
at LinearRegression.predict (C:\Users\facun\xxxxx\node_modules\shaman\lib\linear_regression.js:263:17)
The text was updated successfully, but these errors were encountered: