Skip to main content

Model Tooling library

Build Status codecov Python 3 CodeFactor Code style: black

Installation

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

Test

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 fetch_california_housing
from sklearn.linear_model import LinearRegression

from ml_tooling import Model
from ml_tooling.data import Dataset

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

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

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

# Instantiate the data
data = CaliforniaData()

# Split training and test data
data.create_train_test()

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

# Visualize the result
result.plot.prediction_error()

print(result)
<Result LinearRegression: {'r2': 0.68}>

Links

Download files

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

Source Distribution

ml_tooling-0.12.1.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

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

ml_tooling-0.12.1-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

Details for the file ml_tooling-0.12.1.tar.gz.

File metadata

  • Download URL: ml_tooling-0.12.1.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for ml_tooling-0.12.1.tar.gz
Algorithm Hash digest
SHA256 d84fab1f5dc36332986e1f16b1d0b29ecb1a935e9beb8e773e5224e3aa84fa7c
MD5 52addd120ad7e0650fda4ed2dc3a016b
BLAKE2b-256 74dd561aa9e9b2f27bdec4961bef1203688d61b202e861132acd850b88434421

See more details on using hashes here.

File details

Details for the file ml_tooling-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: ml_tooling-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for ml_tooling-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b82b2dc8fda470b5445d242da29a671f1c9f3df20574b122bb1bc51bc02f893
MD5 c6ee7264f78ee360d7a67b2964ce6db2
BLAKE2b-256 32a62e173235a535d1fd26e6f444f2ca69a363e426d13b446a68e831c9714db8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.12.1 This release

2 files

0.12.0

2 files

0.11.0

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.1

2 files

0.7

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.1.3

2 files

0.1.2

2 files

Supported by

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