Skip to content

Commit c37422b

Browse files
dengdifanbenjamc
andauthored
Docs update for RF replacement (#1265)
* WIP * fit api and parallel predcting * remnove thread lock * implement for predict_marginalized_over_instances_batch * add facades for pyrfr * add pyrfr mf facade * maint class names * move rfr to optional requirements * mainti README * add tests for rf with log y * rf trained with n_jobs=-1 instead of None * make rf compatible with older version sklearn * maint mypy * update change log * add docstrings * fix black * maint * drop support for python 3.8 * maint * black fix * simplify pyrfr facade design * raise errors if pyrfr is not properly installed * maint rf * fix pre-commit * update rfr information for README and docs --------- Co-authored-by: benjamc <[email protected]>
1 parent 7173fa3 commit c37422b

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ We hope you enjoy this new user experience as much as we do. 🚀
3838

3939
This instruction is for the installation on a Linux system, for Windows and Mac and further information see the [documentation](https://automl.github.io/SMAC3/latest/1_installation/).
4040

41-
Create a new environment with python 3.10 and make sure swig is installed either on your system or
42-
inside the environment. We demonstrate the installation via anaconda in the following:
41+
Create a new environment with python 3.10. We demonstrate the installation via anaconda in the following:
4342

4443
Create and activate environment:
4544
```
@@ -62,7 +61,7 @@ make install-dev
6261
starting from 2.4.0, SMAC uses random forest from [sklearn](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html)
6362
instead of random forest from [pyrfr](https://pypi.org/project/pyrfr/) as the default surrogate model for HPO tasks.
6463
However, you could still use the old pyrfr surrogate model by calling `smac.facade.old.HyperparameterOptimizationRFRFacade`
65-
and `smac.facade.old.MultiFidelityRFRFacade`
64+
and `smac.facade.old.MultiFidelityRFRFacade`.
6665

6766
To work with pyrfr, you need to first install gcc, gxx, and swig:
6867
```

docs/1_installation.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Installation
22
## Requirements
33

4-
SMAC is written in python3 and therefore requires an environment with python>=3.8.
5-
Furthermore, the Random Forest used in SMAC requires SWIG as a build dependency.
4+
SMAC is written in python3 and therefore requires an environment with python>=3.9.
65

76
!!! info
87

9-
SMAC is tested on Linux and Mac machines with python >=3.8.
8+
SMAC is tested on Linux and Mac machines with python >=3.9.
109

1110

1211
## SetUp
@@ -18,17 +17,6 @@ conda create -n SMAC python=3.10
1817
conda activate SMAC
1918
```
2019

21-
Now install swig either on the system level e.g. using the following command for Linux:
22-
```bash
23-
apt-get install swig
24-
```
25-
26-
Or install swig inside of an already created conda environment using:
27-
28-
```bash
29-
conda install gxx_linux-64 gcc_linux-64 swig
30-
```
31-
3220
## Install SMAC
3321
You can install SMAC either using PyPI or Conda-forge.
3422

@@ -63,7 +51,31 @@ conda install smac
6351

6452
Read [SMAC feedstock](https://github.com/conda-forge/smac-feedstock) for more details.
6553

66-
## Windows (native or via WSL, experimental)
54+
## Running SMAC with pyrfr
55+
starting from 2.4.0, SMAC uses random forest from [sklearn](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html)
56+
instead of random forest from [pyrfr](https://pypi.org/project/pyrfr/) as the default surrogate model for HPO tasks.
57+
However, you could still use the old pyrfr surrogate model by calling `smac.facade.old.HyperparameterOptimizationRFRFacade`
58+
and `smac.facade.old.MultiFidelityRFRFacade`.
59+
60+
The Random Forest used in SMAC requires SWIG as a build dependency.
61+
You could install swig either on the system level e.g. using the following command for Linux:
62+
```bash
63+
apt-get install swig
64+
```
65+
66+
Or install swig inside of an already created conda environment using:
67+
68+
```bash
69+
conda install gxx_linux-64 gcc_linux-64 swig
70+
```
71+
72+
And then install smac with the pyrfr option:
73+
```
74+
pip install smac[pyrfr]
75+
```
76+
77+
78+
### pyrfr on Windows (native or via WSL, experimental)
6779

6880
SMAC can be installed under Windows in a WSL (Windows Subsystem for Linux).
6981
You can find an instruction on how to do this here: [Experimental](./10_experimental.md).

0 commit comments

Comments
 (0)