Metadata-Version: 2.1
Name: dsfun
Version: 0.0.4
Summary: Helpful functions for Data Science
Home-page: https://github.com/DawidDabkowski/dsfun
Author: Dawid Dabkowski
Author-email: dav.dabkowski@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: tensorflow (>=2.2.0)
Requires-Dist: pytest (>=5.4.2)
Provides-Extra: developing
Requires-Dist: twine (>=3.1.1) ; extra == 'developing'
Requires-Dist: jupyterlab (>=2.1.3) ; extra == 'developing'
Requires-Dist: ipdb (>=0.13.2) ; extra == 'developing'

[![Build Status](https://travis-ci.com/DawidDabkowski/dsfun.svg?branch=master)](https://travis-ci.com/DawidDabkowski/dsfun) [![codecov](https://codecov.io/gh/DawidDabkowski/dsfun/branch/master/graph/badge.svg)](https://codecov.io/gh/DawidDabkowski/dsfun)


# 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'))
```


