Monday, February 27, 2012

MATLAB string tokenizer




     remain  = wholeString;
    while true
       [word, remain] = strtok(remain);
       if isempty( word  ),  break;  end
       disp( word  );
     
    end

Sunday, February 26, 2012

MATLAB CELL ARRAY


Using textscan
==================
fid = fopen(fname,'r');
C1=textscan(fid,'%s');
C1 = C1{1};// convert cell array to string 
fclose(fid);

Convert cell array into set of string
============================

C1 = C1{1};// convert cell array to string  


Using textread
=============

1. READING FILES WITH DIFF FORMAT OF DATA INTO CELL ARRAY

data = textread(fNamePPM,'%s','delimiter','\n','whitespace','\t');

2. CONSIDER EACH LINE IN CELL ARRAY

 myrow = sscanf(data{i} ,'%f\t%f\t%f\t%f' );

3.  ACCESS ENTRY OF A CELL ARRAY

 if  celarr{i}(j) =='>'

end

matlab cell array store different size element


1. Cell array can stores different length of feature in various sample. Which is no possible using matrix.


myCell = cell(5,1);
myCell{1} = nonzeroPos;  % first row
myCell{2} = [ 3 4 5];        % second row

2. Store / write cell array into file


C = cell(noSample,1);
fid=fopen(fNameFreq,'wt');
for i=1: (noSample - noSample +2 )
   nonzeroPos = find(data(i , :) );  
   C{i} = nonzeroPos; 
   fprintf(fid,'%i\t',C{i});
   fprintf(fid,'\n','' );   
end
fclose(fid);

data mining important tools



1. Apriori algorithm for "frequent itemset" & "association rule"

http://www.borgelt.net/apriori.html

2. 

Saturday, February 25, 2012

c/c++ compilation



 g++ -o outputBinary  allC/C++ code

>> g++ -o out mapModelIntoSeq.cpp  modelControl.cpp

Tuesday, February 21, 2012

linux cluster lsf using bsub load sharing facility

1. Submit a job using lsf (load sharing facility ) by command bsub (batch submit)


bsub -o output.o -e errorfile.e -J jobname -q queuename ./jobbinary

bsub -o output.o -e errorfile.e -J jobname -q queuename python mycode.py



2. see all running jobs


bjobs -u all


3. list my own jobs


bjobs


4. list queue priority and name


bqueues


5. Terminate or Kill a running job


bkill -r jobid