What is the best way to deploy a machine learning script written in R (ie. linear regression, random forest, k-means, etc.) to PowerBI?
Here is what I am currently thinking: My response column is column_x. My training set will be all rows in my dataset where I have a value for column_x. My test set will be all rows where I do not have a value for column_x (hence needing a predicted value from the ML script). I will put the output of the ML script in a new column in PowerBI (using edit queries option) for predicted response called pred_column_x. Not really sure how to go about this.
Modification/filling in of the sample script below or an alternative solution to how this could be mapped out would be super helpful!
Thank you!
data.df <- dataset in PowerBI
train.df <- dataset where column_x is not null??
test.df <- dataset where column_x is null??
#linear regression fit
fit <- lm(pred_column_x ~ column_a + column_b, data=train.df)
#need this fit/predicted value to go in pred_column_x
summary(fit)