3
我基于this articleIPython的导入错误:无法导入名称布局
试图CatBoost在它的代码,CatBoost在model.fit()
plot
,所以我想尝试一下我的IPython。
这里是我的CatBoost代码:
from catboost import CatBoostRegressor
# indicate categorical features for CatBoost
categorical_features_indices = np.where(X.dtypes != np.float)[0]
model=CatBoostRegressor(iterations=50, depth=3, learning_rate=0.1,
loss_function='RMSE')
model.fit(X_train, y_train,
cat_features=categorical_features_indices,
use_best_model=True,
eval_set=(X_validation, y_validation), plot=True)
但是,它不能表现出任何情节,不停地给我的错误:
我没有安装ipywidgets和IPython中。 你知道如何处理这个问题吗?
你是否将ipython作为笔记本或外壳运行?你在虚拟环境中运行它吗? –
我将它作为笔记本运行。我尝试了虚拟环境和非虚拟环境,都得到了这个错误 –