-
-
Notifications
You must be signed in to change notification settings - Fork 161
-
Is there any way to obtain the feature vector that the model extracts during the process of making a prediction with given data?
Beta Was this translation helpful? Give feedback.
All reactions
You can extract feature vectors from a model in PyTorch Tabular using the DeepFeatureExtractor. Here's how you can do it:
# Pass the trained model as an argument dt = DeepFeatureExtractor(tabular_model) # Use the train dataframe to extract the last layer features # The `fit` method is there only for compatibility and does not perform any operation enc_df = dt.fit_transform(train) # Use the extracted embeddings on a new dataframe val_transformed = dt.transform(val)
This example demonstrates how to use the DeepFeatureExtractor to obtain feature vectors from a trained model [1] .
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer ...
Replies: 1 comment
-
You can extract feature vectors from a model in PyTorch Tabular using the DeepFeatureExtractor. Here's how you can do it:
# Pass the trained model as an argument dt = DeepFeatureExtractor(tabular_model) # Use the train dataframe to extract the last layer features # The `fit` method is there only for compatibility and does not perform any operation enc_df = dt.fit_transform(train) # Use the extracted embeddings on a new dataframe val_transformed = dt.transform(val)
This example demonstrates how to use the DeepFeatureExtractor to obtain feature vectors from a trained model [1] .
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
Beta Was this translation helpful? Give feedback.