Skip to main content

The python package implementing the HyperBRKGA algorithm optimizes hyperparameters of machine learning algorithms through a hybrid approach based on genetic algorithms.

Project description

SKGA

Welcome to the SKGA repository! This repository contains the skga package, which is a Python library for performing machine learning hyperparameters optimization.

Installation

To install the skga package, follow these steps:

  1. Make sure you have Python 3.9 installed on your system.

  2. Open a terminal or command prompt.

  3. Run the following command to install the package using pip:

    pip install skga
    

    This will automatically download and install the skga package along with its dependencies.

Basic Usage

Once you have installed the skga package, you can start using it in your Python projects. Here's a basic example to get you started:

from sklearn import svm, datasets
from sklearn.model_selection import train_test_split
from skga import HyperBRKGASearchCV

# Load the Iris dataset
irisX, irisY = datasets.load_iris(return_X_y=True)

# Split the dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(irisX, irisY, test_size=0.5, random_state=0)

# Define the parameters for the SVM classifier
parameters = {'kernel': ('linear', 'rbf'), 'C': [1, 10]}

# Create an SVM classifier
svc = svm.SVC()

# Create a HyperBRKGASearchCV instance
clf = HyperBRKGASearchCV(svc, parameters=parameters, data=X_train, target=y_train)

print("# Optimizing hyperparameters for accuracy\n")

# Fit the classifier to the training data
clf.fit(X_train, y_train)

print("Best combination of parameters found in the training set:\n")
print(clf.cv_results_['best_param_decoded'])
print()
print("Scores of HyperBRKGA in the training set:\n")
print(clf.cv_results_)

This example demonstrates how to use the HyperBRKGASearchCV class from the skga package to perform hyperparameter optimization for an SVM classifier.

For more detailed examples and use cases, please refer to the examples directory in the SKGA repository.

Contributing

If you find any issues or have suggestions for improvement, please feel free to contribute to this repository. You can submit bug reports, feature requests, or pull requests through the GitHub repository. We appreciate your contributions!

License

This project is licensed under the BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skga-1.0.0.tar.gz (31.0 kB view hashes)

Uploaded Source

Built Distribution

skga-1.0.0-py3-none-any.whl (51.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page