import_ascii_data_snn.m

来自「神经网络的工具箱, 神经网络的工具箱,」· M 代码 · 共 81 行

M
81
字号
function data = import_ascii_data_snn(filename, input, output, weight, missing)%IMPORT_ASCII_DATA_SNN import data from ascii file in wcfdata_struct.%%  Syntax%%   wcfdata_struct = import_ascii_data_snn(filename, input_columns, ...%                    target_columns) %   wcfdata_struct = import_ascii_data_snn(filename, input_columns, ...%                    target_columns, weight_column) %   wcfdata_struct = import_ascii_data_snn(filename, input_columns, ...%                    target_columns, weight_column, missing_value_indicator) %   wcfdata_struct = import_ascii_data_snn(filename, input_columns, ...%                    target_columns, [], missing_value_indicator) % %  Description%%   IMPORT_ASCII_DATA_SNN takes%     filename       - The name of the ascii file. For each pattern this%                      file must contain a row with space seperated values %                      for inputs, targets and pattern weights (if any).%     input_columns  - 1 x #inputs matrix of column numbers for the inputs.%     target_columns - 1 x #targets matrix of column number for the targets. %     weight_column  - column number for pattern weights. [] for no pattern %                      weights (default).%     missing_value_indicator - a value indicating the target is not%                               available and/or should not be used in %                               training (default NaN).%   and returns a wcfdata_struct which can be used by WCF_SNN.%%  Examples%%   Given the file 'file.asc':%   ------file.asc(begin)------------------------------------------------%   213 34 3123 324 1314 654321 1 %   312 53 4122 264 654321 4341 0.7 %   621 24 3223 324 654321 5312 0.7%   ------file.asc(end)--------------------------------------------------%%   the command:%   %   wcfdata = import_ascii_data_snn('file.asc', [1:3 5], [4 6], 7, 654321)%%   will return a wcfdata_struct representing 3 patterns, with%   inputs from column 1,2,3 and 5, targets from columns 4 and 6 and %   pattern weights from column 7.%   In training, pattern 1 will be used to train only on the first%   target, while pattern 2 and 3 will be used only to train on the%   second target. %%  See also%%   WCFDATA_STRUCT_SNN, TRAIN_SNN%if (nargin <5)   missing = NaN;endS = load_ascii_snn(filename);data.P = S(:, input)';data.T = S(:, output)';if (nargin>3)   data.gmu = S(:, weight)';endif (isnan(missing))    missing_ind = find(isnan(data.T));   if missing_ind      data.useT = ones(size(data.T));      data.useT(missing_ind) = 0;   endelse   missing_ind = find(missing == data.T);   if missing_ind      data.useT = ones(size(data.T));      data.useT(missing_ind) = 0;   endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?