Skip to main content

Machine Learning Research Wizard

Project description

MLWiz: the Machine Learning Research Wizard

License Documentation Status Publish Package Downloads Code style: black Interrogate Coverage

Documentation

MLWiz is a Python library that fosters machine learning research by reducing the boilerplate code to run reproducible experiments. It provides automatic management of data splitting, loading and common experimental settings. It especially handles both model selection and risk assessment procedures, by trying many different configurations in parallel (CPU or GPU). It is a generalized version of PyDGN that can handle different kinds of data and models (vectors, images, time-series, graphs).

Installation:

Requires at least Python 3.10. Simply run

pip install mlwiz

Quickstart:

Build dataset and data splits

mlwiz-data --config-file examples/DATA_CONFIGS/config_NCI1.yml [--debug]

Launch experiments

mlwiz-exp  --config-file examples/MODEL_CONFIGS/config_SupToyDGN.yml [--debug]

Stop experiments

Use CTRL-C, then type ray stop --force to stop all ray processes you have launched.

Using the Trained Models

It's very easy to load the model from the experiments (see also the Tutorial):

from mlwiz.evaluation.util import *

config = retrieve_best_configuration('RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/MODEL_SELECTION/')
splits_filepath = 'examples/DATA_SPLITS/CHEMICAL/NCI1/NCI1_outer10_inner1.splits'
device = 'cpu'

# instantiate dataset
dataset = instantiate_dataset_from_config(config)

# instantiate model
model = instantiate_model_from_config(config, dataset, config_type="supervised_config")

# load model's checkpoint, assuming the best configuration has been loaded
checkpoint_location = 'RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/final_run1/best_checkpoint.pth'
load_checkpoint(checkpoint_location, model, device=device)

# you can now call the forward method of your model
y, embeddings = model(dataset[0])

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

mlwiz-1.0.1.tar.gz (66.9 kB view hashes)

Uploaded Source

Built Distribution

mlwiz-1.0.1-py3-none-any.whl (79.3 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