Skip to main content

a package for multi-label classify

Project description

# multi-label-learn

mlleran is a python library for multi-label classification bulti on scikit-learn and numpy.

## Implementation
The implementation is based on the paper [A Review on Multi-Label Learning Algorithms](https://ieeexplore.ieee.org/document/6471714/), and the implementated algorithms include:

**Problem Transformation**

- [x] Binary Relevance
- [x] Classifier Chains
- [x] Calibrated Label Ranking
- [x] Random k-Labelsets

**Algorithm Adaptation**

- [x] Multi-Label k-Nearest Neighbor
- [x] Multi-Label Decision Tree
- [ ] Ranking Support Vector Machine
- [ ] Collective Multi-Label Classifier

## Installation
```bash
pip install mllearn
```
**Note: Support Python3 only.**

## Data Format
All data type should be `ndarray`, especially y should be the binary format. For example, if your dataset totally have 5 labels and one of your samples has only first and last labels, then the corresponding output should be `[1, 0, 0, 0, 1]`.
```python
samples, features = X_train.shape
samples, labels = y_train.shape
samples_test, features = X_test.shape
samples_test, labels = y_test.shape
```
You can also find multi-label dataset provided by Mulan [here](http://mulan.sourceforge.net/datasets-mlc.html).

## Example Usage
This library includes 2 parts, algorithms and metrics.
```python
from mllearn.problem_transform import BinaryRelevance

classif = BinaryRelevance()
classif.fit(X_train, y_train)
predictions = classif.predict(X_test)
```

```python
from mllearn.metrics import subset_acc
acc = subset_acc(y_test, predictions)
```


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

mllearn-1.2.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

mllearn-1.2.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file mllearn-1.2.3.tar.gz.

File metadata

  • Download URL: mllearn-1.2.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mllearn-1.2.3.tar.gz
Algorithm Hash digest
SHA256 6570fa8cd2033cec128d1b35f98dd9ac88e35bbd033a248922402896d2cecb43
MD5 9b7c6e69859c3ef098406efef3a502dc
BLAKE2b-256 9d6c1c983c8511435ae9767630100d33b1c3f8341e343d3f2910104ba6f9d5a5

See more details on using hashes here.

File details

Details for the file mllearn-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mllearn-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13746fa839b72b639b96ec618de2a975bf329dbbdeb1f409eb8c048c07977c5b
MD5 df4ea2ba8b615a5ba9500532dcd2caea
BLAKE2b-256 2cc5f78036039dbe9ded5993817195e40c3f81e2b63871109383ae57ef126364

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