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


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.6.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.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rst-tools-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 22ec6828d59b2f22fb74f913f0446eae012f776e34bbf2d1181a1d93bc2bd450
MD5 f0e3f6657cc5a218ba8a3c7ca06be694
BLAKE2b-256 5297a29a30b1da77b8acf4fe92e563d3060010ca412352ede5ce461bdea7edd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rst_tools-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a4b4e0f143a1b82cc49399e6b830d6b5d9f81e6fa1c6d3169a789e935f3756db
MD5 6daa14c6a17e1ea27362a3ae72ba1ea9
BLAKE2b-256 86b94146d77dc409ad4088adcbd98d2245db59bf66e4b3e3527b4e2f6ddb1d1b

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