Choquet-classifier
Implementation of the Choquet classifier. This model was presented in "Learning monotone nonlinear models using the Choquet integral" [1]
- 🚧Under Construction🚧
Installation
Dependencies
- Python (>=3.9)
- NumPy (>=1.23.3)
- SciPy (>=1.9.1)
- scikit-learn (>=1.1.1)
User installation
- clone this repository or
- pip installation will be added soon
Usage
The application is compatible to scikit-learn and can be used like every other classifier from the scikit-learn library. In order to use the Choquet classifier, import the class ChoquetClassifier from the module choquet_classifier from the package classifier. Some examples are shown below:
Default example
Use the contructor and the function fit to initialize the Choquet classifier for a given dataset.
>>> from classifier.choquet_classifier import ChoquetClassifier
>>> X = [[1, 3, 2],
... [1, 0, 3]]
>>> y = [1, 0]
>>> cc = ChoquetClassifier()
>>> cc.fit(X, y)
Use the function predict to classify samples.
>>> Z = [[1, 1, 2],
... [2, 1, 3]]
>>> cc.predict(Z)
array([0, 0])
Examples with hyper-parameters
>>> from classifier.choquet_classifier import ChoquetClassifier
>>> X = [[1, 3, 2],
... [1, 0, 3]]
>>> y = [1, 0]
>>> cc = ChoquetClassifier(additivity=3, regularization=1)
>>> cc.fit(X, y)
Again, the function predict can be used to classify samples. Note the different output compared to the first example.
>>> Z = [[1, 1, 2],
... [2, 1, 3]]
>>> sc.predict(Z)
array([0, 1])
Example with different class labels
The classes do not have to be labeled with 0 and 1; any integer numbers or strings may be used instead. The smaller label in terms of the relation or lexicographic ordering is given to the negative class, whereas the other label is assigned to the positive class.
The first example contains the class labels 2 and 1. Label 2 is assigned to the positive class and label 1 is assigned to the negative class since 2>1.
>>> from classifier.choquet_classifier import ChoquetClassifier
>>> X = [[1, 3, 2],
... [1, 0, 3]]
>>> y = [2, 1]
>>> cc = ChoquetClassifier()
>>> cc.fit(X, y)
>>> Z = [[1, 1, 2],
... [2, 1, 3]]
>>> sc.predict(Z)
array([1, 1])
The second example contains the class labels 'one' and 'two'. Label 'one' is assigned to the negative class and label 'two' is assigned to the positive class because 'one' comes lexicographically first.
>>> from classifier.choquet_classifier import ChoquetClassifier
>>> X = [[1, 3, 2],
... [1, 0, 3]]
>>> y = ['two', 'one']
>>> cc = ChoquetClassifier()
>>> cc.fit(X, y)
>>> Z = [[1, 1, 2],
... [2, 1, 3]]
>>> sc.predict(Z)
array(['one', 'one'])
Licence
Reference
[1] Ali Fallah Tehrani, Weiwei Cheng, Krzysztof Dembczynski and Eyke Hüllermeier. Learning monotone nonlinear models using the Choquet integral. 2012.
Metadata
Release files for choquet-classifier-glenscalai 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| choquet_classifier_glenscalai-0.0.1.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| choquet_classifier_glenscalai-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / choquet_classifier_glenscalai-0.0.1.tar.gz
| Download URL | choquet_classifier_glenscalai-0.0.1.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29d6e18ebfb29cd50764d3fac75d7f67160dba1bc955de8bb907474deccc1bb2
|
|
BLAKE2b-256 checksum How to use checksums |
c37cb25b936aaf166487848b53c3bd43c5031e5a41db428b0251300b7ff76820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / choquet_classifier_glenscalai-0.0.1-py3-none-any.whl
| Download URL | choquet_classifier_glenscalai-0.0.1-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4e388d362dea26afcde4fcb58c473433d2f305ffd95077874130b7f9248e55f
|
|
BLAKE2b-256 checksum How to use checksums |
a38e333dd536cbd268183dd2f8a2b55041b36a95390532586f70af85c88cb6f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|