Library for handling and fitting fuzzy measures
Project description
Pyfmtools
Pyfmtools provides various tools for handling fuzzy measures, calculating various indices, Choquet and Sugeno integrals, as well as fitting fuzzy measures to empirical data. This package is designed for Python , but it also includes the C++ source files and a user manual.
Chapter 2 of the user manual provides some background on fuzzy measures. A more detailed overview can be found in [4, 5, 12, 16] and references therein. Chapter 3 of the user manual outlines computational methods used to fit fuzzy measures to empirical data. The description of the programming library pyfmtools is given in Chapter 4. Examples of its usage are provided in Section 4.6.
To cite pyfmtools package, use references [2–6,21–24]. New in version 4
Random generation of fuzzy measures of different types, including k-additive, k-interactive, supermodular and submodular, sparse representation of k- additive fuzzy measures.
We added in version 3
We added the concept of K-interactive fuzzy measures, and 4 methods of fitting K-interactive fuzzy measures from data based on linear program- ming. K-interactive fuzzy measures significantly reduce the computational complexity. We also added fitting fuzzy measures in marginal contribution representation and using maximal chains method, which fits only the values directly identifiable from the data. This method is useful for small data sets.
Fitting fuzzy measures in marginal contribution representation allows simple sub and supermodularity constraints, which can now be enforced.
See functions fittingKinteractive, fittingKinteractiveAuto, fittingKinter- activeMC, fittingKinteractiveMarginal, fittingKinteractiveMarginalMC.
We added calculation of new non-additivity and bipartition interaction indices. See functions Bipartition, BipartitionBanzhaf, NonadditivityIndex, NonadditivityIndexMob.
We added in version 2
We added fitting K-maxitive and K-tolerant fuzzy measures, based on linear and mixed integer programming. See functions fittingktolerant and fittingK- maxitive.
We added a method for fitting sub-modular fuzzy measures reported in [3]. Supermodular fuzzy measure can also be fit by using duality: construct dual data set, fit a sub-modular fuzzy measure and then compute its dual. See function FuzzyMeasureFitLP.
We added an extra requirement of preservation of output ordering. See function FuzzyMeasureFitLP.
Fixed many warnings in the lpsolve code.
Documentation
Installation
To install type:
$ pip install pyfmtools
Usage of the library
from _pyfmtools import flib, lib
Follow these steps in your Python code to use the library:
- Initialize resources
- Use library function(s)
- Free resources
Example how to initialize resources
r=3
n=3
env=ffi.new( "struct fm_env *")
fm.py_fm_init( n, env)
Example how to free resources
fm.py_fm_free( env)
Usage of library functions
To implement a function follow these steps:
- Check size of input arrays. Example:
- Check types of input arrays. Example:
- Use CFFI type conversion for each input array or pointer. Example:
- Call C or C++ function. Example:
Parameters
Input parameters:
See function list
Output parameters:
See function list
Test
To unit test type:
$ test/test.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyfmtools-0.55-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2bb77136b43793773c1e63f2fe802ce640f2a193e3e5332359b605955b081b9 |
|
MD5 | d84139d0b3472daa474b1b0d1034f910 |
|
BLAKE2b-256 | c83ea320c3e58d5774042d17774bbc669b63573f5735344ec2f05f5db5a63805 |