首页 > 解决方案 > 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.

标签: matlab

解决方案


推荐阅读