Browse Source

minor changes for smooth demo

Alexander Freytag 9 years ago
parent
commit
97fe705d15
2 changed files with 12 additions and 3 deletions
  1. 11 2
      initWorkspaceLibLinear.m
  2. 1 1
      misc/getFieldWithDefault.m

+ 11 - 2
initWorkspaceLibLinear.m

@@ -24,6 +24,8 @@ function initWorkspaceLibLinear
     
     if strcmp( getenv('USER'), 'freytag')
         LIBLINEARDIR    = '/home/freytag/code/3rdParty/liblinear-1.93/matlab/';   
+    elseif strcmp( getenv('USER'), 'rodner')
+        LIBLINEARDIR    = '/home/freytag/code/3rdParty/liblinear-1.93/matlab/';
     else
         fprintf('Unknown user %s and unknown default settings', getenv('USER') ); 
     end    
@@ -40,7 +42,14 @@ function initWorkspaceLibLinear
     b_overwrite             = true;
     s_pathMisc              = fullfile(pwd, 'misc');
     addPathSafely ( s_pathMisc, b_recursive, b_overwrite )
-    clear ( 's_pathMisc' );        
+    clear ( 's_pathMisc' );      
+
+    % for binary evaluation metrics such as auc during cross val
+    b_recursive             = true; 
+    b_overwrite             = true;
+    s_pathMisc              = fullfile(pwd, 'binary');
+    addPathSafely ( s_pathMisc, b_recursive, b_overwrite )
+    clear ( 's_pathMisc' );     
         
     %% 3rd party, untouched
     
@@ -77,4 +86,4 @@ function addPathSafely ( s_path, b_recursive, b_overwrite )
     else
         addpath( s_path );
     end
-end
+end

+ 1 - 1
misc/getFieldWithDefault.m

@@ -18,7 +18,7 @@ function myOut = getFieldWithDefault ( myStruct, myField, myDefault )
 % author: Alexander Freytag
 % date  : 04-03-2014 ( dd-mm-yyyy )
 
-    if ( ~isempty(myStruct) && isfield(myStruct, myField) && ~isempty( myStruct.( myField ) ))
+    if ( ~isempty(myStruct) && isfield(myStruct, myField) && ~( ~ischar(myDefault) && isempty( myStruct.( myField ) ))   )
         myOut = myStruct.( myField );
     else
         myOut = myDefault;