Regression tree and regression equation

조회 수: 3 (최근 30일)
Danish Nasir
Danish Nasir 2022년 11월 7일
답변: Drew 2022년 11월 10일
Suppose i have 3 input variables x1,x2 and x3. Each variable is 400x1 size. x1 is a categorical variable while x2 and x3 are continuous variable. Also y is output which is also continuous.x1 range is [a b c d e f] and keep repeating it for 400 cells. x2 range is [0.2 to 2], x3 range is [3 to 23]. The output y range is [2 to 7]. The values of x1,x2,x3 and y can be generated using rand generator. I want to generate regression tree to predict y*. Now i want this prediction equation or code to be saved in a file so that i can use it in another file. The Matlab regression learner app have these features but i am not able to export the code or model in my other script. I want that the prediction equation will predict the output y* based on the other input x1,x2 and x3.
Pls suggest the steps with an example to generate regression tree,export code,save code and use in other script to predict y* for other randomly generated input data x1,x2,x3.

채택된 답변

Drew
Drew 2022년 11월 10일
You can train a regression model using the regression learner app, then export the model to the workspace to predict new data as described at https://www.mathworks.com/help/stats/export-regression-model-to-predict-new-data.html. The specific section is: https://www.mathworks.com/help/stats/export-regression-model-to-predict-new-data.html#bvi2d8a-47
As for using the model in a different script, you have several options:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by