Pwml
Pwml
stands for P
ython W
rappers for M
achine L
earning
Installation
- The
Pwml
package is published at https://pypi.org/project/Pwml/ - Install package:
pip install Pwml
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 specificmodel
is fitted to handle the possibleClass
values available under thatDivision
.
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.