Skip to main content

FCA basic algorithms

Project description

FCA algorithms

This is a module providing a set of commonly used algorithms in FCA, RCA, and some of its variants. Its general intention is to provide an easy to use API so that it's easier to create other programs using these algorithms. Since it's built with python, the overall performance is not expected to be outstanding. Having that said, the chosen algorithms have a somewhat low algorithmic temporal complexity.

CLI

FCA

Plot a hasse diagram from a context

fca_cli -c input.csv --show_hasse

The context is expected to be a csv with the following format

name attr1 attr2
obj1 x
obj2 x
obj3 x x
obj4

Output files

fca_cli -c input.csv --show_hasse --output_dir path/to/folder/ 

Will create two files, one representing the hasse graph, the other one with a concept for each line. The line is the index in the hasse graph.

RCA

To plot the hasse diagrams of the contexts 1 and 2 after applying RCA with exists

fca_cli -k context_1.csv context_2.csv -r relation_1_2.csv relation_2_1.csv --show_hasse

to specify operator

fca_cli -k context_1.csv context_2.csv -r relation_1_2.csv relation_2_1.csv --show_hasse -o forall

FCA utils

Module for FCA basics such as retrieving concepts, drawing a hasse diagram, etc

Getting formal concepts

from fca.api_models import Context

c = Context(O, A, I)
concepts = c.get_concepts(c)

Getting association rules

from fca.api_models import Context

c = Context(O, A, I)
c.get_association_rules(min_support=0.4, min_confidence=1)

Drawing hasse diagram

from fca.plot.plot import plot_from_hasse
from fca.api_models import Context


c = Context(O, A, I)
hasse_lattice, concepts = c.get_lattice(c)
plot_from_hasse(hasse_lattice, concepts)

TODO

  • Make algorithms to be able to work with streams (big files)

Contributors

  • Ramshell (Nicolas Leutwyler)

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

fca-algorithms-0.2.3.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

fca_algorithms-0.2.3-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file fca-algorithms-0.2.3.tar.gz.

File metadata

  • Download URL: fca-algorithms-0.2.3.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for fca-algorithms-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1a77b514d5e7f9eeae241319494f2df5d7f82105d3d526308b0b171eb8f8ecdb
MD5 ed3c80a3d73c95c649bdfc22c55a76fc
BLAKE2b-256 9be4e8554267a34c60e087ff3323c7a908d49679f890b305afdad5510efc61e1

See more details on using hashes here.

File details

Details for the file fca_algorithms-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fca_algorithms-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7747380d7cc0d596e95967bf8d2226b29effcc3ccae1b3f7e0ac9d60e26a6173
MD5 60b8c3644c430fa074a92c4aed864c90
BLAKE2b-256 0cd51aab5d574e686d9bff9bd41d20f6dbd765850bb77aaaeb26b091613ff681

See more details on using hashes here.

Supported by

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