Skip to main content

A library for machine learning utilities

Project description

Model Tooling library

Build Status codecov Python 3 CodeFactor Code style: black


Use pip to install: pip install ml-tooling Or use conda conda install -c conda-forge ml_tooling


We use tox for managing build and test environments, to install tox run: pip install tox And to run tests: tox -e py

Example usage

Define a class using ModelData and implement the two required methods. Here we simply implement a linear regression on the Boston dataset using sklearn.datasets

from sklearn.datasets import load_boston
from sklearn.linear_model import LinearRegression

from ml_tooling import Model
from import Dataset

# Define a new data class
class BostonData(Dataset):
    def load_prediction_data(self, idx):
        x, _ = load_boston(return_X_y=True)
        return x[idx] # Return given observation

    def load_training_data(self):
        return load_boston(return_X_y=True)

# Instantiate a model with an estimator
linear_boston = Model(LinearRegression())

# Instantiate the data
data = BostonData()

# Split training and test data

# Score the estimator yielding a Result object
result = linear_boston.score_estimator(data)

# Visualize the result

<Result LinearRegression: {'r2': 0.68}>


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 ml-tooling, version 0.12.0
Filename, size File type Python version Upload date Hashes
Filename, size ml_tooling-0.12.0-py3-none-any.whl (68.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ml_tooling-0.12.0.tar.gz (44.7 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