Skip to main content

Useful utility functions for evaluation of ML

Project description

ddplt

Useful utility functions for evaluation of ML.

Motivation: The main motivation behind this package is to create a single place where the utility functions for ML projects are located. These functions represent the best I was able to scrape from various tutorials or offical documentation on the web.

Confusion matrix

This function prints and plots the confusion matrix.

The code:

import numpy as np
from ddplt import plot_confusion_matrix

y_test = np.array([0, 0, 1, 1, 2, 0])
y_pred = np.array([0, 1, 1, 2, 2, 0])
class_names = np.array(['hip', 'hop', 'pop'])
ax, cm = plot_confusion_matrix(y_test, y_pred, class_names)

will create a plot like: conf_matrix

Learning curve

Create plot showing performance evaluation for different sizes of training data. The method should accept:

  • existing Axes
  • performance measure (e.g. accuracy, MSE, precision, recall, etc.)
  • ...

ROC curve

Plot showing Receiver Operating Characteristics of a predictor.

Correlation heatmap

Grid where each square has a color denoting strength of a correlation between predictors. You can choose between Pearson and Spearman correlation coefficient, the result is shown inside the square.

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

ddplt-0.0.2.dev2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distributions

ddplt-0.0.2.dev2-py3.6.egg (3.1 kB view hashes)

Uploaded Source

ddplt-0.0.2.dev2-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

Supported by

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