mloptimizer is a Python library for optimizing hyperparameters of machine learning algorithms using genetic algorithms.
Project description
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.
Installation
It is recommended to create a virtual environment using the venv
package.
To learn more about how to use venv
,
check out the official Python documentation at
https://docs.python.org/3/library/venv.html.
# Create the virtual environment
python -m venv myenv
# Activate the virtual environment
source myenv/bin/activate
To install mloptimizer
, run:
pip install mloptimizer
You can get more information about the package installation at https://pypi.org/project/mloptimizer/.
Quickstart
Here's a simple example of how to optimize hyperparameters in a decision tree classifier using the iris dataset:
from mloptimizer.genoptimizer import TreeOptimizer
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True)
#
opt = TreeOptimizer(X, y, "Optimizer")
clf = opt.optimize_clf(10, 10)
The last line of code will create a directory in the current folder with a name like YYYYMMDD_nnnnnnnnnn_TreeOptimizer
.
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.
More details in the documentation.
Dependencies
The following dependencies are used in mloptimizer
:
- Deap - Genetic Algorithms
- XGBoost - Gradient boosting classifier
- Scikit-Learn - Machine learning algorithms and utilities
- Keras - Deep learning library
Documentation
The documentation for mloptimizer
can be found in the project's wiki
with examples and classes and methods reference.
Authors
- Antonio Caparrini - Owner - caparrini
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mloptimizer-0.5.9.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53b7b9fcfe832cebd487b628563fac2f92e3da84b54de3b910e939b2e9020c7 |
|
MD5 | 1cf67045686435fcb62708dc3415710b |
|
BLAKE2b-256 | 4ace8d644e5bc0ea219eb5bd92b7851c1348da35eac4882dde514a94ad9b9221 |