From bce0e105e20109b150a27dde2efc1426dc54ed2b Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Wed, 12 Jun 2024 07:34:33 -0400 Subject: [PATCH 1/2] docs: fix __init__.py rendering --- docs/contribute/modules/experimentalist.md | 8 +++++--- docs/contribute/modules/index.md | 3 ++- docs/contribute/modules/theorist.md | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/contribute/modules/experimentalist.md b/docs/contribute/modules/experimentalist.md index a571dfa4a..5f2547611 100644 --- a/docs/contribute/modules/experimentalist.md +++ b/docs/contribute/modules/experimentalist.md @@ -29,13 +29,15 @@ a `pandas` data frame, `numpy` array, iterator variable or other data format. We generally **recommend using pandas data frames as outputs** in which columns correspond to the independent variables of an experiment. -Once you've created your repository, you can implement your experimentalist by editing the `init.py` file in +Once you've created your repository, you can implement your experimentalist by editing the +`__init__.py` file in ``src/autora/experimentalist/name_of_your_experimentalist/``. You may also add additional files to this directory if needed. -It is important that the `init.py` file contains a function called `name_of_your_experimentalist` +It is important that the `__init__.py` file contains a function called +`name_of_your_experimentalist` which returns a set of experimental conditions (e.g., as a numpy array). -The following example ``init.py`` illustrates the implementation of a simple experimentalist +The following example ``__init__.py`` illustrates the implementation of a simple experimentalist that uniformly samples without replacement from a pool of candidate conditions. ```python diff --git a/docs/contribute/modules/index.md b/docs/contribute/modules/index.md index aa342836a..152791e43 100644 --- a/docs/contribute/modules/index.md +++ b/docs/contribute/modules/index.md @@ -24,7 +24,8 @@ After setting up your repository and linking it to your GitHub account, you can ### Implement Your Code -You may implement your code in the ``init.py`` located in the respective feature folder in ``src/autora``. +You may implement your code in the ``__init__.py`` located in the respective feature folder in +``src/autora``. Please refer to the following guides on implementing * [theorists](theorist.md) diff --git a/docs/contribute/modules/theorist.md b/docs/contribute/modules/theorist.md index 87d9ada21..926aede89 100644 --- a/docs/contribute/modules/theorist.md +++ b/docs/contribute/modules/theorist.md @@ -26,16 +26,19 @@ Make sure to select the `theorist` option when prompted. You can skip all other ## Implementation -Once you've created your repository, you can implement your theorist by editing the `init.py` file in +Once you've created your repository, you can implement your theorist by editing the `__init__.py` +file in ``src/autora/theorist/name_of_your_theorist/``. You may also add additional files to this directory if needed. -It is important that the `init.py` file contains a class called `NameOfYourTheorist` which inherits from +It is important that the `__init__.py` file contains a class called `NameOfYourTheorist` which +inherits from `sklearn.base.BaseEstimator` and implements the following methods: - `fit(self, conditions, observations)` - `predict(self, conditions)` See the [sklearn documentation](https://scikit-learn.org/stable/developers/develop.html) for more information on -how to implement the methods. The following example ``init.py`` illustrates the implementation of a simple theorist +how to implement the methods. The following example ``__init__.py`` illustrates the implementation +of a simple theorist that fits a polynomial function to the data: ```python From 2c7628804665a537a26245ffbe0a2d042c637496 Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Wed, 12 Jun 2024 07:34:41 -0400 Subject: [PATCH 2/2] docs: fix bullet point rendering --- docs/contribute/modules/theorist.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/contribute/modules/theorist.md b/docs/contribute/modules/theorist.md index 926aede89..42d478d14 100644 --- a/docs/contribute/modules/theorist.md +++ b/docs/contribute/modules/theorist.md @@ -2,7 +2,8 @@ AutoRA theorists are meant to return scientific models describing the relationship between experimental conditions and observations. Such models may take the form of a simple linear regression, non-linear equations, causal graphs, -a more complex neural network, or other models which +a more complex neural network, or other models which + - can be identified based on data (and prior knowledge) - can be used to make novel predictions about observations given experimental conditions.