Skip to main content

Rough sets implementation for Python

Project description

Guidelines

Instalation

To install this package use pip as following

pip install rst-tools

Usage

Rough Set (Pawlak's Model)

import pandas as pd
from rst_tools.models.roughsets import RoughSets as RST
from rst_tools.models.roughsets import QuickReduct as QR

df = pd.read_csv("YOUR/FILE.csv")
conditional_attributes = list(df.column.values)
decision_attribute = conditional_attributes[-1]
del conditional_attributes[-1]

roughsets = RST(df)
konsistensi_data = roughsets.konsistensi_tabel(conditional_attributes, decision_attribute)

print("Konsistensi Data %f" % (konsistensi_data))

qr = QR(roughsets)
reducts = qr.reduct(decision_attributes, decision_attribute) 

print("Hasil reduksi atribut %s" % (reducts))

'''....'''

Maximum Dependency Attribute (MDA) (Herawan's Model)

import pandas as pd
from rst_tools.models.maximum_dependency_attributes import MDA


df = pd.read_csv("YOUR/FILE.csv")
conditional_attributes = list(df.column.values)
decision_attribute = conditional_attributes[-1]
del conditional_attributes[-1]

mda = MDA(df, attrs=attributes)
attributes, table = mda.run()

print(attributes) 

'''....'''

Variable Precision Rough Sets (Ziarko's Model)

import pandas as pd
from rst_tools.models.vprs import VariablePrecisionRoughSet
from rst_tools.models.reduct import reduct


df = pd.read_csv("YOUR/FILE.csv")
conditional_attributes = list(df.column.values)
decision_attribute = conditional_attributes[-1]
del conditional_attributes[-1]

rs = vprs(df, b) 
reducts, k, sup_attrs = reduct(rs, attributes, decision)

print("Konsistensi Data %f" % (k))
print("Atribut reduksi %s" % (reducts))

'''....'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rst-tools-0.1.7.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rst_tools-0.1.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file rst-tools-0.1.7.tar.gz.

File metadata

  • Download URL: rst-tools-0.1.7.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.7.13 Linux/4.19.128-microsoft-standard

File hashes

Hashes for rst-tools-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c9b739dd4ae51bdaf6a255d0e4d954f7ad1a11c230afdb525a2bd58c8f089c85
MD5 543fbdacead7b4cc72d73e69e86691ff
BLAKE2b-256 856ab75ddf5e6a81457bff0579c78273c375a9e8c740d33ef53d1909e9151ea4

See more details on using hashes here.

File details

Details for the file rst_tools-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: rst_tools-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.7.13 Linux/4.19.128-microsoft-standard

File hashes

Hashes for rst_tools-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 58c41cd484630cb433e98c198cf46330abc62d10b08387feac028430d65e2fff
MD5 f39144c5893c17c2cbd7714a295ca927
BLAKE2b-256 5f7e9e57b9bb534d234f287108f46a90e49abf29036f9b51a1f4c7a8f4a56ada

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page