fcapy.mvcontext.pattern_structure

This module contains classes of basic Pattern Structures which allow FCA to work with data of any complex description

Classes

AbstractPS(data[, name])

An abstract class to provide an interface for any Pattern Structure (PS)

IntervalPS(data[, name])

An class to work with Interval Pattern Structures from FCA theory

class fcapy.mvcontext.pattern_structure.AbstractPS(data, name=None)

An abstract class to provide an interface for any Pattern Structure (PS)

Notes

A pattern structure D is any kind of description of the set of objects G for which we can define two functions:

  1. Given description d \subseteq D we can select a subset of objects A = d’ which share this description

  2. Given a subset of objects A \subseteq G we can determine their common description d = A’

property data

The data for PatternStructure to work with

description_to_generators(description, projection_num)

Convert a closed description into a set of generators of this closed description (Optional)

extension_i(description, base_objects_i=None)

Select a subset of objects of base_objects_i which share description

generators_by_intent_difference(new_intent, old_intent)

Compute the set of generators to select the new_intent from old_intent

generators_to_description(generators)

Combine a set of generators into one closed description (Optional)

intention_i(object_indexes)

Select a common description of objects object_indexes

property name

The distinct name of a PatternStructure

to_numeric()

Convert the complex data of the PatternStructure to a set of numeric columns

class fcapy.mvcontext.pattern_structure.IntervalPS(data, name=None)

An class to work with Interval Pattern Structures from FCA theory

Notes

An Interval Pattern Structure describes any object g with a closed interval g’ = [g_{min}, g_{max}] Thus:

  1. Given an interval [a, b] we can select objects A which description falls into an interval [a,b]:

    A = {g in G | a <= g_{min} & g_{max} <= b }

  2. Given a set of objects A subseteq G we can determine their common description [a, b]:

    a = min({g_{min} | g in A}) b = max({g_{max} | g in A})

If object description is defined by a single number x we turn it into an interval [x, x]

property data

The data for IntervalPS to work with (list of tuple representing the intervals)

description_to_generators(description, projection_num)

Convert the closed interval of description into a set of more broader intervals that generate it

For example, an interval (-inf, 10] can describe the same set of objects as a closed interval [0, 10]. Thus we say that an interval (-int, 10] is a generator of a closed description [0,10].

The projections of IntervalPS are considered as following:

Projection 0: an interval (-inf, inf) Projection 1: an interval (-inf, x] or [x, inf), where x is a real number Projection 2: a closed interval [a, b], where a,b are real numbers

Parameters
  • description (tuple of float) – A closed description to turn into generators

  • projection_num (int) – An index of IntervalPS projection for generators to belong to

Returns

generators – A list of generators of a closed description

Return type

list of tuple

extension_i(description, base_objects_i=None)

Select a set of indexes of objects from base_objects_i which fall into interval of description

generators_by_intent_difference(new_intent, old_intent)

Compute the set of generators to select the new_intent from old_intent

generators_to_description(generators)

Combine a set of generators into a single closed description

intention_i(object_indexes)

Select a common interval description for all objects from object_indexes

property name

The distinct name of a PatternStructure

to_numeric()

Turn IntervalPS data into a set of numeric columns and their names