Home > . > prt_plot_prediction_reg_line.m

prt_plot_prediction_reg_line

PURPOSE ^

FORMAT prt_plot_prediction_reg_line(PRT, model, axes_handle)

SYNOPSIS ^

function prt_plot_prediction_reg_line(PRT, model, axes_handle)

DESCRIPTION ^

 FORMAT prt_plot_prediction_reg_line(PRT, model, axes_handle)

 This function plots the line plot that appears on prt_ui_results
 Inputs:
       PRT             - data/design/model structure (it needs to contain
                         at least one estimated model).
       model           - the number of the model that will be ploted
       axes_handle     - (Optional) axes where the plot will be displayed

 Output:
       None
__________________________________________________________________________
 Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function prt_plot_prediction_reg_line(PRT, model, axes_handle)
0002 % FORMAT prt_plot_prediction_reg_line(PRT, model, axes_handle)
0003 %
0004 % This function plots the line plot that appears on prt_ui_results
0005 % Inputs:
0006 %       PRT             - data/design/model structure (it needs to contain
0007 %                         at least one estimated model).
0008 %       model           - the number of the model that will be ploted
0009 %       axes_handle     - (Optional) axes where the plot will be displayed
0010 %
0011 % Output:
0012 %       None
0013 %__________________________________________________________________________
0014 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory
0015 
0016 % Written by M. J. Rosa
0017 % $Id: prt_plot_prediction_reg_line.m 706 2013-06-07 14:33:34Z cphillip $
0018 
0019 nfold = length(PRT.model(model).output.fold);
0020 ntargs = length(PRT.model(model).output.fold(1).targets);
0021 
0022 %If no axes_handle is given, create a new window
0023 if ~exist('axes_handle', 'var')
0024     figure;
0025     axes_handle = axes;
0026 else
0027     set(axes_handle, 'XScale','linear');
0028 end
0029 
0030 
0031 cla(axes_handle, 'reset');
0032 preds1 = [];
0033 preds2 = [];
0034 for f = 1:nfold
0035     preds1 = [preds1; PRT.model(model).output.fold(f).targets];
0036     preds2 = [preds2; PRT.model(model).output.fold(f).predictions];
0037 end
0038 plot(axes_handle,preds1,'--ok');
0039 hold on
0040 plot(axes_handle,preds2,'--or');
0041 hold off
0042 xlabel(axes_handle,'folds','FontWeight','bold');
0043 ylabel(axes_handle,'predictions/targets','FontWeight','bold');
0044 xlim(axes_handle,[0 nfold*ntargs+1]);
0045 legend(axes_handle,{'Target', 'Predicted'});

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005