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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file skga-1.0.0.tar.gz.

File metadata

  • Download URL: skga-1.0.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for skga-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e2780d2cdd29f16a7e78fdf269c1398232d97a93b5306df5e655d028f50a5d37
MD5 c0766a548f6b840b06f331341ffa8682
BLAKE2b-256 3a5c27ce53788454329bb13c8188cfd9d77da801e74ce564a299b1e1c0f28898

See more details on using hashes here.

File details

Details for the file skga-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: skga-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 51.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for skga-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcf2429d80f6eb65ad9522faa7c6f136b46f65249bb6ab5448b27c059f60b2b6
MD5 e223879b814a11edbb60d7bc9513f15b
BLAKE2b-256 f8a43f0eb463e0256ba1763cba3dffdfb4dc1b0582fcede9c03b1ae7e0260eea

See more details on using hashes here.

Supported by

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