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
I'm getting an error, but I'm definitely transmitting everything normally
Node v22.2.0
Python 3.11
async function trendDirection(numbers) {
let X = numbers.map((, i) => [i])
let y = numbers
console.log(X, y)
let model = new sklearn.LinearRegression()
await model.init(py)
const model_data = await model.fit({ X, y })
let trend = model_data.coef[0] > 0 ? 1 : model_data.coef_[0] < 0 ? -1 : 0
return trend
}
// LOG
[ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] [ 69361.6, 69363.9, 69362.7, 69362.8, 69362.7 ]
/node_modules/@fisch0920/python-bridge/node_python_bridge.py", line 81, in default\n' +
' return o.dict\n' +
' ^^^^^^^^^^\n',
"AttributeError: 'numpy.ndarray' object has no attribute 'dict'\n"
The text was updated successfully, but these errors were encountered:
I'm getting an error, but I'm definitely transmitting everything normally
Node v22.2.0
Python 3.11
async function trendDirection(numbers) {
let X = numbers.map((, i) => [i])
let y = numbers
console.log(X, y)
let model = new sklearn.LinearRegression()
await model.init(py)
const model_data = await model.fit({ X, y })
let trend = model_data.coef[0] > 0 ? 1 : model_data.coef_[0] < 0 ? -1 : 0
return trend
}
// LOG
[ [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] [ 69361.6, 69363.9, 69362.7, 69362.8, 69362.7 ]
/node_modules/@fisch0920/python-bridge/node_python_bridge.py", line 81, in default\n' +
' return o.dict\n' +
' ^^^^^^^^^^\n',
"AttributeError: 'numpy.ndarray' object has no attribute 'dict'\n"
The text was updated successfully, but these errors were encountered: