Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in k-means and PCA when one time index is specified #5

Open
markromanmiller opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@markromanmiller
Copy link

I'm trying to calculate k-means and PCA from a distribution of rotation data without time series information. However, what I expected would work (constructing a qts_sample series where each sample is one point long, and specifying no time-warping for kmeans) instead led to errors. Is there some other approach I should take, or am I misunderstanding what is necessary to complete k-means/PCA/distance matrix in rotation space?

If helpful, here's a reprex:

library(squat)
# works
working_sample <- as_qts_sample(lapply(vespa64$igp[1:20], function(m) {m[1:10,]}))
kmeans(working_sample, 2, warping_class="none")

# does not work
failing_sample <- as_qts_sample(lapply(vespa64$igp[1:20], function(m) {m[1,]}))
kmeans(failing_sample, 2, warping_class="none")
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 23.10

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.11.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.11.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Chicago
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] squat_0.3.0

loaded via a namespace (and not attached):
 [1] utf8_1.2.4        generics_0.1.3    tidyr_1.3.0       stringi_1.8.2     digest_0.6.33     magrittr_2.0.3   
 [7] grid_4.3.1        evaluate_0.23     timechange_0.2.0  pkgload_1.3.3     fastmap_1.1.1     processx_3.8.2   
[13] pkgbuild_1.4.2    sessioninfo_1.2.2 urlchecker_1.0.1  ps_1.7.5          promises_1.2.1    purrr_1.0.2      
[19] fansi_1.0.6       scales_1.3.0      cli_3.6.2         shiny_1.8.0       rlang_1.1.3       crayon_1.5.2     
[25] munsell_0.5.0     ellipsis_0.3.2    yaml_2.3.7        remotes_2.4.2.1   cachem_1.0.8      devtools_2.4.5   
[31] tools_4.3.1       memoise_2.0.1     dplyr_1.1.4       colorspace_2.1-0  ggplot2_3.5.0     httpuv_1.6.12    
[37] vctrs_0.6.5       R6_2.5.1          mime_0.12         lifecycle_1.0.4   lubridate_1.9.3   stringr_1.5.1    
[43] fs_1.6.3          htmlwidgets_1.6.3 usethis_2.2.2     miniUI_0.1.1.1    pkgconfig_2.0.3   callr_3.7.3      
[49] gtable_0.3.4      pillar_1.9.0      later_1.3.1       glue_1.7.0        profvis_0.3.8     Rcpp_1.0.11      
[55] xfun_0.41         tibble_3.2.1      tidyselect_1.2.0  knitr_1.45        rstudioapi_0.15.0 xtable_1.8-4     
[61] htmltools_0.5.7   rmarkdown_2.25    compiler_4.3.1    prettyunits_1.2.0

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant