Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

make DFTransformer inherit BaseEstimator #201

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

Qi-max
Copy link
Contributor

@Qi-max Qi-max commented Mar 27, 2019

Summary

Make DFTransformer inherit BaseEstimator

  • get_params and set_params can be used.
  • print(MatPipe()), as an example, can give somewhat better output (good for demo):

previously:

print(MatPipe())
<automatminer.pipeline.MatPipe object at 0x12a14cfd0> 

now:

print(MatPipe())
MatPipe(autofeaturizer=AutoFeaturizer(bandstructure_col=None, cache_src=None,
        composition_col='composition', do_precheck=True, dos_col='dos',
        drop_inputs=True, exclude=[],
        featurizers={'composition': [AtomicOrbitals(), ElementProperty(data_source=<matminer.utils.data.PymatgenData obj...er (INFO)>,
        multiindex=False, n_jobs=None, preset='best',
        structure_col='structure'),
      cleaner=DataCleaner(drop_na_targets=True, encode_categories=True, encoder='one-hot',
        feature_na_method='drop', logger=<Logger automatminer (INFO)>,
        max_na_frac=0.01, na_method_fit='drop', na_method_transform='fill'),
      learner=TPOTAdaptor(logger=<Logger automatminer (INFO)>),
      log_level=None, logger=<Logger automatminer (INFO)>,
      reducer=FeatureReducer(corr_threshold=0.95, keep_features=None,
        logger=<Logger automatminer (INFO)>, n_pca_features='auto',
        n_rebate_features=0.3, reducers=('pca',), remove_features=None,
        tree_importance_percentile=0.9))

@ardunn
Copy link
Contributor

ardunn commented Mar 27, 2019

Thanks @Qi-max seems like a good idea to me, though I will need to run full tests (commit CircleCI tests are not the full ones) with this before merging since it changes every single part of MatPipe (despite being only one line, I am not sure what could go wrong with such a fundamental change).

Also would you mind adding a quick few tests to make sure the BaseEstimator behavior for get_params and set_params is correct? These should run super fast cuz all you have to do is make a matpipe and get/swap out params and test against attributes to make sure the parameters are correct, you don't actually have to do any ML.

@ardunn ardunn merged commit 9484f0f into hackingmaterials:master Apr 1, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants