-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
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"
Metadata
Metadata
Assignees
Labels
No labels