Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

use featurizer name in feature name of all featurizers #431

Open
kjappelbaum opened this issue Dec 30, 2022 · 4 comments
Open

use featurizer name in feature name of all featurizers #431

kjappelbaum opened this issue Dec 30, 2022 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kjappelbaum
Copy link
Owner

No description provided.

@kjappelbaum kjappelbaum added enhancement New feature or request good first issue Good for newcomers labels Dec 30, 2022
@maddy020
Copy link

maddy020 commented Jan 1, 2023

Hey @kjappelbaum
Please elaborate the issue , Which file needs a change ?
I would like to contribute over this issue

@kjappelbaum
Copy link
Owner Author

Hey @maddy020, thanks so much for your interest in this issue and thanks for asking for more details.

In all featurizers, we use a class with the following structure

class MyFeaturizer(MOFBaseFeaturizer): 
     def _featurize(self, structure): 
           ...

     def featurize(self, mof):
         ... 

     def feature_labels(self):
         ...

where MyFeaturizer().feature_labels() returns a list of str with the names for the elements of the array that MyFeaturizer().featurize() produces.

Currently, all names start with some string I hard-coded by hand, e.g. "APRDF". However, it would be more useful if it were the class name or something else that can be programmatically inspected.

The simplest improvement might be to include the class name (__name__) as the prefix for all the feature names, e.g.

class MyFeaturizer(MOFBaseFeaturizer): 
     def _featurize(self, structure): 
           ...

     def featurize(self, mof):
         ... 

     def feature_labels(self):
         return [f"{self.__name__}_{a}" for a in oldnames]

@dhruvthakur2000
Copy link

dhruvthakur2000 commented Oct 6, 2023

hi @kjappelbaum do you mean the result should be in this form f"{class_name}_{name}"

@kjappelbaum
Copy link
Owner Author

yep, that would make sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants