diff --git a/type_infer/api.py b/type_infer/api.py index cffcc4d..846541a 100644 --- a/type_infer/api.py +++ b/type_infer/api.py @@ -18,10 +18,22 @@ def infer_types( data : pd.DataFrame The input dataset for which we want to infer data type information. """ - if config is None or 'engine' not in config: + # Set global defaults if missing + if config is None: config = {'engine': 'rule_based', 'pct_invalid': 2, 'seed': 420, 'mp_cutoff': 1e4} + elif 'engine' not in config: + config['engine'] = 'rule_based' + + if 'pct_invalid' not in config: + config['pct_invalid'] = 2 + + if 'seed' not in config: + config['seed'] = 420 if config['engine'] == ENGINES.RULE_BASED: + if 'mp_cutoff' not in config: + config['mp_cutoff'] = 1e4 + engine = RuleBasedEngine(config) return engine.infer(data) else: