- Notifications
You must be signed in to change notification settings - Fork2
Facilitate Exploration of touRR optimisatioN (ferrn)
License
Unknown, MIT licenses found
Licenses found
huizezhang-sherry/ferrn
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Theferrn package extracts key components from the data objectcollected during projection pursuit (PP) guided tour optimisation,produces diagnostic plots, and calculates PP index scores.
You can install the development version of ferrn fromGitHub with:
# install.packages("remotes")remotes::install_github("huizezhang-sherry/ferrn")
The data object collected during a PP optimisation can be obtained byassigning thetourr::annimate_xx() function a name. In the followingexample, the projection pursuit is finding the best projection basisthat can detect multi-modality for theboa5 dataset using theholes() index function and the optimisersearch_better:
set.seed(123456)holes_1d_better<- animate_dist(ferrn::boa5,tour_path= guided_tour(holes(),d=1,search_f=search_better),rescale=FALSE)holes_1d_better
The data structure includes thebasis sampled by the optimiser, theircorresponding index values (index_val), aninformation tagexplaining the optimisation states, and the optimisationmethod used(search_better). The variablestries andloop describe the numberof iterations and samples in the optimisation process, respectively. Thevariableid serves as the global identifier.
The best projection basis can be extracted via
library(ferrn)library(dplyr)holes_1d_better %>% get_best()#> # A tibble: 1 × 8#> basis index_val info method alpha tries loop id#> <list> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <int>#> 1 <dbl [5 × 1]> 0.914 interpolation search_better NA 5 6 55holes_1d_better %>% get_best() %>% pull(basis) %>%.[[1]]#> [,1]#> [1,] 0.005468276#> [2,] 0.990167039#> [3,] -0.054198426#> [4,] 0.088415793#> [5,] 0.093725721holes_1d_better %>% get_best() %>% pull(index_val)#> [1] 0.9136095
The trace plot can be used to view the optimisation progression:
holes_1d_better %>% explore_trace_interp()+ scale_color_continuous_botanical()
Different optimisers can be compared by plotting their projection baseson the reduced PCA space. Hereholes_1d_geo is the data obtained fromthe same PP problem asholes_1d_better introduced above, but with asearch_geodesic optimiser. The 5
bind_rows(holes_1d_geo,holes_1d_better) %>% bind_theoretical(matrix(c(0,1,0,0,0),nrow=5),index=tourr::holes(),raw_data=boa5) %>% explore_space_pca(group=method,details=TRUE)+ scale_color_discrete_botanical()#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.#> ℹ Please use `linewidth` instead.#> ℹ The deprecated feature was likely used in the ferrn package.#> Please report the issue at#> <https://github.com/huizezhang-sherry/ferrn/issues>.#> This warning is displayed once every 8 hours.#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was#> generated.
The same set of bases can be visualised in the original 5-D space viatour animation:
bind_rows(holes_1d_geo,holes_1d_better) %>% explore_space_tour(flip=TRUE,group=method,palette=botanical_palettes$fern[c(1,6)],max_frames=20,point_size=2,end_size=5)
About
Facilitate Exploration of touRR optimisatioN (ferrn)
Resources
License
Unknown, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.



