Hi,
I am trying to use linear model in Embedded R Scripts. In the Linear Model, we have to predict on a column which is dependent on 7 selected variables. The table has around 115335 records. I get an error when i fire the below select query saying 'RQuery Error: cannot allocate vector of size 838.6 Mb'.
Is there any limit on the number of records to be passed for prediction?
My script looks like below:
begin
sys.rqScriptDrop('OOS_LD_Prediction');
sys.rqScriptCreate('OOS_LD_Prediction',
'function(dat,datastore_name) {
mod <- lm(OOS_LOST_DOLLARS ~ DAY_OF_WEEK + STORE + PEP_BRAND + ITM_VELOCITY_CLUSTER + STR_VELOCITY_CLUSTER + OOS_REASON + DAYS_OF_SUPPLY, dat)
prd <- predict(mod, newdata=dat)
prd[as.integer(rownames(prd))] <- prd
res <- cbind(dat, PRED = prd)
}');
end;
/
select *
from table(rqTableEval(
cursor(select day_of_week, store, pep_brand, itm_velocity_cluster, str_velocity_cluster, oos_reason, days_of_supply, oos_lost_dollars
from oos_aggr_fact),
cursor(select 1 as "ore.connect", 'LP' as "datastore_name" from dual),
'select day_of_week, store, pep_brand, itm_velocity_cluster, str_velocity_cluster, oos_reason,days_of_supply, oos_lost_dollars, 1 PRED
from oos_aggr_fact',
'OOS_LD_Prediction' ));
Error generated:
ORA-20000:RQuery error
Error: cannot allocate vector of size 838.6 Mb
ORA-06512: at "RQSYS.RQTABLEEVALIMPL", line 112
ORA-06512: at "RQSYS.RQTABLEEVALIMPL", line 109
20000.00000 - "%s"
Can someone please help me with this?