actableai.data_imputation.error_detector package

Submodules

actableai.data_imputation.error_detector.base_error_detector module

class actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

Bases: abc.ABC

abstract detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
setup(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes)

actableai.data_imputation.error_detector.cell_erros module

class actableai.data_imputation.error_detector.cell_erros.CellError(column: str, index: int, error_type: actableai.data_imputation.error_detector.cell_erros.ErrorType)

Bases: object

property column
property error_type
property index
class actableai.data_imputation.error_detector.cell_erros.CellErrors(dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, errors: List[actableai.data_imputation.error_detector.cell_erros.CellError] = ())

Bases: object

append(error: actableai.data_imputation.error_detector.cell_erros.CellError)
property columns: Set[str]
extend(errors: actableai.data_imputation.error_detector.cell_erros.CellErrors)
class actableai.data_imputation.error_detector.cell_erros.CellInfo(column: str, index: int)

Bases: object

column: str
index: int
class actableai.data_imputation.error_detector.cell_erros.ColumnErrors(column_errors: Set[actableai.data_imputation.error_detector.cell_erros.CellError])

Bases: object

property column
class actableai.data_imputation.error_detector.cell_erros.ErrorCandidate(index: int, columns: actableai.data_imputation.error_detector.cell_erros.ErrorColumns)

Bases: object

columns: actableai.data_imputation.error_detector.cell_erros.ErrorColumns
index: int
property potential_columns: Set[str]
class actableai.data_imputation.error_detector.cell_erros.ErrorColumns(columns_from_when: Set[str], columns_from_then: Set[str])

Bases: object

columns_from_then: Set[str]
columns_from_when: Set[str]
class actableai.data_imputation.error_detector.cell_erros.ErrorType(value)

Bases: enum.Enum

An enumeration.

INVALID = 'INVALID'
MISPLACED = 'MISPLACED'
NULL = 'NULL'
TYPO = 'TYPO'

actableai.data_imputation.error_detector.column_format module

class actableai.data_imputation.error_detector.column_format.MatchNumRule(column: str, op: actableai.data_imputation.error_detector.match_condition.ConditionOp, match_val: Union[int, float])

Bases: actableai.data_imputation.error_detector.column_format._MatchRule

find_misplaced(series: pandas.core.series.Series) Iterator[int]
match_val: Union[int, float]
class actableai.data_imputation.error_detector.column_format.MatchRule(column: str, value: str, op: actableai.data_imputation.error_detector.match_condition.ConditionOp)

Bases: object

column: str
op: actableai.data_imputation.error_detector.match_condition.ConditionOp
classmethod parse(dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, condition_string: str) Union[actableai.data_imputation.error_detector.column_format.MatchStrRule, actableai.data_imputation.error_detector.column_format.MatchNumRule, NotImplementedType]
value: str
class actableai.data_imputation.error_detector.column_format.MatchRuleGroup(conditions: List[actableai.data_imputation.error_detector.column_format.MatchRule])

Bases: object

conditions: List[actableai.data_imputation.error_detector.column_format.MatchRule]
class actableai.data_imputation.error_detector.column_format.MatchRules(expect_formats: List[actableai.data_imputation.error_detector.column_format._MatchRule])

Bases: object

append(rule: actableai.data_imputation.error_detector.column_format._MatchRule)
classmethod parse(dtypes, condition_string: str) actableai.data_imputation.error_detector.column_format.MatchRules
class actableai.data_imputation.error_detector.column_format.MatchStrRule(column: str, op: actableai.data_imputation.error_detector.match_condition.ConditionOp, match_str: str, is_regex: bool)

Bases: actableai.data_imputation.error_detector.column_format._MatchRule

find_misplaced(series: pandas.core.series.Series) Iterator[int]
is_regex: bool
match_str: str
class actableai.data_imputation.error_detector.column_format.PresetRuleName(value)

Bases: enum.Enum

An enumeration.

SmartPercentage = 'SmartPercentage'
SmartTemperature = 'SmartTemperature'

actableai.data_imputation.error_detector.constraint module

class actableai.data_imputation.error_detector.constraint.Condition(col1: str, col2: str, condition: actableai.data_imputation.error_detector.match_condition.ConditionOp)

Bases: object

col1: str
col2: str
condition: actableai.data_imputation.error_detector.match_condition.ConditionOp
property mentioned_columns: Set[str]
classmethod parse(condition_string: str) actableai.data_imputation.error_detector.constraint.Condition
class actableai.data_imputation.error_detector.constraint.ConditionGroup(conditions: List[actableai.data_imputation.error_detector.constraint.Condition])

