alibaba / pipcook

Machine learning platform for Web developers
https://alibaba.github.io/pipcook/
Apache License 2.0
2.55k stars 209 forks source link

import sklearn but sklearn.ensemble is undefined #785

Closed uns3t closed 3 years ago

uns3t commented 3 years ago

for example:

const sklearn = boa.import('sklearn');
const { RandomForestClassifier } = sklearn.ensemble
console.log(sklearn.ensemble)
console.log(RandomForestClassifier)

output: undefined undefined

uns3t commented 3 years ago

我的问题... const ensemble = boa.import('sklearn.ensemble'); 这样就行了

yorkie commented 3 years ago

是的,这是因为 Python 和 JavaScript 模块系统的差异,Python 有子模块的概念,而 JS 中都是按照文件来区分的。