library(reticulate) os <- import("os") sy <- import("sys") np <- import("numpy") pd <- import("pandas") sk <- import("sklearn.decomposition")
We'll use R to do the I/O here.
df = read.csv(system.file( "csv/c1000p.csv.gz", package="useret")) class(df) head(df[,1:5]) mat = data.matrix(df[,-1])
numdata = r_to_py(mat) class(numdata) numdata$shape ipca = sk$IncrementalPCA(numdata) dim(ipca$n_components)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.