Skip to content

Commit

Permalink
Merge pull request #36 from rodrigo-arenas/0.6.Xdev
Browse files Browse the repository at this point in the history
[PRAuto summary docs
  • Loading branch information
rodrigo-arenas committed Jun 25, 2021
2 parents 540bb15 + 5522d07 commit a0f5256
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 21 deletions.
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ twine==3.3.0
numpy>=1.13.3
seaborn>=0.11.1
deap>=1.3.1
pydantic>=1.8.2
mlflow==1.17.0
black==21.5b2
sphinx
Expand Down
7 changes: 7 additions & 0 deletions docs/api/algorithms.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Algorithms
----------

.. currentmodule:: sklearn_genetic.algorithms

.. autosummary::
eaMuPlusLambda
eaMuCommaLambda
eaSimple

.. automodule:: sklearn_genetic.algorithms
:members:
21 changes: 16 additions & 5 deletions docs/api/callbacks.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
Callbacks
----------

.. currentmodule:: sklearn_genetic.callbacks

.. autosummary::
base.BaseCallback
ConsecutiveStopping
DeltaThreshold
TimerStopping
ThresholdStopping
ThresholdStopping
LogbookSaver

.. autoclass:: sklearn_genetic.callbacks.base.BaseCallback
:members:
:undoc-members: False

.. autoclass:: sklearn_genetic.callbacks.ConsecutiveStopping
.. autoclass:: ConsecutiveStopping
:members:
:undoc-members: False

.. autoclass:: sklearn_genetic.callbacks.DeltaThreshold
.. autoclass:: DeltaThreshold
:members:
:undoc-members: False

.. autoclass:: sklearn_genetic.callbacks.TimerStopping
.. autoclass:: TimerStopping
:members:
:undoc-members: False

.. autoclass:: sklearn_genetic.callbacks.ThresholdStopping
.. autoclass:: ThresholdStopping
:members:
:undoc-members: False

.. autoclass:: sklearn_genetic.callbacks.LogbookSaver
.. autoclass:: LogbookSaver
:members:
:undoc-members: False
17 changes: 17 additions & 0 deletions docs/api/gasearchcv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@
GASearchCV
----------

.. currentmodule:: sklearn_genetic

.. autosummary:: GASearchCV
GASearchCV.decision_function
GASearchCV.fit
GASearchCV.get_params
GASearchCV.inverse_transform
GASearchCV.predict
GASearchCV.predict_proba
GASearchCV.score
GASearchCV.score_samples
GASearchCV.set_params
GASearchCV.transform

.. autoclass:: sklearn_genetic.GASearchCV
:members:
:inherited-members:
:exclude-members: evaluate, mutate, n_features_in_, classes_
:undoc-members: True



4 changes: 3 additions & 1 deletion docs/api/mlflow.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MLflow
------

.. autoclass:: sklearn_genetic.MLflowConfig
.. currentmodule:: sklearn_genetic

.. autoclass:: sklearn_genetic.mlflow.MLflowConfig
:members:
:undoc-members: False
7 changes: 7 additions & 0 deletions docs/api/plots.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Plots
----------

.. currentmodule:: sklearn_genetic.plots


.. autosummary::
plot_fitness_evolution
plot_search_space

.. automodule:: sklearn_genetic.plots
:members:
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"nbsphinx",
]

autosummary_generate = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
2 changes: 0 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ It's advised to install sklearn-genetic using a virtual env, inside the env use:
.. |NumPyMinVersion| replace:: 1.14.5
.. |SeabornMinVersion| replace:: 0.9.0
.. |DEAPMinVersion| replace:: 1.3.1
.. |PydanticMinVersion| replace:: 1.8.2
.. |MLflowMinVersion| replace:: 1.17.0

sklearn-genetic-opt requires:
Expand All @@ -37,7 +36,6 @@ sklearn-genetic-opt requires:
- NumPy (>= |NumPyMinVersion|)
- Seaborn (>= |SeabornMinVersion|)
- DEAP (>= |DEAPMinVersion|)
- Pydantic (>= |PydanticMinVersion|)
- MLflow (>= |MLflowMinVersion|)

.. toctree::
Expand Down
7 changes: 2 additions & 5 deletions sklearn_genetic/algorithms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from typing import Union
from collections.abc import Callable

from deap import tools
from deap.algorithms import varAnd, varOr

Expand Down Expand Up @@ -132,7 +129,7 @@ def eaMuPlusLambda(
ngen,
stats=None,
halloffame=None,
callbacks: Union[list, Callable] = None,
callbacks=None,
verbose=True,
estimator=None,
):
Expand Down Expand Up @@ -248,7 +245,7 @@ def eaMuCommaLambda(
ngen,
stats=None,
halloffame=None,
callbacks: Union[list, Callable] = None,
callbacks=None,
verbose=True,
estimator=None,
):
Expand Down
14 changes: 7 additions & 7 deletions sklearn_genetic/genetic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,13 @@ def _select_algorithm(self, pop, stats, hof):
Returns
-------
pop: pop object
The last evaluated population
log: Logbook object
It contains the calculated metrics {'fitness', 'fitness_std', 'fitness_max', 'fitness_min'}
the number of generations and the number of evaluated individuals per generation
n_gen: int
The number of generations that the evolutionary algorithm ran
pop: pop object
The last evaluated population
log: Logbook object
It contains the calculated metrics {'fitness', 'fitness_std', 'fitness_max', 'fitness_min'}
the number of generations and the number of evaluated individuals per generation
n_gen: int
The number of generations that the evolutionary algorithm ran
"""

if self.algorithm == Algorithms.eaSimple.value:
Expand Down

0 comments on commit a0f5256

Please sign in to comment.