Skip to main content

A Hybrid Approach for Automatic Artificial Intelligence Algorithm Selection and Hyperparameter Tuning

Project description

Introduction

This is method used for solving the problem of AI algorithm selection and hyperparameter tuning, without human intervention, in a fully automated way. The method is a hybrid approach, a combination between Particle Swarm Optimization and the Simulated Annealing.

Example Usage

from sklearn import datasets

from sklearn.model_selection import train_test_split

from sklearn.metrics import accuracy_score

from AutoAIAlgorithm.ParticleSwarmOptimization import PSO

def main():

# load the MNIST digits dataset

mnist = datasets.load_digits()

X = mnist.data

y = mnist.target

# Splitting the data into training set, test set and validation set

x_train, x_test, y_train, y_test = train_test_split(X, y)

num_particles=5

num_iterations=30

pso = PSO(particle_count=num_particles,
distance_between_initial_particles=0.7, evaluation_metric=accuracy_score)
best_metric, best_model = pso.fit(X_train=x_train,
X_test=x_test, Y_train=y_train, Y_test=y_test, maxiter=num_iterations, verbose=True, max_distance=0.05)

print(best_metric) print(best_model)

if __name__ == “__main__”:
main()

Project details


Download files

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

Files for AutomaticAI, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size AutomaticAI-0.2.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page