rics.mapping.support#
Functions and classes used by the Mapper for handling score matrices.
Warning
This module is considered an implementation detail, and may change without notice.
Functions
Temporarily enable verbose DEBUG-level logger messages. |
Classes
|
High-level selection operations. |
- enable_verbose_debug_messages() Generator[None, None, None][source]#
Temporarily enable verbose DEBUG-level logger messages.
Returns a context manager. Calling the function without the
withstatement does nothing.>>> from rics.mapping import Mapper, support >>> with support.enable_verbose_debug_messages(): ... Mapper().apply('ab', candidates='abc')
- class MatchScores(scores: DataFrame, min_score: float)[source]#
Bases:
objectHigh-level selection operations.
- Parameters:
scores – A score matrix, where
scores.indexare values andscore.columnsare treated as the candidates.min_score – Minimum score to consider make a value -> candidate match.
- to_directional_mapping(cardinality: Optional[Cardinality] = None) DirectionalMapping[ValueType, CandidateType][source]#
Create a
DirectionalMappingwith a given targetCardinality.- Parameters:
cardinality – Explicit cardinality to set, see
cardinality. IfNone, use the actual cardinality when selecting all matches with scoresabovethe minimum.- Returns:
A
DirectionalMapping.
- above() List[Record[ValueType, CandidateType]][source]#
Get all records with scores above the threshold.
- below() List[Record[ValueType, CandidateType]][source]#
Get all records with scores below the threshold.
- class Record(value: ValueType, candidate: CandidateType, score: float)[source]#
Bases:
Generic[ValueType,CandidateType]Data concerning a match.
- candidate: CandidateType#
A hashable candidate.
- class Reject(record: Record[ValueType, CandidateType], superseding_value: Optional[Record[ValueType, CandidateType]] = None, superseding_candidate: Optional[Record[ValueType, CandidateType]] = None)[source]#
Bases:
Generic[ValueType,CandidateType]Data concerning the rejection of a match.
- record: Record[ValueType, CandidateType]#
- superseding_value: Optional[Record[ValueType, CandidateType]] = None#
- superseding_candidate: Optional[Record[ValueType, CandidateType]] = None#