about summary refs log tree commit diff
path: root/sourcecodes/parameter_learning/standardizeData.m
blob: 61ea280e24cf66d60d8e849d15977189496e98cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [ cases ] = standardizeData( labels, node_sizes, cases )
%standardizeData standardizes continuous nodes so they have a mean = 0
%   and standard deviation = 1
%   Detailed explanation goes here

nnodes = size(labels,2);

%fprintf(['Standardizing data for continuous nodes\n'])
for i = 1:nnodes
    if node_sizes(i) == 1
        temp = cell2num(cases(i,:));
        [temp] = standardize(temp);
        cases(i,:) = num2cell(temp);
    end
end

%write standardized data to file
%fprintf(['Standardized data is written to file standardized_data.txt\n'])
%fout = 'standardized_data.txt';
%txt = sprintf([repmat('%s\t',1,size(labels,2))],labels{:});
%dlmwrite(fout,txt,'');
%dlmwrite(fout,cell2num(cases'),'-append','delimiter','\t');

end