Three Way Decision/Rough Set library
Project description
TWD
A Python library for Three Way Decision and Rough Set Theory.
Citation
@inproceedings{ribeiro2019toward,
title={Toward a three-way image classification model: A case study on corn grain images},
author={Ribeiro, Sergio Silva and Yao, JingTao},
booktitle={2019 IEEE International Symposium on Multimedia (ISM)},
pages={177--1776},
year={2019},
organization={IEEE}
}
Getting Started
Dependencies
There is not dependecy for this library
Installation
pip install twd
Sample Usage
For this example we will assume the following Decision System/Table (DS):
Headache | Muscle Pain | Temperature | Flu |
---|---|---|---|
n | y | high | y |
y | n | high | y |
y | y | very high | y |
n | y | normal | n |
y | n | high | n |
n | y | very high | y |
The sample usage considering the mentioned DS is:
from twd import TWD
dt = [["n","y","high","y"],
["y","n","high","y"],
["y","y","very high","y"],
["n","y","normal","n"],
["y","n","high","n"],
["n","y","very high","y"]]
o3wd = TWD(dt,["Headache","Muscle Pain","Temperature"])
print("U => ",o3wd.getU())
print("X={x| Flu(x)=y} =>",o3wd.getX("y"))
print("Va(Headache)",o3wd.getVa("Headache"))
print("Va(Muscle Pain)",o3wd.getVa("Muscle Pain"))
print("Va(Temperature)",o3wd.getVa("Temperature"))
print("Vd",o3wd.getVd())
print("Va",o3wd.getVa())
print("IND(A)",o3wd.getIND())
print("IND(Headache)",o3wd.getIND(["Headache"]))
print("IND(Headache,Muscle Pain)",o3wd.getIND(["Headache","Muscle Pain"]))
print("IND(Muscle Pain)",o3wd.getIND(["Muscle Pain"]))
print("IND(Temperature)",o3wd.getIND(["Temperature"]))
print("IND(Headache,Temperature)",o3wd.getIND(["Headache","Temperature"]))
print("lowerXA =>",o3wd.getLowerAX(o3wd.getX("y"),o3wd.getIND()))
print("upperXA =>",o3wd.getUpperAX(o3wd.getX("y"),o3wd.getIND()))
print("POS(X)",o3wd.getPOSX(o3wd.getX("y"),o3wd.getIND()))
print("BND(X)",o3wd.getBNDX(o3wd.getX("y"),o3wd.getIND()))
print("NEG(X)",o3wd.getNEGX(o3wd.getX("y"),o3wd.getIND()))
print("Precision of Approximation: ",o3wd.precision(o3wd.getX("y"),o3wd.getIND()))
print("Quality of Approximation: ",o3wd.quality(o3wd.getX("y"),o3wd.getIND()))
print("Roughness: ",o3wd.roughness(o3wd.getX("y"),o3wd.getIND()))
print("")
print("Rules")
print(o3wd.getRules(o3wd.getPOSX(o3wd.getX("y"),o3wd.getIND())))
print("")
print("Reduction:",o3wd.getReduct())
Features
- Indiscernibility
- Set Approximation
- Precision of Approximation
- Quality of Approximation
- Roughness
- Rules
- Reducts
License
MIT
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
twd-0.0.3.tar.gz
(3.4 kB
view details)
Built Distribution
twd-0.0.3-py3-none-any.whl
(4.0 kB
view details)
File details
Details for the file twd-0.0.3.tar.gz
.
File metadata
- Download URL: twd-0.0.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86241020eb9a7fd7a8beb97fd9bc94eff0fb78fe50aa70e8ca6d41f471ddaffb |
|
MD5 | af7ff5999a81040ff0f007af2a266d6f |
|
BLAKE2b-256 | e86471cdafcf0cf2d992d3a829b4004541a1a16452686e1a1e739ae1a6a30020 |
File details
Details for the file twd-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: twd-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53ac883444c58659c68ea8028d6425ccdb6d2f8b63ef0c0032558dc78f37797 |
|
MD5 | cf4defe802eb59c89cb99c5d508275e0 |
|
BLAKE2b-256 | 283920c4b3587f946bb6a4c2d7332c6b0fa4a49e3d3b3a3218b7cdf7f6c881bf |