Business, Economics, Accounting and Finance
🐋
How to Install auto-sklearn on macOS 10.14~10.15
Works for me. Twice.

via Docker

Easiest way of using auto-sklearn on macOS is via Docker. Make sure your Docker is running, and execute:
1
docker run -it -v $PWD:/opt/nb -p 8888:8888 felixleung/auto-sklearn /bin/bash -c "pip install --upgrade pip auto-sklearn tables tqdm && cd /opt/nb && ipython"
Copied!
Here, pip install --upgrade pip ... upgrades the auto-sklearn module (along with its dependencies) and installs a couple of others that I found useful. This command gives you an iPython REPL with current working directory as, well, current working directory.
This is, however, not the most ideal solution if you already have a Python envrionment / pipeline / JupyterLab setup that you would like to stick with. In that case, you will need to build from scratch.

Build from Scratch

Make sure you have Homebrew installed.
1
xcode-select --install # install command line tools
2
export MACOSX_DEPLOYMENT_TARGET=10.14
3
brew install swig
4
brew install [email protected]
5
export CC=gcc-8
6
# Build XGBoost (from <https://xgboost.readthedocs.io/en/latest/build.html#building-on-osx>):
7
git clone --recursive https://github.com/dmlc/xgboost
8
cd xgboost # The original tutorial didn't have this
9
mkdir build
10
cd build
11
CXX=g++-8 cmake .. # I changed 8 to 9 and it also worked
12
make -j4
13
# Move the compiled binary library to the directory where python-xgboost will look for it -- there's probably better ways to achieve this:
14
mkdir ~/miniconda3/xgboost # Notice that I use `miniconda3` for managing packages.
15
cp ../lib/libxgboost.dylib ~/miniconda3/xgboost
16
# Clean up XGBoost installation:
17
cd ../../
18
rm -rf xgboost
19
# Install other auto-sklearn dependencies:
20
curl https://raw.githubusercontent.com/automl/auto-sklearn/master/requirements.txt | xargs -n 1 -L 1 pip install
21
# Install auto-sklearn:
22
pip install auto-sklearn --user
Copied!
Not sure why, but pandas and/or numpy may fail to load after installing auto-sklearn. This can be fixed by upgrading these two modules:
1
pip install --upgrade pandas numpy
Copied!
Last modified 2yr ago