Bases: object

conditions: List[actableai.data_imputation.error_detector.constraint.Condition]
property mentioned_columns: Set[str]
classmethod parse(condition_string: str) actableai.data_imputation.error_detector.constraint.ConditionGroup
class actableai.data_imputation.error_detector.constraint.Constraint(when: actableai.data_imputation.error_detector.constraint.ConditionGroup, then: actableai.data_imputation.error_detector.constraint.ConditionGroup)

Bases: object

<when> condition match, then the data match <then> condition as invalid

property mentioned_columns: Set[str]
classmethod parse(constrain_string: str) actableai.data_imputation.error_detector.constraint.Constraint
then: actableai.data_imputation.error_detector.constraint.ConditionGroup
when: actableai.data_imputation.error_detector.constraint.ConditionGroup
class actableai.data_imputation.error_detector.constraint.Constraints(constraints: List[actableai.data_imputation.error_detector.constraint.Constraint])

Bases: object

constraints: List[actableai.data_imputation.error_detector.constraint.Constraint]
extends(constraints: actableai.data_imputation.error_detector.constraint.Constraints)
property mentioned_columns: Set[str]
classmethod parse(constraints_string: str) actableai.data_imputation.error_detector.constraint.Constraints

actableai.data_imputation.error_detector.error_detector module

class actableai.data_imputation.error_detector.error_detector.ErrorDetector

Bases: object

detect_error(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, expanded_df: pandas.core.frame.DataFrame, expanded_dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes) actableai.data_imputation.error_detector.cell_erros.CellErrors
property detectors
set_detectors(*detectors: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector)

actableai.data_imputation.error_detector.match_condition module

class actableai.data_imputation.error_detector.match_condition.ConditionOp(value)

Bases: enum.Enum

An enumeration.

EQ = '='
GT = '>'
GTE = '>='
IQ = '<>'
LT = '<'
LTE = '<='

actableai.data_imputation.error_detector.misplaced_detector module

class actableai.data_imputation.error_detector.misplaced_detector.MisplacedDetector(*, preset_rules: typing.List[actableai.data_imputation.error_detector.column_format.PresetRuleName] = (), customize_rules: actableai.data_imputation.error_detector.column_format.MatchRules = <actableai.data_imputation.error_detector.column_format.MatchRules object>)

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
property mentioned_columns: Set[str]
setup(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes)
update_df(df: pandas.core.frame.DataFrame)

actableai.data_imputation.error_detector.null_detector module

class actableai.data_imputation.error_detector.null_detector.NullDetector

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors

actableai.data_imputation.error_detector.rule_parser module

class actableai.data_imputation.error_detector.rule_parser.RulesBuilder(constraints: actableai.data_imputation.error_detector.constraint.Constraints, match_rules: actableai.data_imputation.error_detector.column_format.MatchRules)

Bases: object

property constraints
property match_rules
classmethod parse(dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, rules: actableai.data_imputation.error_detector.rule_parser.RulesRaw) actableai.data_imputation.error_detector.rule_parser.RulesBuilder
class actableai.data_imputation.error_detector.rule_parser.RulesRaw(validations: str, misplaced: str)

Bases: object

misplaced: str
validations: str

actableai.data_imputation.error_detector.smart_column_selector module

class actableai.data_imputation.error_detector.smart_column_selector.SmartErrorCellSelector

Bases: object

append_candidate(candidate: actableai.data_imputation.error_detector.cell_erros.ErrorCandidate)
find_actual_errors(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, focused_columns: Set[str]) Iterable[actableai.data_imputation.error_detector.cell_erros.CellError]
reset()

actableai.data_imputation.error_detector.validation_constraints_checker module

class actableai.data_imputation.error_detector.validation_constraints_checker.ValidationConstrainsChecker(constraints: actableai.data_imputation.error_detector.constraint.Constraints)

Bases: object

detect_most_possible_candidates(df: pandas.core.frame.DataFrame) List[actableai.data_imputation.error_detector.cell_erros.ErrorCandidate]
detect_typo_cells(df: pandas.core.frame.DataFrame) List[actableai.data_imputation.error_detector.cell_erros.CellError]
find_all_unmatched(df: pandas.core.frame.DataFrame) List[actableai.data_imputation.error_detector.cell_erros.ErrorCandidate]
property mentioned_columns: Set[str]

