Skip to main content

Useful utility functions for evaluation of ML

Project description


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.

Files for ddplt, version 0.0.2.dev2
Filename, size File type Python version Upload date Hashes
Filename, size ddplt-0.0.2.dev2-py3.6.egg (3.1 kB) File type Egg Python version 3.6 Upload date Hashes View hashes
Filename, size ddplt-0.0.2.dev2-py3-none-any.whl (15.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size ddplt-0.0.2.dev2.tar.gz (2.8 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