matlab - Statistic Matlab determine origin from given specifications
问题描述
I am trying to solve this problem: Use the model trained in a) to find the country of origin of a car with 4 cylinders, 1498 cc, 130 HP and a consumption of 0.6 MPG.
I have written in Matlab this trained model with the data set of carsmall in Matlab:
How I can find the origin of the car with the mentioned specifications? I have tried something like this, but there i get en error:
Error using classreg.learning.regr.FullRegressionModel.prepareData (line 237)
Invalid data type. Response must be a double or single vector.
Error in classreg.learning.FitTemplate/fit (line 218)
this.PrepareData(X,Y,this.BaseFitObjectArgs{:});
Error in fitensemble (line 364)
obj = fit(temp,X,Y);
Error in neu (line 4)
Mdl1 = fitensemble(Tbl,'Origin','LSBoost',100,t);
Tbl = table(Cylinders,Displacement,Horsepower,MPG,Origin);
t = templateTree('Surrogate','On');
Mdl1 = fitensemble(Tbl,'Origin','LSBoost',100,t);
predMPG = predict(Mdl1,[4 1498 130 0.6])
Perhabs someone can give me a tip.
解决方案
推荐阅读
- c# - c# odbc 更新查询不能正常工作
- java - 您如何等待动态 Web 表格中的元素?
- intellij-idea - 为什么我在反编译的类中看到 lombok 导入
- php - strftime 令人难以置信的行为
- excel - 如何根据 Excel/Googlesheet 中每个单元格的行标题(重复)和列标题(重复)对所有单元格求和?
- javascript - 如何通过单击空格来拆分句子
- uipath - 使用 UiPath 从 PDF 中获取选中值的文本
- jquery - 徽章未在引导程序中正确加载
- python - Python OpenCV实时图像拼接(n=5)性能优化
- typo3 - 扩展编辑器中的链接处理程序