Skip to main content
# 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)
```


Release files for mllearn 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mllearn 1.2.3
File Size Uploaded
mllearn-1.2.3.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mllearn 1.2.3
File Interpreter ABI Platform
mllearn-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / mllearn-1.2.3.tar.gz

Download URL mllearn-1.2.3.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6570fa8cd2033cec128d1b35f98dd9ac88e35bbd033a248922402896d2cecb43
BLAKE2b-256 checksum
How to use checksums
9d6c1c983c8511435ae9767630100d33b1c3f8341e343d3f2910104ba6f9d5a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / mllearn-1.2.3-py3-none-any.whl

Download URL mllearn-1.2.3-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13746fa839b72b639b96ec618de2a975bf329dbbdeb1f409eb8c048c07977c5b
BLAKE2b-256 checksum
How to use checksums
2cc5f78036039dbe9ded5993817195e40c3f81e2b63871109383ae57ef126364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

2 release files

1.1

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page