Skip to content

Commit

Permalink
Added: favicon
Browse files Browse the repository at this point in the history
Updated: README.md
  • Loading branch information
Caparrini committed Mar 7, 2024
1 parent c9db032 commit a0482b7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![mloptimizer_banner](https://github.com/Caparrini/mloptimizer-static/blob/b3bb3de14641e3993ffeed33d39f0932426ff812/logos/mloptimizer_banner_readme.png?raw=true)
![mloptimizer_banner](https://raw.githubusercontent.com/Caparrini/mloptimizer-static/main/logos/mloptimizer_banner_readme.png)

[![Documentation Status](https://readthedocs.org/projects/mloptimizer/badge/?version=master)](https://mloptimizer.readthedocs.io/en/master/?badge=master)
[![PyPI version](https://badge.fury.io/py/mloptimizer.svg)](https://badge.fury.io/py/mloptimizer)
Expand All @@ -7,7 +7,10 @@
[![Coverage Status](http://codecov.io/github/Caparrini/mloptimizer/coverage.svg?branch=master)](https://app.codecov.io/gh/Caparrini/mloptimizer)


**mloptimizer** is a Python library for optimizing hyperparameters of machine learning algorithms using genetic algorithms. With mloptimizer, you can find the optimal set of hyperparameters for a given machine learning model and dataset, which can significantly improve the performance of the model. The library supports several popular machine learning algorithms, including decision trees, random forests, and gradient boosting classifiers. The genetic algorithm used in mloptimizer provides an efficient and flexible approach to search for the optimal hyperparameters in a large search space.
**mloptimizer** is a Python library for optimizing hyperparameters of machine learning algorithms using genetic algorithms.
With mloptimizer, you can find the optimal set of hyperparameters for a given machine learning model and dataset, which can significantly improve the performance of the model.
The library supports several popular machine learning algorithms, including decision trees, random forests, and gradient boosting classifiers.
The genetic algorithm used in mloptimizer provides an efficient and flexible approach to search for the optimal hyperparameters in a large search space.

## Features
- Easy to use
Expand All @@ -21,6 +24,7 @@
- Extensible with more machine learning algorithms that comply with the Scikit-Learn API
- Customizable hyperparameter ranges
- Customizable score functions
- Optional mlflow compatibility for tracking the optimization process

## Installation

Expand Down Expand Up @@ -64,10 +68,16 @@ hyperparameter_space = HyperparameterSpace.get_default_hyperparameter_space(Deci
# 3) Create the optimizer and optimize the classifier
opt = SklearnOptimizer(clf_class=DecisionTreeClassifier, features=X, labels=y, hyperparam_space=hyperparameter_space)

clf = opt.optimize_clf(10, 10)
# 4) Optimize the classifier, the optimization returns the best estimator found in the optimization process
# - 10 generations starting with a population of 10 individuals, other parameters are set to default
clf = opt.optimize_clf(population=10, generations=10)
```
Other algorithms can be used, such as `RandomForestClassifier` or `XGBClassifier` which have a
default hyperparameter space defined in the library.
Even if the algorithm is not included in the default hyperparameter space, you can define your own hyperparameter space
following the documentation.

The last line of code will create a directory in the current folder with a name like `YYYYMMDD_nnnnnnnnnn_SklearnOptimizer`.
The optimization will create a directory in the current folder with a name like `YYYYMMDD_nnnnnnnnnn_SklearnOptimizer`.
This folder contains the results of the optimization,
including the best estimator found and the log file `opt.log` informing with all the steps,
the best estimator and the result of the optimization.
Expand Down Expand Up @@ -123,7 +133,10 @@ The following dependencies are used in `mloptimizer`:
* [Deap](https://github.com/DEAP/deap) - Genetic Algorithms
* [XGBoost](https://github.com/dmlc/xgboost) - Gradient boosting classifier
* [Scikit-Learn](https://github.com/scikit-learn/scikit-learn) - Machine learning algorithms and utilities

Optional:
* [Keras](https://keras.io) - Deep learning library
* [mlflow](https://mlflow.org) - Tracking the optimization process

## Documentation

Expand Down
15 changes: 12 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
project = 'mloptimizer'
copyright = '2024, Antonio Caparrini'
author = 'Antonio Caparrini'
release = '0.6.1'
release = '0.7.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand All @@ -30,7 +30,8 @@
'sphinx.ext.mathjax',
'sphinx.ext.graphviz',
'sphinx.ext.intersphinx',
'autoapi.extension'
'autoapi.extension',
'sphinx_favicon'
]

templates_path = ['_templates']
Expand All @@ -52,7 +53,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_book_theme'
html_static_path = ['_static']
# html_static_path = ['_static']

image_scrapers = ('matplotlib', plotly_sg_scraper,)

Expand All @@ -77,3 +78,11 @@
"repository_url": "https://github.com/Caparrini/mloptimizer",
"use_repository_button": True,
}

html_logo = 'http://raw.githubusercontent.com/Caparrini/mloptimizer-static/main/logos/mloptimizer_banner_readme.png'

favicons = [
"https://raw.githubusercontent.com/Caparrini/mloptimizer-static/main/logos/favicon-16x16.png",
"https://raw.githubusercontent.com/Caparrini/mloptimizer-static/main/logos/favicon-32x32.png",
"https://raw.githubusercontent.com/Caparrini/mloptimizer-static/main/logos/favicon.ico",
]
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ sphinx-gallery==0.14.0
sphinx_book_theme
sphinx_mdinclude
sphinx-autoapi
sphinx-favicon
mlflow
3 changes: 2 additions & 1 deletion requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ kaleido
sphinx-gallery==0.14.0
sphinx_book_theme
sphinx_mdinclude
sphinx-autoapi
sphinx-autoapi
sphinx-favicon
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def read_requirements(requirements_file):
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version="0.6.1", # Required
version="0.7.0", # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
# https://packaging.python.org/specifications/core-metadata/#summary
Expand Down

0 comments on commit a0482b7

Please sign in to comment.