jaclearn.logic.propositional.logic_induction package¶
-
jaclearn.logic.propositional.logic_induction.search(inputs: numpy.ndarray, outputs: numpy.ndarray, input_names: List[str], type: Union[str, logic_induction.LogicFormTypePy, None] = 'GENERAL', output_format: Union[str, logic_induction.LogicFormOutputFormatPy, None] = 'DEFAULT', depth: Optional[int] = 4, coverage: Optional[float] = 0.99) → List[str][source]¶ Search for logic forms inductively.
Example
import numpy as np from jaclearn.logic.propositional.logic_induction import search inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype='uint8') outputs = np.array([[0], [1], [1], [0]], dtype='uint8') input_names = ['x', 'y'] print(search(inputs, outputs, input_names)) # ['((x OR y) AND (NOT x OR NOT y))']
Parameters: - inputs – the input data, with shape (N, D).
- outputs – the output data, with shape (N, C).
- input_names – the names of the input variables, a list of length D.
- type – the type of the logic form (options are ‘GENERAL’, ‘CONJUNCTION’, ‘DISJUNCTION’).
- output_format – the output format of the logic form (options are ‘DEFAULT’, ‘LISP’).
- depth – the maximum depth of the logic form.
- coverage – the minimum coverage of the logic form.
Returns: a list of strings, of length C.