Quantcast
Channel: SCN : All Content - SAP BusinessObjects Predictive Analytics
Viewing all articles
Browse latest Browse all 836

R custom component using 'recommenderlab' library returns a general error, works in R - why?

$
0
0

I am trying to run 'recommenderlab' library of R with SAP PA custom component.

I have tested it in many ways - it is a new library, so I thought that maybe it is not keen on those, that haven't been included in the default installation. I found a place, where SAP PA configures stuff what to include in the installation of R and reinstalled but to no avail.


Then I tried another library - seriation - that that had not been included, but this worked, even without being included in SAP PA installation script (I had seriation previously in my local R installation, though). Whereas the recommenderlab library, once I give the first command:  q<-as(mydata, "realRatingMatrix”): which coerces the original SAP data to a realRatingMatrix form with the help of the package, just gives an error.


The SAP PA error message, once I add the row is a general one:

Error, could not find function MyMain.


In the SAP PA logs, I get a more detailed error message:

Error during processing response.: boolean is not a function


The script works fine in my R installation and thus I don't know what to do next?


The script:


mymain <-function(mydata, howmany)

{

howmany<-as.numeric(howmany)

library(recommenderlab)

 

q<-as(mydata, "realRatingMatrix”)

r<- Recommender(q, method = "POPULAR")

recom <- predict(r, q, n = howmany)

l<-as(recom,"list")

res<-cbind(rep(seq_along(l), times=sapply(l, length)), unlist(l))

output <- as.data.frame(res)

 

return(list(out=output))

}




Inline image 1

 

 





Inline image 2

 

 


 

log file location

C:\Users\JaanU_000\AppData\Local\Temp\sapvi\logs

 

installation script location

C:\Program Files\SAP Predictive  Analysis\Desktop\plugins\com.sap.pa.runtime.config_1.20.0.201410080051-36\resources\R64


The csv data that I am passing to the custom component as mydata

useridproductidrating
112.5
123.5
133
143.5
152.5
163
213
223.5
231.5
245
263
253.5
312.5
323
343.5
364
423.5
433
464.5
444
452.5
513
524
532
543
563
552
613
624
663
645
653.5
724.5
751
744



Viewing all articles
Browse latest Browse all 836

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>