actableai.data_imputation.error_detector.validation_detector module

class actableai.data_imputation.error_detector.validation_detector.ValidationDetector(constraints: Optional[actableai.data_imputation.error_detector.constraint.Constraints] = NotImplemented)

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

property constraints
detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
classmethod from_constraints(constraints_string: str)
setup_constraints(constraints: actableai.data_imputation.error_detector.constraint.Constraints)

Module contents

class actableai.data_imputation.error_detector.CellErrors(dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, errors: List[actableai.data_imputation.error_detector.cell_erros.CellError] = ())

Bases: object

append(error: actableai.data_imputation.error_detector.cell_erros.CellError)
property columns: Set[str]
extend(errors: actableai.data_imputation.error_detector.cell_erros.CellErrors)
class actableai.data_imputation.error_detector.ColumnErrors(column_errors: Set[actableai.data_imputation.error_detector.cell_erros.CellError])

Bases: object

property column
class actableai.data_imputation.error_detector.ConditionOp(value)

Bases: enum.Enum

An enumeration.

EQ = '='
GT = '>'
GTE = '>='
IQ = '<>'
LT = '<'
LTE = '<='
class actableai.data_imputation.error_detector.ErrorDetector

Bases: object

detect_error(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, expanded_df: pandas.core.frame.DataFrame, expanded_dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes) actableai.data_imputation.error_detector.cell_erros.CellErrors
property detectors
set_detectors(*detectors: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector)
class actableai.data_imputation.error_detector.MatchNumRule(column: str, op: actableai.data_imputation.error_detector.match_condition.ConditionOp, match_val: Union[int, float])

Bases: actableai.data_imputation.error_detector.column_format._MatchRule

column: str
find_misplaced(series: pandas.core.series.Series) Iterator[int]
match_val: Union[int, float]
op: actableai.data_imputation.error_detector.match_condition.ConditionOp
class actableai.data_imputation.error_detector.MatchRules(expect_formats: List[actableai.data_imputation.error_detector.column_format._MatchRule])

Bases: object

append(rule: actableai.data_imputation.error_detector.column_format._MatchRule)
classmethod parse(dtypes, condition_string: str) actableai.data_imputation.error_detector.column_format.MatchRules
class actableai.data_imputation.error_detector.MatchStrRule(column: str, op: actableai.data_imputation.error_detector.match_condition.ConditionOp, match_str: str, is_regex: bool)

Bases: actableai.data_imputation.error_detector.column_format._MatchRule

column: str
find_misplaced(series: pandas.core.series.Series) Iterator[int]
is_regex: bool
match_str: str
op: actableai.data_imputation.error_detector.match_condition.ConditionOp
class actableai.data_imputation.error_detector.MisplacedDetector(*, preset_rules: typing.List[actableai.data_imputation.error_detector.column_format.PresetRuleName] = (), customize_rules: actableai.data_imputation.error_detector.column_format.MatchRules = <actableai.data_imputation.error_detector.column_format.MatchRules object>)

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
property mentioned_columns: Set[str]
setup(df: pandas.core.frame.DataFrame, dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes)
update_df(df: pandas.core.frame.DataFrame)
class actableai.data_imputation.error_detector.NullDetector

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
class actableai.data_imputation.error_detector.PresetRuleName(value)

Bases: enum.Enum

An enumeration.

SmartPercentage = 'SmartPercentage'
SmartTemperature = 'SmartTemperature'
class actableai.data_imputation.error_detector.RulesBuilder(constraints: actableai.data_imputation.error_detector.constraint.Constraints, match_rules: actableai.data_imputation.error_detector.column_format.MatchRules)

Bases: object

property constraints
property match_rules
classmethod parse(dftypes: actableai.data_imputation.type_recon.type_detector.DfTypes, rules: actableai.data_imputation.error_detector.rule_parser.RulesRaw) actableai.data_imputation.error_detector.rule_parser.RulesBuilder
class actableai.data_imputation.error_detector.ValidationDetector(constraints: Optional[actableai.data_imputation.error_detector.constraint.Constraints] = NotImplemented)

Bases: actableai.data_imputation.error_detector.base_error_detector.BaseErrorDetector

property constraints
detect_cells() actableai.data_imputation.error_detector.cell_erros.CellErrors
classmethod from_constraints(constraints_string: str)
setup_constraints(constraints: actableai.data_imputation.error_detector.constraint.Constraints)