Pwml

Python Wrappers for Machine Learning


License
MIT
Install
pip install Pwml==0.9.9

Documentation

Pwml

Pwml stands for Python Wrappers for Machine Learning

Quality Gate Status PyPI version

Installation

Samples

Hierarchical Model Training

The hierarchical model is basically defined like follow.

from Pwml.classifiers import hierarchical as hc
from Pwml.classifiers import features as fe

# (...)

model = hc.HierarchicalClassifierModel(
    model_name=model_name,
    experiment_name=experiment_name,
    input_features=[
        fe.InputFeature(feature_name='Style', feature_type='text'),
        fe.InputFeature(feature_name='Gender', feature_type='text'),
        fe.InputFeature(feature_name='Brand', feature_type='text'),
        fe.InputFeature(feature_name='Category', feature_type='text') ],
    output_feature_hierarchy=fe.OutputFeature(
        feature_name='Division',
        child_feature=fe.OutputFeature(feature_name='Class')))

It will fit n+1 models, where n is the number of distinct Division values:

  • 1 model is fitted to handle the Division value.
  • For each Division value a specific model is fitted to handle the possible Class values available under that Division.

Each model type is selected and fine-tuned separately.

Inference

This repository contains a sample solution implemented as a web-service using Flask, Flask-Restful, Flask-Cors and Flask-Wtf.

The web-service allows loading one or more pre-trained models and making a classification prediction based on a given sample along with its input features.