Skip to main content

No project description provided

Project description

CircleCI

mlplot

Machine learning evaluation plots using matplotlib and sklearn.

Install

pip install mlplot

ML Plot runs with python 3.5 and above! (using format strings and type annotations)

Contributing

Create a PR!

Plots

Work was inspired by sklearn model evaluation.

Classification

ROC with AUC number

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.roc_curve()

https://github.com/sbarton272/mlplot/blob/master/tests/output/tests.evaluation.test_classification.test_calibration.png?raw=true ROC plot

Calibration

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.calibration()

calibration plot

Precision-Recall

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.precision_recall(x_axis='recall')
eval.precision_recall(x_axis='thresold')

precision recall curve plot

precision recall threshold plot

Distribution

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.distribution()

distribution plot

Confusion Matrix

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.confusion_matrix(threshold=0.5)

confusion matrix

Classification Report

from mlplot.evaluation import ClassificationEvaluation
eval = ClassificationEvaluation(y_true, y_pred, class_names, model_name)
eval.report_table()

classification report

Regression

Scatter Plot

from mlplot.evaluation import RegressionEvaluation
eval = RegressionEvaluation(y_true, y_pred, class_names, model_name)
eval.scatter()

scatter plot

Residuals Plot

from mlplot.evaluation import RegressionEvaluation
eval = RegressionEvaluation(y_true, y_pred, class_names, model_name)
eval.residuals()

scatter plot

Residuals Histogram

from mlplot.evaluation import RegressionEvaluation
eval = RegressionEvaluation(y_true, y_pred, class_names, model_name)
eval.residuals_histogram()

scatter plot

Regression Report

from mlplot.evaluation import RegressionEvaluation
eval = RegressionEvaluation(y_true, y_pred, class_names, model_name)
eval.report_table()

report table

Forecasts

  • TBD

Rankings

  • TBD

Development

Publish to pypi

python setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

Design

Basic interface thoughts

from mlplot.evaluation import ClassificationEvaluation
from mlplot.evaluation import RegressorEvaluation
from mlplot.evaluation import MultiClassificationEvaluation
from mlplot.evaluation import MultiRegressorEvaluation
from mlplot.evaluation import ModelComparison
from mlplot.feature_evaluation import *

eval = ClassificationEvaluation(y_true, y_pred)
ax = eval.roc_curve()
auc = eval.auc_score()
f1_score = eval.f1_score()
ax = eval.confusion_matrix(threshold=0.7)
  • ModelEvaluation base class
  • ClassificationEvaluation class
    • take in y_true, y_pred, class names, model_name
  • RegressorEvaluation class
  • MultiClassificationEvaluation class
  • ModelComparison
    • takes in two evaluations of the same type

TODO

  • Fix distribution plot, make lines
  • Add legend with R2 to regression plots
  • Add tests for regression comparison
  • Split apart files for comparison classes
  • Add comparisons to README

Project details


Download files

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

Source Distribution

mlplot-0.0.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

mlplot-0.0.3-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file mlplot-0.0.3.tar.gz.

File metadata

  • Download URL: mlplot-0.0.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for mlplot-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9d41f81168f03f3e9f25687fb4a0d345e1161d5379128289d4a04bcbad79044a
MD5 ee9b031ec684aa74b8d8e11c4e2a7eda
BLAKE2b-256 daff6315a7cd11ff4cb96a666ebcefe2701da7e9f4289427c5fe9decdf5b98c8

See more details on using hashes here.

File details

Details for the file mlplot-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mlplot-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for mlplot-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 07a4439386a0a225b861b4eb936f304ee3be694c508dbddd3e681429c1c7bc9c
MD5 0179a1aca4439dc9c22be1c45c6ed67b
BLAKE2b-256 08c665226d8c191f6915e97929928cf65f070c991e3ed1f5d88a03fe5de1c08c

See more details on using hashes here.

Supported by

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