Skip to main content

Travis AppVeyor Codecov CircleCI ReadTheDocs

fuzzy-rough-learn

fuzzy-rough-learn is a library of machine learning algorithms involving fuzzy rough sets, as well as data descriptors that can be used for one-class classification / novelty detection. It builds on scikit-learn, but uses a slightly different api, best illustrated with a concrete example:

from sklearn import datasets
from sklearn.metrics import accuracy_score, roc_auc_score
from sklearn.model_selection import train_test_split

from frlearn.base import probabilities_from_scores, select_class
from frlearn.classifiers import FRNN
from frlearn.feature_preprocessors import RangeNormaliser

# Import example data.
iris = datasets.load_iris()
X = iris.data
y = iris.target

# Split into train and test sets.
X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, random_state=0)

# Create an instance of the FRNN classifier, construct the model, and query on the test set.
clf = FRNN(preprocessors=(RangeNormaliser(), ))
model = clf(X_train, y_train)
scores = model(X_test)

# Convert scores to probabilities and calculate the AUROC.
probabilities = probabilities_from_scores(scores)
auroc = roc_auc_score(y_test, probabilities, multi_class='ovo')
print('AUROC:', auroc)

# Select classes with the highest scores and calculate the accuracy.
classes = select_class(scores)
accuracy = accuracy_score(y_test, classes)
print('accuracy:', accuracy)

Both classifiers and feature preprocessors are functions that take training data and output a model. Models are functions that take data and output something else. Classifier models output class scores, preprocessor models output a transformation of the data. Preprocessors can be added as a keyword argument when initialising a classifier, which automatically creates a preprocessor model on the basis of the training data and applies it to the training and the test data.

Contents

At present, fuzzy-rough-learn contains the following algorithms:

Multiclass classifiers

  • Fuzzy Rough Nearest Neighbours (FRNN; multiclass)

  • Fuzzy Rough OVO COmbination (FROVOCO; muliclass, suitable for imbalanced data)

  • Fuzzy ROugh NEighbourhood Consensus (FRONEC; multilabel)

Data descriptors

  • Average Localised Proximity (ALP)

  • Centre Distance (CD)

  • Extended Isolation Forest (EIF)

  • Isolation Forest (IF)

  • Local Outlier Factor (LOF)

  • Localised Nearest Neighbour Distance (LNND)

  • Mahalanobis Distance (MD)

  • Nearest Neighbour Distance (NND)

  • Support Vector Machine (SVM)

Regressors

  • Fuzzy Rough Nearest Neighbours (FRNN)

Feature preprocessors

  • Fuzzy Rough Feature Selection (FRFS)

  • Linear normaliser; in particular:

    • Interquartile range (IQR) normaliser

    • Maximum absolute value (MaxAbs) normaliser

    • Range normaliser

    • Standardiser

  • Shrink Autoencoder (SAE; unsupervised)

  • Vector size normaliser

Instance preprocessors

  • Fuzzy Rough Prototype Selection (FRPS)

Other

  • array functions

  • dispersion measures

  • location measures

  • nearest neighbour search methods

  • parametrisations

  • t_norms

  • transformations

  • vector size measures

  • weights

Documentation

The documentation is located here.

Dependencies

fuzzy-rough-learn requires python 3.7+ and the following packages:

  • scipy >= 1.1.0

  • numpy >=1.17.0

  • scikit-learn >=0.24.0

In addition, some algorithms require optional dependencies:

  • eif >= 2.0.0 (EIF)

  • tensorflow >= 2.2.0 (SAE)

Citing fuzzy-rough-learn

If you use or refer to fuzzy-rough-learn in a scientific publication, please cite this paper:

Lenz OU, Peralta D, Cornelis C (2020).
fuzzy-rough-learn 0.1: a Python library for machine learning with fuzzy rough sets.
IJCRS 2020: Proceedings of the International Joint Conference on Rough Sets, pp 491–499.
Lecture Notes in Artificial Intelligence, vol 12179, Springer.
doi: 10.1007/978-3-030-52705-1_36

Bibtex entry:

@inproceedings{lenz20fuzzyroughlearn,
  title={{f}uzzy-rough-learn 0.1: a {P}ython library for machine learning with fuzzy rough sets},
  author={Lenz, Oliver Urs and Peralta, Daniel and Cornelis, Chris},
  booktitle={{IJCRS} 2020: Proceedings of the International Joint Conference on Rough Sets},
  pages={491--499},
  year={2020},
  series={Lecture Notes in Artificial Intelligence},
  volume={12179},
  publisher={Springer}
}

Metadata

Release files for fuzzy-rough-learn 0.2.2

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

Source distribution (sdist)

Source distribution for fuzzy-rough-learn 0.2.2
File Size Uploaded
fuzzy-rough-learn-0.2.2.tar.gz 12.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for fuzzy-rough-learn 0.2.2
File Interpreter ABI Platform
fuzzy_rough_learn-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 MB

Release files / fuzzy-rough-learn-0.2.2.tar.gz

Download URL fuzzy-rough-learn-0.2.2.tar.gz
Size 12.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6b51db735f903b74e77fcfaf31d86e06e515cc81eb84776b49af3b20ea653348
BLAKE2b-256 checksum
How to use checksums
76e7d9025d8fb039e87ff1e3566a0414a6815450ec5bdeee962407e69e113579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

Release files / fuzzy_rough_learn-0.2.2-py3-none-any.whl

Download URL fuzzy_rough_learn-0.2.2-py3-none-any.whl
Size 58.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d8bcaf435e4b90e17531ca37feb12697cc65cfd258aeed65af0c1f2fa8f5459
BLAKE2b-256 checksum
How to use checksums
2737972b4bb7b89f2eafd6b7cf9a6c25e323eee8c7bc5513788152c028aa0485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

1 release file

0.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