www.gusucode.com > stats 源码程序 matlab案例代码 > stats/ComputeTheInSampleMSE1Example.m

    %% Compute the In-Sample MSE
%%
% Load the |carsmall| data set. Consider |Displacement|,
% |Horsepower|, and |Weight| as predictors of the response |MPG|.

% Copyright 2015 The MathWorks, Inc.

load carsmall
X = [Displacement Horsepower Weight];
%%
% Grow a regression tree using all observations.
Mdl = fitrtree(X,MPG);
%%
% Compute the resubstitution MSE.
resubLoss(Mdl)