I'm trying to retrieve feature names from a Keras model in a generalized way. I want to load a pretrained model and obtain its feature names, like this:
labels = model.get_feature_names()
I'm looking for something that works with any Keras model, ideally as a method that takes a black box Keras model and returns the feature names that the model operates on. For example, in SKlearn I can do this:
from sklearn.base import BaseEstimator
if isinstance(model, BaseEstimator):
return lambda m: {
'labels': m.feature_names_in_,
}
Is there a Keras/TensorFlow equivalent? Any insight is greatly appreciated.