Skip to main content

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

Project description


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 =

y =

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

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



pso = PSO(particle_count=num_particles,
distance_between_initial_particles=0.7, evaluation_metric=accuracy_score)
best_metric, best_model =,
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__”:

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.3
Filename, size File type Python version Upload date Hashes
Filename, size AutomaticAI-0.3.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate 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