Using R to extract specific column in Azure ML -
i have created forecasting causal model in azure ml studio determines organization's hiring needs every month 2015. since causal model, individually forecast parameters 2015 , supply them model.
one such factor previous 9 months hire value. means if forecasting hire value jan-2015, previous 9 month hire values considered (dec - april 2014).
the following parameter set:
year month factor factor b factor c factor d prev. month-1 prev. month-2 prev. month-3 prev. month-4 prev. month-5 prev. month-6 prev. month-7 prev. month-8 prev. month-9
sample input:
year month factor factor b factor c factor d prev. month-1 prev. month-2 prev. month-3 prev. month-4 prev. month-5 prev. month-6 prev. month-7 prev. month-8 prev. month-9 2015 1 2 4 6 8 10 11 12 13 14 15 16 17 18
once run model, forecasted hire (score labels) output:
year month factor factor b factor c factor d prev. month-1 prev. month-2 prev. month-3 prev. month-4 prev. month-5 prev. month-6 prev. month-7 prev. month-8 prev. month-9 score labels 2015 1 2 4 6 8 10 11 12 13 14 15 16 17 18 19
for forecasting february-2015, forecasted value january becomes prev. month-1 value.
year month factor factor b factor c factor d prev. month-1 prev. month-2 prev. month-3 prev. month-4 prev. month-5 prev. month-6 prev. month-7 prev. month-8 prev. month-9 2015 1 2 4 6 8 10 11 12 13 14 15 16 17 18 2015 2 3 5 7 9 19 10 11 12 13 14 15 16 17
this becomes bit tedious have repeat 12 times - 1 each month. can suggest how solve using r script? here have written far:
dataset <- maml.mapinputport(1) previous <- 9 orig_names <- names(dataset) n_rows <- dim(dataset)[1] base <- 9 (i in 1:previous) { dataset[(i+1):n_rows,base+i] <- dataset[1:(n_rows-i),base] dataset[1:i,base+i] <- dataset[1:i,base+i-1] } <- -1:-previous new_names <- paste("prev. month",a) names(dataset) <- c(orig_names,new_names) maml.mapoutputport("dataset")
thanks.
update 1
i have managed execute model in loop in azure. each iteration, need provide input parameters (like february).
can me on how obtain forecast under "score labels" , append parameter under "prev. month-1" input next month in r?
Comments
Post a Comment