-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1st working version of NYTRO crossval. Needs further testing.
- Loading branch information
Raffaello Camoriano
committed
Oct 20, 2015
1 parent
b66fae6
commit 90b195f
Showing
4 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,56 @@ | ||
function [ output_args ] = config_set( input_args ) | ||
%CONFIG_SET Summary of this function goes here | ||
% Detailed explanation goes here | ||
function [ config ] = config_set( varargin ) | ||
%CONFIG_SET Constructs the default configuration stucture to be used by | ||
%nytro_train | ||
|
||
% Set default configuration fields | ||
config = struct(); | ||
|
||
% data | ||
config.data.shuffle = 1; | ||
|
||
% crossValidation | ||
config.crossValidation.storeTrainingError = 0; | ||
config.crossValidation.validationPart = 0.2; | ||
config.crossValidation.recompute = 0; | ||
config.crossValidation.errorFunction = @rmse; | ||
config.crossValidation.codingFunction = []; | ||
config.crossValidation.stoppingRule = @windowLinearFitting; | ||
config.crossValidation.windowSize = 10; | ||
config.crossValidation.threshold = 0; | ||
|
||
% filter | ||
config.filter.fixedIterations = []; | ||
config.filter.maxIterations = 500; | ||
config.filter.gamma = []; | ||
|
||
% kernel | ||
config.kernel.kernelFunction = @gaussianKernel; | ||
config.kernel.kernelParameters = 1; | ||
config.kernel.m = 100; | ||
|
||
% Parse function inputs | ||
if ~isempty(varargin) | ||
|
||
% Assign parsed parameters to object properties | ||
fields = varargin(1:2:end); | ||
for idx = 1:numel(fields) | ||
|
||
currField = fields{idx}; | ||
% Parse current field | ||
k = strfind(currField , '.'); | ||
k = [0 ; k ; (numel(currField)+1)]; | ||
tokens = cell(1,(numel(k) - 1)); | ||
for i = 1 : (numel(k) - 1); | ||
tokens{i} = currField( (k(i)+1) : (k(i+1)-1) ); | ||
end | ||
|
||
cmdStr = 'config'; | ||
for i = 1 : (numel(tokens) - 1) | ||
cmdStr = strcat(cmdStr , '.(''' , tokens{i} , ''')'); | ||
end | ||
cmdStr = strcat(cmdStr , '.(''' , tokens{end} , ''') = varargin{2*(idx-1) + 2};'); | ||
eval(cmdStr); | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters