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.780, 39.6% better 
#> Target: 0.800, 2.6% better 
#> Target: 0.815, 1.9% better 
#> Target: 0.817, 0.2% better 
#> Target: 0.820, 0.4% better 
#> Target: 0.823, 0.4% better 
#> Target: 0.824, 0.1% better 
#> No better bases found after 25 tries.  Giving up.
#> Final projection: 
#> -0.370  -0.098  
#> -0.155   0.339  
#>  0.258   0.589  
#> -0.700  -0.082  
#> -0.530   0.325  
#> -0.032   0.645  
#> , , 1
#> 
#>             [,1]       [,2]
#> [1,] -0.24448600  0.4193939
#> [2,] -0.08548461  0.4547212
#> [3,]  0.18270168  0.2329241
#> [4,] -0.91342071 -0.1309800
#> [5,] -0.25319139  0.1759272
#> [6,]  0.03310302  0.7176194
#> 
#> , , 2
#> 
#>             [,1]        [,2]
#> [1,] -0.13240534 -0.14844341
#> [2,] -0.12233332  0.47059907
#> [3,]  0.03202231  0.45140901
#> [4,] -0.78769562  0.04195315
#> [5,] -0.55989911  0.13423217
#> [6,]  0.18035119  0.73003605
#> 
#> , , 3
#> 
#>             [,1]        [,2]
#> [1,] -0.12687644 -0.14193485
#> [2,] -0.06683968  0.26660901
#> [3,]  0.17644091  0.50822163
#> [4,] -0.73673865 -0.02061915
#> [5,] -0.63181805  0.26224037
#> [6,]  0.07953330  0.76242360
#> 
#> , , 4
#> 
#>             [,1]        [,2]
#> [1,] -0.24218684 -0.10667013
#> [2,] -0.15561247  0.27181595
#> [3,]  0.22137439  0.53963291
#> [4,] -0.67658923 -0.05327823
#> [5,] -0.63719828  0.29369891
#> [6,]  0.06579551  0.73105149
#> 
#> , , 5
#> 
#>             [,1]        [,2]
#> [1,] -0.25473763 -0.13455213
#> [2,] -0.13091599  0.27264048
#> [3,]  0.26470317  0.57598332
#> [4,] -0.65506172 -0.03577491
#> [5,] -0.64663549  0.29749950
#> [6,]  0.02566423  0.69715157
#> 
#> , , 6
#> 
#>             [,1]        [,2]
#> [1,] -0.31475412 -0.08500920
#> [2,] -0.15098240  0.33424327
#> [3,]  0.31801037  0.61475846
#> [4,] -0.64941130 -0.06203877
#> [5,] -0.59426273  0.30758814
#> [6,] -0.04604718  0.63613492
#> 
#> , , 7
#> 
#>             [,1]        [,2]
#> [1,] -0.36932978 -0.08435002
#> [2,] -0.14977167  0.30606312
#> [3,]  0.26637669  0.60332768
#> [4,] -0.67456723 -0.07390135
#> [5,] -0.56088504  0.32132200
#> [6,] -0.02396773  0.65306731
#> 
#> , , 8
#> 
#>             [,1]        [,2]
#> [1,] -0.37048429 -0.09753746
#> [2,] -0.15489084  0.33898415
#> [3,]  0.25785754  0.58878365
#> [4,] -0.70044423 -0.08214453
#> [5,] -0.52970598  0.32486589
#> [6,] -0.03239082  0.64546451
#> 
#> , , 9
#> 
#>             [,1]        [,2]
#> [1,] -0.37048429 -0.09753746
#> [2,] -0.15489084  0.33898415
#> [3,]  0.25785754  0.58878365
#> [4,] -0.70044423 -0.08214453
#> [5,] -0.52970598  0.32486589
#> [6,] -0.03239082  0.64546451
#> 
#> attr(,"class")
#> [1] "history_array"