:py:mod:`fca.base_models` ========================= .. py:module:: fca.base_models .. autoapi-nested-parse:: Base representation of the basic classes of FCA Ideally, with the exception of :class:`Concept`, these classes are only internal, and it should not be necessary to use them. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: fca.base_models.Context fca.base_models.Concept .. py:class:: Context(O, A, I: List[List[int]]) Base representation of a formal context .. py:method:: __init__(O, A, I: List[List[int]]) :param O: a list of objects. `len(O) = n` :type O: List[str] :param A: a list of attributes. `len(A) = m` :type A: List[str] :param I: a `n m` incidence matrix, beign `I[i][j] = 1` if object `i` has the attribute `j`, `0 <= i <= n`, `0 <= j <= m` :type I: List[List[int]] .. py:method:: derivative(Y, is_attr: bool = True) :param Y: A subset indices of `self.A` or `self.O` :type Y: List[int] :param is_attr: Whether `Y \subseteq A` or `Y \subseteq O` :type is_attr: bool .. py:class:: Concept(context: Context, O, A, parents=None, children=None) Base representation of a formal concept .. py:property:: X .. py:property:: Y .. py:method:: __init__(context: Context, O, A, parents=None, children=None) .. py:method:: in_extent(o: int) -> bool Whether the object o is in its extent .. py:method:: add_child(concept) .. py:method:: remove_child(concept) .. py:method:: to_tuple() :returns: A tuple consisting of `(obj, attr)` where obj and attr are the lists of corresponding strings .. py:method:: hr_O() :returns: The list of the corresponding object strings .. py:method:: hr_A() :returns: The list of the corresponding attribute strings