Skip to contents

This function select features from the check result.

Usage

AUTO_VI$feature_pca(data = self$check_result$observed, pattern = "f_")

Arguments

data

Dataframe. A data frame where some columns represent features and rows represent observations.

pattern

Character. A regrex pattern to search for features. See also grep().

Value

A tibble where columns represent features and rows represent observations.

Details

By default, features are assumed to follow the naming convention "f_(index)", where index is from one to the number of features.

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$select_feature()
}
#>  Generate null data.
#>  Generate null plots.
#>  Compute auxilary inputs.
#>  Predict visual signal strength for 19 images.
#>  Predict visual signal strength for 1 image.
#> # A tibble: 1 × 256
#>     f_1   f_2   f_3   f_4   f_5    f_6   f_7    f_8   f_9   f_10  f_11   f_12
#>   <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>  <dbl> <dbl>  <dbl> <dbl>  <dbl>
#> 1 0.151     0     0     0     0 0.0203 0.109 0.0203     0 0.0834     0 0.0572
#> # ℹ 244 more variables: f_13 <dbl>, f_14 <dbl>, f_15 <dbl>, f_16 <dbl>,
#> #   f_17 <dbl>, f_18 <dbl>, f_19 <dbl>, f_20 <dbl>, f_21 <dbl>, f_22 <dbl>,
#> #   f_23 <dbl>, f_24 <dbl>, f_25 <dbl>, f_26 <dbl>, f_27 <dbl>, f_28 <dbl>,
#> #   f_29 <dbl>, f_30 <dbl>, f_31 <dbl>, f_32 <dbl>, f_33 <dbl>, f_34 <dbl>,
#> #   f_35 <dbl>, f_36 <dbl>, f_37 <dbl>, f_38 <dbl>, f_39 <dbl>, f_40 <dbl>,
#> #   f_41 <dbl>, f_42 <dbl>, f_43 <dbl>, f_44 <dbl>, f_45 <dbl>, f_46 <dbl>,
#> #   f_47 <dbl>, f_48 <dbl>, f_49 <dbl>, f_50 <dbl>, f_51 <dbl>, f_52 <dbl>, …