alibaba / pipcook

Machine learning platform for Web developers

Home Page:https://alibaba.github.io/pipcook/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import sklearn but sklearn.ensemble is undefined

uns3t opened this issue · comments

commented

for example:

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

output:
undefined
undefined

commented

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

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