小编Car*_*rro的帖子

pip 安装速度极慢

任何与 pypi 联系的 pip 命令在 Ubuntu 18.04 上运行速度都非常慢。

$ pip install -v pandas                        
Created temporary directory: /tmp/pip-ephem-wheel-cache-hvbcg1k_
Created temporary directory: /tmp/pip-install-7_spppvw
Collecting pandas
  1 location(s) to search for versions of pandas:
  * https://pypi.org/simple/pandas/
  Getting page https://pypi.org/simple/pandas/
  Looking up "https://pypi.org/simple/pandas/" in the cache
  Current age based on date: 324440
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  Starting new HTTPS connection (1): pypi.org
Run Code Online (Sandbox Code Playgroud)

挂起约 1-2 分钟(至少)。

使用该选项可以--index-url=http://pypi.python.org/simple/大大加快速度,但似乎并不理想,因为它跳过了加密。有什么解决方法吗?

pip ipv6 python-3.x

7
推荐指数
2
解决办法
4330
查看次数

XGBoost图重要性没有属性max_num_features

xgboost的绘图API说明:

xgboost.plot_importance(booster, ax=None, height=0.2, xlim=None, ylim=None, title='Feature importance', xlabel='F score', ylabel='Features', importance_type='weight', max_num_features=None, grid=True, **kwargs)¶
Run Code Online (Sandbox Code Playgroud)

绘制基于拟合树木的重要性.

参数:

booster (Booster, XGBModel or dict) – Booster or XGBModel instance, or dict taken by Booster.get_fscore()
...
max_num_features (int, default None) – Maximum number of top features displayed on plot. If None, all features will be displayed.
Run Code Online (Sandbox Code Playgroud)

但是,在我的实现中,运行:

booster_ = XGBClassifier(learning_rate=0.1, max_depth=3, n_estimators=100, 
                      silent=False, objective='binary:logistic', nthread=-1, 
                      gamma=0, min_child_weight=1, max_delta_step=0, subsample=1, 
                      colsample_bytree=1, colsample_bylevel=1, reg_alpha=0,
                      reg_lambda=1, scale_pos_weight=1, base_score=0.5, seed=0)

booster_.fit(X_train, y_train)

from xgboost import …
Run Code Online (Sandbox Code Playgroud)

python feature-selection xgboost

6
推荐指数
1
解决办法
5692
查看次数

标签 统计

feature-selection ×1

ipv6 ×1

pip ×1

python ×1

python-3.x ×1

xgboost ×1