Skip to main content

Helpful functions for Data Science

Project description

Build Status codecov

DSfun

This package is under development and limited for now. Eventually, it will contain a special categorical loss function class for training machine learning algorithms. The goal features include:

  • Wrapping in a simple interface for many useful loss functions based on confusion matrix
  • Differentiability (compatibility with tensorflow)
  • Scalable to multilabel problems
  • Time efficiency optimizations
  • Working with missing labels

Limitations:

  • Loss function that aren't widely studied, should be used with caution and proper validation
  • If calculating on batches, it might give a biased estimation of global loss
  • As the class is broad, some of the functions might not converge at all

Instalation

pip install dsfun

Usage example

import tensorflow as tf
from dsfun import f1_loss, f1_score

y_true = tf.constant([[1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 1.0]])
y_pred = tf.constant([[0.5, 0.5], [0.5, 0.5], [1.0, 0.0], [0.0, 1.0]])

print(f1_loss(y_true, y_pred, 'macro'))
print(f1_score(y_true, y_pred, 'macro'))

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

dsfun-0.0.4.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

dsfun-0.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file dsfun-0.0.4.tar.gz.

File metadata

  • Download URL: dsfun-0.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for dsfun-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cf5d83ae92306d184033599a2bc343bafb778b4da5cfd6012113c4ea7d811092
MD5 ab1a09ef8d4e2265c1f8dfb5c71fcc52
BLAKE2b-256 66f65ee316446471a5ca40c19f1ae84ac806d2099e81a29be030341ec0aa1feb

See more details on using hashes here.

File details

Details for the file dsfun-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dsfun-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for dsfun-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b056b521dd5b158daa701918b4a01011cf41087339127a0bc01c3c38ce2691
MD5 4975e2a9f1ed7c93bab1d25bbd065a4b
BLAKE2b-256 3e1fceeafce11846ebe5b6832d80b0c6ddcddb5e84b9d300d6c21e7ad000b315

See more details on using hashes here.

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