AUTO_VI$feature_pca {autovi} | R Documentation |
Conduct principal component analysis for features extracted from keras model
Description
This function conducts principal component analysis for features extracted from keras model.
Usage
AUTO_VI$feature_pca( feature = self$check_result$observed, null_feature = self$check_result$null, boot_feature = self$check_result$boot, center = TRUE, scale = TRUE, pattern = "^f_.*$" )
Arguments
feature |
Dataframe. A data frame where columns represent features and rows represent observations. It should have only one row. |
null_feature |
Dataframe. A data frame where columns represent features and rows represent observations. These features are extracted during the evaluation of null plots. |
boot_feature |
Dataframe. A data frame where columns represent features and rows represent observations. These features are extracted during the evaluation of bootstrapped plots. |
center |
Boolean. Whether to subtract the mean from the feature. |
scale |
Boolean. Whether to divide the feature by its standard deviation. |
pattern |
Character. A regrex pattern to search for features in the
provided DataFrame. See also |
Details
Features need to be extracted while running the method
AUTO_VI$check()
and AUTO_VI$lineup_check()
by providing the argument
extract_feature_from_layer
. Features with zero variance will be ignored
from the analysis. See also stats::prcomp()
. By default, features are
assumed to follow the naming convention
"f_(index)", where index is from one to the number of features.
Value
A tibble of the raw features and the rotated features with
attributes sdev
and rotation
representing the
standard deviation of the principal
components and the rotation matrix respectively.
Examples
keras_model <- try(get_keras_model("vss_phn_32"))
if (!inherits(keras_model, "try-error")) {
myvi <- auto_vi(lm(dist ~ speed, data = cars), keras_model)
myvi$lineup_check(extract_feature_from_layer = "global_max_pooling2d")
myvi$feature_pca()
}