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

    %% Estimate Predictive Measures of Association for Surrogate Splits
%%
% Load Fisher's iris data set.

% Copyright 2015 The MathWorks, Inc.

load fisheriris
%%
% Grow a classification tree using |species| as the response.  Specify to use
% surrogate splits for missing values.
tree = fitctree(meas,species,'surrogate','on');
%%
% Find the mean predictive measure of association between the predictor
% variables.
ma = surrogateAssociation(tree)
%%
% Find the mean predictive measure of association averaged over the
% odd-numbered nodes in |tree|.
N = 1:2:tree.NumNodes;
ma = surrogateAssociation(tree,N)