Skip to contents

Returns a guided tour with the LDA index to the python' backend. This guided tour is generated with the 'tourr' functions 'save_history' and 'guided_tour'.

Usage

get_guided_lda_history(data, clusters, dimension)

Arguments

data

the dataset to calculate the projections with

clusters

the clusters for the lda to be performed on

dimension

1 for a 1d tour or 2 for a 2d tour

Value

history object containing the projections of the requested tour

Examples

data("flea", package = "tourr")
clusters <- as.numeric(factor(flea[[7]]))
get_guided_lda_history(flea[-7], clusters, 2)
#> Converting input data to the required matrix format.
#> Target: 0.516, 92.4% better 
#> Target: 0.563, 9.2% better 
#> Target: 0.730, 29.7% better 
#> Target: 0.761, 4.2% better 
#> Target: 0.806, 5.9% better 
#> Target: 0.809, 0.4% better 
#> Target: 0.823, 1.7% better 
#> Target: 0.824, 0.2% better 
#> Target: 0.825, 0.1% better 
#> No better bases found after 25 tries.  Giving up.
#> Final projection: 
#>  0.066   0.446  
#>  0.198   0.114  
#>  0.523  -0.210  
#> -0.159   0.686  
#> -0.014   0.477  
#> -0.811  -0.213  
#> , , 1
#> 
#>             [,1]        [,2]
#> [1,]  0.17894166  0.78143455
#> [2,]  0.40984082 -0.41647972
#> [3,] -0.02005725  0.44097861
#> [4,] -0.30064419  0.11018420
#> [5,] -0.23767675 -0.06536826
#> [6,] -0.80791764 -0.07091532
#> 
#> , , 2
#> 
#>             [,1]         [,2]
#> [1,] -0.07286035  0.900767375
#> [2,]  0.36258774 -0.111528262
#> [3,]  0.33866666  0.298683252
#> [4,]  0.02309173  0.286129851
#> [5,]  0.08916250  0.070788688
#> [6,] -0.86025764  0.009304171
#> 
#> , , 3
#> 
#>             [,1]       [,2]
#> [1,] -0.09000268 0.86255970
#> [2,]  0.17891034 0.01806660
#> [3,]  0.49870884 0.31057886
#> [4,] -0.08959399 0.36627907
#> [5,]  0.03123864 0.14547114
#> [6,] -0.83796012 0.06231317
#> 
#> , , 4
#> 
#>              [,1]        [,2]
#> [1,] -0.058634409  0.76245503
#> [2,]  0.128042575  0.03566818
#> [3,]  0.385380059  0.07284372
#> [4,]  0.002853918  0.29729057
#> [5,] -0.060363999  0.56675359
#> [6,] -0.909943602 -0.04992574
#> 
#> , , 5
#> 
#>              [,1]        [,2]
#> [1,] -0.022787034  0.70138538
#> [2,]  0.090695035  0.18653571
#> [3,]  0.311637197 -0.06550537
#> [4,]  0.005644632  0.48942609
#> [5,] -0.107876978  0.47352436
#> [6,] -0.939397741 -0.07217208
#> 
#> , , 6
#> 
#>             [,1]        [,2]
#> [1,]  0.04088058  0.59841747
#> [2,]  0.18908511  0.09881285
#> [3,]  0.38242057 -0.16657523
#> [4,] -0.16801183  0.50147546
#> [5,] -0.02390121  0.57882120
#> [6,] -0.88742936 -0.13369226
#> 
#> , , 7
#> 
#>             [,1]       [,2]
#> [1,]  0.06547757  0.5764610
#> [2,]  0.21272110  0.1057338
#> [3,]  0.34932339 -0.1326855
#> [4,] -0.19560038  0.5237368
#> [5,] -0.03718449  0.5908638
#> [6,] -0.88814041 -0.1244479
#> 
#> , , 8
#> 
#>             [,1]       [,2]
#> [1,]  0.10320889  0.4919142
#> [2,]  0.26873401  0.1133965
#> [3,]  0.50414073 -0.1591343
#> [4,] -0.18128422  0.6742499
#> [5,] -0.03368887  0.4849169
#> [6,] -0.79307829 -0.1734379
#> 
#> , , 9
#> 
#>             [,1]       [,2]
#> [1,]  0.11576100  0.4867904
#> [2,]  0.24922567  0.1018384
#> [3,]  0.49943763 -0.1799415
#> [4,] -0.17815397  0.6686635
#> [5,] -0.05073398  0.4869608
#> [6,] -0.80045939 -0.1898509
#> 
#> , , 10
#> 
#>             [,1]       [,2]
#> [1,]  0.06639182  0.4459617
#> [2,]  0.19805545  0.1144445
#> [3,]  0.52255287 -0.2102935
#> [4,] -0.15884443  0.6859129
#> [5,] -0.01372029  0.4772492
#> [6,] -0.81110102 -0.2134338
#> 
#> , , 11
#> 
#>             [,1]       [,2]
#> [1,]  0.06639182  0.4459617
#> [2,]  0.19805545  0.1144445
#> [3,]  0.52255287 -0.2102935
#> [4,] -0.15884443  0.6859129
#> [5,] -0.01372029  0.4772492
#> [6,] -0.81110102 -0.2134338
#> 
#> attr(,"class")
#> [1] "history_array"