I am trying to understand how to use reticulate for pyts. The package loads and runs fine but I can't seem to find how to insert the time-series into python chunk. I get the following result NameError: name 'x' is not defined. I also dont know how to extract X_gasf and X_gadf into R.
require(reticulate); require(tibble)
pyts<- reticulate::import("pyts", convert = TRUE)
pytsImage<-reticulate::import("pyts.image", convert = TRUE)
x <- tibble(values = sin(-10:6))
repl_python()
from pyts.image import GramianAngularField
from sklearn.pipeline import make_pipeline
gasf = GramianAngularField(image_size=17, method='summation')
X_gasf = gasf.fit_transform(x)
gadf = GramianAngularField(image_size=17, method='difference')
X_gadf = gadf.fit_transform(x)
exit
py$X_gasf
py$X_gadf