load_policy#
- scikitplot.feature_selection.load_policy(source, format=None)[source]#
Load a
FeaturePolicyfrom a file, a mapping or a policy.- Parameters:
- sourcestr, os.PathLike, mapping or FeaturePolicy
A path to a
.toml,.yaml/.ymlor.jsonfile, a mapping in config form, or a policy (returned unchanged).- formatstr or None, default=None
Explicit file format, else derived from the suffix.
- Returns:
- FeaturePolicy
The policy.
- Raises:
- PolicyError, IncompatibleSchemaError
If the document is off contract.
- Parameters:
- Return type:
Examples
>>> from scikitplot.feature_selection import load_policy >>> load_policy({"roles": {"target": ["y"]}}).roles_map["target"].columns ('y',)