Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Just another ML framework. Built on top of scikit-learn.

Project description

Coltrane

Description

General use, pipeline-oriented machine learning framework. Lets user configure pipelines, load data, and evaluate pipeline against data. Who's said that improvising over Giant Steps has to be hard? This framework eases and standardizes research process. User can focus on configuring pipeline, or implementing core pipeline elements.

Features

Data set loaders

plain .csv

  • single label

Logging

  • fitted pipelines
  • validation metrics
  • aggregated validation metrics
  • confusion matrix for each split

Getting started

pip install coltrane

Example

from pathlib import Path

from sklearn.metrics import (accuracy_score, f1_score, precision_score,
                             recall_score)
from sklearn.model_selection import RepeatedStratifiedKFold
from sklearn.naive_bayes import GaussianNB
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelEncoder, StandardScaler

from coltrane import Batch
from coltrane.classification import Inspector, Processor
from coltrane.file.io.csv.single import Data


__LOGS = Path('logs')
__DATA_IRIS = Path('/data/iris.csv')
__RANDOM_STATE = 45625461


batch = Batch(
    data=Data(path=__DATA_IRIS),
    pipeline=Pipeline(
        steps=[
            ('standard-scaler', StandardScaler()),
            ('naive-bayes', GaussianNB())
        ]
    ),
    selection=RepeatedStratifiedKFold(
        n_splits=5,
        n_repeats=1,
        random_state=__RANDOM_STATE
    ),
    metrics=[
        accuracy_score,
        (
            precision_score,
            {
                'average': 'weighted'
            }
        ),
        (
            recall_score,
            {
                'average': 'weighted'
            }
        ),
        (
            f1_score,
            {
                'average': 'weighted'
            }
        )
    ],
    encoder=LabelEncoder(),
    multiprocessing=True
)

inspector = Inspector()
inspector.inspect([data], output=__LOGS)

processor = Processor()
processor.process([batch], output=__LOGS)

Authors

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 coltrane, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size coltrane-0.0.2-py3-none-any.whl (16.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size coltrane-0.0.2.tar.gz (10.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page