Refactored featurization into new module with presets #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves all featurization out of the
preprocessing
module and into a newfeaturization
module, which includes a classMODFeaturizer
and a presetDeBreuck2020Featurizer
that replicates the existing featurization process.An optional
featurizer
argument is added toMODData
to specify the preset, either by passing an object, or by passing a string, that is looked up in thefeaturizers.presets.FEATURIZER_PRESETS
dictionary, e.g.DeBreuck2020
. The base class contains the generic parts of thefeaturizer_composition(...)
,featurize_structure(...)
andfeaturize_site(...)
functions, and the preset overrides them to perform post-processing.Most of the work in the
DeBreuck2020Featurizer
preset was to ensure backwards-compatibility of column names etc. For new featurizers, it should just be a case of providing the list ofBaseFeaturizer
objects (assuming column names work nicely).Still to consider (maybe outside the scope of this PR):
AllMatminer
preset, which uses every feature, and aQuickMatminer
preset which uses "fast" features only?MODFeaturizer
class also contain methods for tracking metadata of the featurizers that were used?