Skip to main content

mkml

mkml implements a Microkernel Architecture for Machine Learning Library

try it out

  • Install from PyPi
pip install mkml
  • By default, 3 Plug-in modules have been loaded
MKMLMetaclass.register('standardization', StandardizationPlugin)
MKMLMetaclass.register('monitoring', MonitoringPlugin)
MKMLMetaclass.register('local_datasource', LocalDataSourcePlugin)

StandardizationPlugin enforces the method signatures of the model class. In our case, the model class must have fit, predict and score methods

MonitoringPlugin monitors all the functions of the model class. In our case, it logs the input parameters, exception as well as the duration of each function in the model class

LocalDataSourcePlugin helps loading the data locally. It dynamically ingest data-loading functions into the model class to help data scientist retrieve the data without worrying how to retrieve it

  • Create your own model
from mkml import BaseModel

class UserModel(BaseModel):
    def __init__(self):
        self._model = LinearRegression()

    def fit(self, features, labels):
        self._model.fit(X_train, y_train)

    def predict(self, features):
        self._model.predict(features)

    def score(self, features, labels):
        return self._model.score(features, labels)
  • Instantiate the model class instantnce and load features and labels for training and prediction
um = UserModel()

features = um.get_local_data(feature_mart_location='data', group_id='train_features')
labels = um.get_local_data(feature_mart_location='data', group_id='train_labels')

um.fit(features, labels)

test_features = um.get_local_data(feature_mart_location='data', group_id='test_features')
test_labels = um.predict(test_features)
  • Create and register your own Plug-in Module (ie. Remote DataSource)
from mkml import BasePlugin

class RemoteDataSourcePlugin(BasePlugin):

    def __init__(self, name):
        self._name = name

    def apply(self, attrs, **kwargs):
        logger.debug('Entering data source plugin')
        attrs['get_remote_data'] = self._get_remote_data

    def _get_remote_data(self, feature_mart_location, group_id):
        # To be implemented
        pass


## You can add additional instantiation parameters to the Plug-in class as well	
MKMLMetaclass.register('remote_datasource', RemoteDataSourcePlugin, 'remote_ds_plugin')
  • Use the new Remote DataSource Plug-in to retrieve features and labels
um = UserModel()

features = um.get_remote_data(feature_mart_location='http://fm', group_id='train_features')
labels = um.get_remote_data(feature_mart_location='http://fm', group_id='train_labels')

Metadata

Release files for mkml 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkml 0.0.2
File Size Uploaded Provenance Actions
mkml-0.0.2.tar.gz 3.4 kB Without provenance Details for mkml-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mkml 0.0.2
File Interpreter ABI Platform Actions
mkml-0.0.2-py3-none-any.whl Python 3 none any Details for mkml-0.0.2-py3-none-any.whl

Total release size: 8.4 kB

Release files / mkml-0.0.2.tar.gz

Download URL mkml-0.0.2.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0788c316f9336fcb8e2d19e8ad34c65d03b0742098572d37c5ee9a349b4a5eb4
BLAKE2b-256 checksum
How to use checksums
f31eb7ca0db26fda439a03c2a2d0c16b87bab0ef99c6c8a8931e0a749c01211e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.7.9

Release files / mkml-0.0.2-py3-none-any.whl

Download URL mkml-0.0.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab9c2189d9850004cd6be063bc74840b9579543cc33d544357c985b9443c36fa
BLAKE2b-256 checksum
How to use checksums
78e4d4c1ab2e6ef38674a573b4cdb96a0881ef75b1c765a286f13d333dafb9b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.7.9

Security for mkml 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page