Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9052

Re: How to apply Custom R component at the HANA Database Backend

$
0
0

Hi Ranajay,

You need to create a scoring function within the custom component.


In the windows where you entered your prediction function, you need to activate the tick box "Option to save the model". Then add a function that applies the trained mode.

 

Below is an example taken from the following offline component. The concept is just the same for a HANA online connection
http://scn.sap.com/docs/DOC-45589

 

Just bear in mind, that when you are connected to HANA online, you will not see components that were created for offline use.

 

More info is in the user guide, chapter "Custom R Component"

http://help.sap.com/businessobject/product_guides/pa22/en/pa22_expert_user_en.pdf


mypredict<-function(mynewdata, mytrainedmodel)
{
## Carry out the prediction on previously unseen data.
## The column names have to match the column names of the mytrainedmodel.
myprediction <- predict(mytrainedmodel, newdata=mynewdata)

## Return the input data as output together with the predicted values.
output <- cbind(mynewdata, myprediction)
return(list(out=output))
}


Viewing all articles
Browse latest Browse all 9052

Trending Articles



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