问题描述
HI全部,
我是Azure ML的新手,
i am new in Azure ML,
我在执行R脚本中建立一个线性回归,下面是代码
i build a Linear Regression in execute R Script below is code
#将基于1的可选输入端口映射到变量
dataset1< - maml.mapInputPort(1)#class:data.frame
set.seed(1)
row.number< - sample(1:nrow(dataset1),0.8 * nrow(dataset1))
train = dataset1 [row.number,]
test = dataset1 [-row.number,]
model1 = lm(log(price)〜。 ,data = train)
pred1< - predict(model1,newdata = test)
rmse< - sqrt(sum((exp(pred1) - test $ price )^ 2)/长度(测试$ price))
c(RMSE = rmse,R2 =摘要(model1)$ r.squared)
但是在部署Web服务之后 当我测试它的错误时
# Map 1-based optional input ports to variables
dataset1 <- maml.mapInputPort(1) # class: data.frame
set.seed(1)
row.number <- sample(1:nrow(dataset1), 0.8*nrow(dataset1))
train = dataset1[row.number,]
test = dataset1[-row.number,]
model1 = lm(log(price)~., data=train)
pred1 <- predict(model1, newdata = test)
rmse <- sqrt(sum((exp(pred1) - test$price)^2)/length(test$price))
c(RMSE = rmse, R2=summary(model1)$r.squared)
but after deploying Web service when i test it's error out
问候,
Manish
推荐答案
是的,可以使用Azure ML的"执行R脚本"模块构建模型。我相信你错过了输出语句,如下所示:
Yes, it is possible to build a model using Azure ML's 'Execute R Script' module. I believe you are missing the output statement as shown below:
https://docs.microsoft.com/en-us/azure / machine-learning / studio-module-reference / execute-r-script
#选择要发送到输出数据集的data.frame端口
maml.mapOutputPort( " data.set" );
你可以添加它并查看它是否有效吗?
Could you add this and see if it works?
问候,
Jaya
Regards,
Jaya
这篇关于可以在Azure ML中的执行R脚本中构建线性回归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!