auto-sklearn安装配置

官方安装指南:

http://automl.github.io/auto-sklearn/stable/installation.html#installation

系统需求:

auto-sklearn has the following system requirements:

  • Linux operating system (for example Ubuntu),
  • Python (>=3.5).
  • C++ compiler (with C++11 supports) and SWIG (version 3.0 or later)

1)查看python版本:

python3 -V

2) 查看gcc版本(建议4.8以上版本):

gcc -v

3) 查看swig版本:

swig -copyright

安装swig可以参考:

swig:
http://www.swig.org/download.html

installation guide:
http://www.linuxfromscratch.org/blfs/view/cvs/general/swig.html

 

安装执行:

1) curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip3 install

如果需要使用代理,可以执行:

curl -x IP:port https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip3 --proxy IP:port install

2)  pip3 install auto-sklearn

3)入门例子:

https://automl.github.io/auto-sklearn/stable/index.html#

Example

>>> import autosklearn.classification
>>> import sklearn.model_selection
>>> import sklearn.datasets
>>> import sklearn.metrics
>>> X, y = sklearn.datasets.load_digits(return_X_y=True)
>>> X_train, X_test, y_train, y_test = \
        sklearn.model_selection.train_test_split(X, y, random_state=1)
>>> automl = autosklearn.classification.AutoSklearnClassifier()
>>> automl.fit(X_train, y_train)
>>> y_hat = automl.predict(X_test)
>>> print("Accuracy score", sklearn.metrics.accuracy_score(y_test, y_hat))

遇到的问题:

1)xgboost

cc1plus: error: unrecognized command line option "-std=c++11"

......

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-5dx269ux/xgboost/

明显是因为编译器不支持C++11,查看当前的gcc版本:

[lss@localhost etc]$ gcc -v
Target: x86_64-redhat-linux
......
gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)

解决方法:

升级gcc到4.8.5, 参照https://blog.csdn.net/cffishappy/article/details/80182935

需要注意的是,安装完gcc4.8.5以后需要设置动态库软连接,新安装的.so为:
[root@localhost lss]# ls /usr/local/lib64/libstdc++.so.6*
/usr/local/lib64/libstdc++.so.6  /usr/local/lib64/libstdc++.so.6.0.19  /usr/local/lib64/libstdc++.so.6.0.19-gdb.py

原来老的.so为:
[root@localhost lss]# ll /usr/lib64/libstdc++.so.6
lrwxrwxrwx. 1 root root 19 Apr 25  2017 /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.13

替换:
[root@localhost lss]# rm -fr /usr/lib64/libstdc++.so.6

[root@localhost lss]# cp /usr/local/lib64/libstdc++.so.6.0.19 /usr/lib64/

[root@localhost lss]# cd /usr/lib64/
[root@localhost lib64]# ln -s libstdc++.so.6.0.19 libstdc++.so.6
[root@localhost lib64]# ll libstdc++.so.6*
lrwxrwxrwx. 1 root root      19 Oct 19 16:33 libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x. 1 root root  989840 Jul 23  2015 libstdc++.so.6.0.13
-rwxr-xr-x. 1 root root 6486707 Oct 19 16:32 libstdc++.so.6.0.19

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值