├── RACOG & wRACOG ├── ARFFheader.txt ├── Att_Values.m ├── CSVtoARFF.m ├── ClassifierPredict.m ├── ClassifierTrain.m ├── Evaluate.m ├── GibbsSampler.m ├── RACOG.m ├── README.txt ├── SMOTEBoost.m ├── TAN.m ├── WrapperGibbsSampler.m ├── data.csv ├── wRACOG.m └── weka.jar ├── RACOG_TKDE.pdf ├── README.md ├── RUSBoost ├── ARFFheader.txt ├── CSVtoARFF.m ├── ClassifierPredict.m ├── ClassifierTrain.m ├── README.txt ├── RUSBoost.m ├── Test.m ├── data.csv └── weka.jar └── SMOTEBoost ├── ARFFheader.txt ├── CSVtoARFF.m ├── ClassifierPredict.m ├── ClassifierTrain.m ├── README.txt ├── SMOTEBoost.m ├── Test.m ├── data.csv └── weka.jar /RACOG & wRACOG/ARFFheader.txt: -------------------------------------------------------------------------------- 1 | @relation car 2 | 3 | @attribute buying {1,2,3,4} 4 | @attribute maint {1,2,3,4} 5 | @attribute doors {1,2,3,4} 6 | @attribute persons {1,2,3} 7 | @attribute lug_boot {1,2,3} 8 | @attribute safety {1,2,3} 9 | @attribute class {0,1} 10 | 11 | @data 12 | -------------------------------------------------------------------------------- /RACOG & wRACOG/Att_Values.m: -------------------------------------------------------------------------------- 1 | function values = Att_Values() 2 | 3 | values = {}; 4 | 5 | % 1. 6 | values{1} = [1,2,3,4]; 7 | 8 | % 2. 9 | values{2} = [1,2,3,4]; 10 | 11 | % 3. 12 | values{3} = [1,2,3,4]; 13 | 14 | % 4. 15 | values{4} = [1,2,3]; 16 | 17 | % 5. 18 | values{5} = [1,2,3]; 19 | 20 | % 6. 21 | values{6} = [1,2,3]; 22 | 23 | % % 7. 24 | % values{7} = [1,2,3,4,5]; 25 | % 26 | % % 8. 27 | % values{8} = [1,2,3,4,5]; 28 | 29 | % % 9. 30 | % values{9} = [1,2,3,4,5,6,7,8]; 31 | % 32 | % % 10. 33 | % values{10} = [1,2,3,4,5,6,7,8]; 34 | % 35 | % % 11. 36 | % values{11} = [1,2,3,4,5,6,7,8]; 37 | % 38 | % % 12. 39 | % values{12} = [1,2,3,4,5,6,7,8]; 40 | % 41 | % % 13. 42 | % values{13} = [1,2,3,4,5]; 43 | % 44 | % % 14. 45 | % values{14} = [1,2,3,4,5,6,7,8]; 46 | % 47 | % % 15. 48 | % values{15} = [1,2,3,4,5]; 49 | % 50 | % % 16. 51 | % values{16} = [1,2,3,4,5,6,7,8]; -------------------------------------------------------------------------------- /RACOG & wRACOG/CSVtoARFF.m: -------------------------------------------------------------------------------- 1 | function r = CSVtoARFF (data, relation, type) 2 | % csv to arff file converter 3 | 4 | % load the csv data 5 | [rows cols] = size(data); 6 | 7 | % open the arff file for writing 8 | farff = fopen(strcat(type,'.arff'), 'w'); 9 | 10 | % print the relation part of the header 11 | fprintf(farff, '@relation %s', relation); 12 | 13 | % Reading from the ARFF header 14 | fid = fopen('ARFFheader.txt','r'); 15 | tline = fgets(fid); 16 | while ischar(tline) 17 | tline = fgets(fid); 18 | fprintf(farff,'%s',tline); 19 | end 20 | fclose(fid); 21 | 22 | % Converting the data 23 | for i = 1 : rows 24 | % print the attribute values for the data point 25 | for j = 1 : cols - 1 26 | if data(i,j) ~= -1 % check if it is a missing value 27 | fprintf(farff, '%d,', data(i,j)); 28 | else 29 | fprintf(farff, '?,'); 30 | end 31 | end 32 | % print the label for the data point 33 | fprintf(farff, '%d\n', data(i,end)); 34 | end 35 | 36 | % close the file 37 | fclose(farff); 38 | 39 | r = 0; -------------------------------------------------------------------------------- /RACOG & wRACOG/ClassifierPredict.m: -------------------------------------------------------------------------------- 1 | function prediction = ClassifierPredict(data,model) 2 | % Predicting the labels of the test instances 3 | % Input: data = test data 4 | % model = the trained model 5 | % type = type of classifier 6 | % Output: prediction = prediction labels 7 | 8 | javaaddpath('weka.jar'); 9 | 10 | CSVtoARFF(data,'test','test'); 11 | test_file = 'test.arff'; 12 | reader = javaObject('java.io.FileReader', test_file); 13 | test = javaObject('weka.core.Instances', reader); 14 | test.setClassIndex(test.numAttributes() - 1); 15 | 16 | prediction = []; 17 | for i = 0 : size(data,1) - 1 18 | p = model.classifyInstance(test.instance(i)); 19 | prob = model.distributionForInstance(test.instance(i)); 20 | prob = prob'; 21 | prediction = [prediction; p prob(2)]; 22 | end -------------------------------------------------------------------------------- /RACOG & wRACOG/ClassifierTrain.m: -------------------------------------------------------------------------------- 1 | function model = ClassifierTrain(data,type) 2 | % Training the classifier that would do the sample selection 3 | 4 | javaaddpath('weka.jar'); 5 | 6 | CSVtoARFF(data,'train','train'); 7 | train_file = 'train.arff'; 8 | reader = javaObject('java.io.FileReader', train_file); 9 | train = javaObject('weka.core.Instances', reader); 10 | train.setClassIndex(train.numAttributes() - 1); 11 | % options = javaObject('java.lang.String'); 12 | 13 | switch type 14 | case 'svm' 15 | model = javaObject('weka.classifiers.functions.SMO'); 16 | kernel = javaObject('weka.classifiers.functions.supportVector.RBFKernel'); 17 | model.setKernel(kernel); 18 | case 'tree' 19 | model = javaObject('weka.classifiers.trees.J48'); 20 | % options = weka.core.Utils.splitOptions('-C 0.2'); 21 | % model.setOptions(options); 22 | case 'knn' 23 | model = javaObject('weka.classifiers.lazy.IBk'); 24 | model.setKNN(5); 25 | case 'logistic' 26 | model = javaObject('weka.classifiers.functions.Logistic'); 27 | end 28 | 29 | model.buildClassifier(train); -------------------------------------------------------------------------------- /RACOG & wRACOG/Evaluate.m: -------------------------------------------------------------------------------- 1 | function evaluation = Evaluate(actual,prediction) 2 | % Generating the performance measures 3 | 4 | predicted = prediction(:,1); 5 | 6 | idx = (actual()==1); 7 | 8 | p = length(actual(idx)); 9 | n = length(actual(~idx)); 10 | N = p+n; 11 | 12 | tp = sum(actual(idx)==predicted(idx)); 13 | tn = sum(actual(~idx)==predicted(~idx)); 14 | fp = n-tn; 15 | fn = p-tp; 16 | 17 | tp_rate = tp/p; 18 | tn_rate = tn/n; 19 | 20 | accuracy = (tp+tn)/N; 21 | sensitivity = tp_rate; 22 | specificity = tn_rate; 23 | fp_rate = fp/n; 24 | gmeans = sqrt(tp_rate*tn_rate); 25 | precision = tp/(tp+fp); 26 | if tp==0 && fp ==0 27 | precision = 0; 28 | end 29 | f_measure = 2*((precision*sensitivity)/(precision+sensitivity)); 30 | if precision==0 && sensitivity==0 31 | f_measure=0; 32 | end 33 | 34 | if size(prediction,2)==2 35 | scores = prediction(:,2); 36 | [X,Y,T,AUC] = perfcurve(actual,scores,1); 37 | else 38 | AUC = -1; 39 | end 40 | 41 | evaluation = [accuracy sensitivity specificity fp_rate gmeans precision f_measure AUC]; 42 | -------------------------------------------------------------------------------- /RACOG & wRACOG/GibbsSampler.m: -------------------------------------------------------------------------------- 1 | function sample = GibbsSampler(data,Z,tan,T) 2 | % GibbsSampler 3 | 4 | k = size(Z,2); 5 | values = Att_Values(); 6 | sample = []; 7 | 8 | % If the current instance has missing values in any attribute, replace it 9 | % with the most common value of that attibute 10 | Z_i = Z; 11 | for i = 1:k 12 | if Z_i(i) == -1 13 | Z_i(i) = mode(data(data(:,i)>0)); 14 | end 15 | end 16 | 17 | % Sampling 18 | for t = 1:T 19 | for i = 1:k 20 | ival = values{i}; 21 | % For all possible values of the current attribute 22 | P = zeros(size(ival,2),1); 23 | 24 | for j = 1:size(ival,2) 25 | Z_i(i) = ival(j); 26 | % Calculating the numerator without the normalization factor 27 | P(j) = NumFactor(data,Z_i,k,tan); 28 | end 29 | 30 | % Normalizing probability 31 | psum = sum(P); 32 | for j = 1:size(values{i},2) 33 | P(j) = P(j)/psum; 34 | end 35 | 36 | % Sampling based on CDF 37 | u = rand(1,1); 38 | add = 0; 39 | for j = 1:size(values{i},2) 40 | add = add + P(j); 41 | if u <= add 42 | new_Z_i = j; 43 | break 44 | end 45 | end 46 | 47 | % Assigning new value to Z_i 48 | Z_i(i) = new_Z_i; 49 | end 50 | 51 | % Burn-in and lag 52 | if t>100 && mod(t,20)==0 53 | sample = [sample;Z_i]; 54 | end 55 | 56 | end 57 | 58 | function prob = NumFactor(data,Z_i,k,tan) 59 | dependency = tan{1}; 60 | prob_table = tan{2}; 61 | prior = tan{3}; 62 | prob = 1; 63 | 64 | for i = 1:k 65 | cur_val = Z_i(i); 66 | 67 | dep = dependency(i); 68 | % Root of the tree 69 | if dep == -1 70 | pr = prob_table{i}(cur_val); 71 | else 72 | % Attribute has dependency 73 | dep_val = Z_i(dep); 74 | pr = prob_table{i}(dep_val,cur_val); 75 | end 76 | 77 | prob = prob * pr; 78 | end 79 | 80 | -------------------------------------------------------------------------------- /RACOG & wRACOG/RACOG.m: -------------------------------------------------------------------------------- 1 | clc; 2 | clear all; 3 | close all; 4 | 5 | file = 'data.csv'; % Dataset 6 | folds = 5; % Value of k in K-fold Cross Validation 7 | 8 | % Reading training file 9 | data = dlmread(file); 10 | label = data(:,end); 11 | 12 | % Extracting positive data points 13 | idx = (label==1); 14 | pos_data = data(idx,:); 15 | row_pos = size(pos_data,1); 16 | 17 | % Extracting negative data points 18 | neg_data = data(~idx,:); 19 | row_neg = size(neg_data,1); 20 | 21 | % Performing tests on 4 different classifiers 22 | results = cell(4,1); 23 | 24 | for fold = 1:folds 25 | 26 | disp (['Fold: ' int2str(fold)]); 27 | disp ('----------------------------------------------'); 28 | 29 | % Random permuation of positive and negative data points 30 | p = randperm(row_pos); 31 | n = randperm(row_neg); 32 | 33 | % Always use 80-20 split 34 | tstpf = p(1:round(row_pos/5)); 35 | tstnf = n(1:round(row_neg/5)); 36 | trpf = setdiff(p, tstpf); 37 | trnf = setdiff(n, tstnf); 38 | 39 | train_data = [pos_data(trpf,:);neg_data(trnf,:)]; 40 | test_data = [pos_data(tstpf,:);neg_data(tstnf,:)]; 41 | train_pos = pos_data(trpf,:); 42 | 43 | % Defining the initial probability distribution 44 | [dependency prob prior] = TAN(train_pos(:,1:end-1)); 45 | tan = {dependency,prob,prior}; 46 | 47 | itr = 100 + ((size(train_data,1)-1.6*size(trpf))/size(trpf))*20; 48 | 49 | gen_sample = []; 50 | % Generating samples using Gibbs Sampler 51 | for i = 1:size(train_pos,1) 52 | disp([' Generating new minority class sample: ' int2str(i)]); 53 | sample = GibbsSampler(train_pos(:,1:end-1),train_pos(i,1:end-1),tan,itr); 54 | gen_sample = [gen_sample; sample]; 55 | end 56 | gen_sample = [gen_sample ones(size(gen_sample,1),1)]; 57 | new_data = [gen_sample; train_data]; 58 | 59 | % Decision Tree 60 | disp('Testing with J48 ...'); 61 | model = ClassifierTrain(new_data,'tree'); 62 | predicted = ClassifierPredict(test_data,model); 63 | eval = Evaluate(test_data(:,end),predicted); 64 | results{1} = [results{1}; eval]; 65 | 66 | % SVM 67 | disp('Testing with SMO ...'); 68 | model = ClassifierTrain(new_data,'svm'); 69 | predicted = ClassifierPredict(test_data,model); 70 | eval = Evaluate(test_data(:,end),predicted); 71 | results{2} = [results{2}; eval]; 72 | 73 | % kNN 74 | disp('Testing with IBk ...'); 75 | model = ClassifierTrain(new_data,'knn'); 76 | predicted = ClassifierPredict(test_data,model); 77 | eval = Evaluate(test_data(:,end),predicted); 78 | results{3} = [results{3}; eval]; 79 | 80 | % Logistic Regression 81 | disp('Testing with Logistic ...'); 82 | model = ClassifierTrain(new_data,'logistic'); 83 | predicted = ClassifierPredict(test_data,model); 84 | eval = Evaluate(test_data(:,end),predicted); 85 | results{4} = [results{4}; eval]; 86 | 87 | end 88 | 89 | disp('*********************************************************************************'); 90 | disp('Classifier: J48'); 91 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 92 | % disp(results{1}); 93 | disp(mean(results{1})); 94 | disp(std(results{1})); 95 | 96 | disp('Classifier: SMO'); 97 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 98 | % disp(results{2}); 99 | disp(mean(results{2})); 100 | disp(std(results{2})); 101 | 102 | disp('Classifier: kNN'); 103 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 104 | % disp(results{3}); 105 | disp(mean(results{3})); 106 | disp(std(results{3})); 107 | 108 | disp('Classifier: Logistic Regression'); 109 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 110 | % disp(results{2}); 111 | disp(mean(results{4})); 112 | disp(std(results{4})); 113 | disp('*********************************************************************************'); 114 | -------------------------------------------------------------------------------- /RACOG & wRACOG/README.txt: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | Author: Barnan Das 3 | Email: barnandas@wsu.edu 4 | Homepage: www.eecs.wsu.edu/~bdas1 5 | Last Updated: June 25, 2012 6 | ****************************************************************************** 7 | 8 | File Descriptions: 9 | weka.jar -> Weka jar file that is called by several Matlab scripts in this 10 | directory. 11 | 12 | train.arff, test.arff -> ARFF (Weka compatible) files generated by some of the 13 | Matlab scripts. 14 | 15 | ARFFheader.txt -> Defines the ARFF header for the data file "data.csv". Please 16 | refer to the following link to learn more about ARFF format. 17 | http://www.cs.waikato.ac.nz/ml/weka/arff.html 18 | 19 | Att_values.m -> Contains the attribute values for the dataset. * Varies as per 20 | dataset. 21 | 22 | TAN.m -> Contains the conditional probability matrix built by the Bayesian 23 | tree which is generated by Weka machine learning software using TAN. 24 | Tan or Tree Augmented Naive Bayes is a search algorithm for the 25 | BayesNet classifier of Weka. 26 | 27 | GibbsSampler.m -> Implementation of Gibbs sampler that uses attribute 28 | dependencies imposed by the Bayesian tree and stored in 29 | TAN.m. 30 | 31 | WrapperGibbsSampler.m -> Implementation of the wrapper-based Gibbs sampler. 32 | The attribute dependencies imposed by the Bayesian 33 | tree and stored in TAN.m. 34 | 35 | RACOG.m -> The RACOG algorithm that runs for 5 folds and evaluates its 36 | performance by testing the oversampled dataset with four 37 | classifiers. 38 | 39 | wRACOG.m -> The wRACOG algorithm that runs for 5 folds and evaluates its 40 | performance by testing the oversampled dataset with four 41 | classifiers. 42 | 43 | ClassifierTrain.m, ClassifierPredict.m, CSVtoARFF.m -> Matlab functions used by 44 | RACOG.m and wRACOG.m 45 | 46 | 47 | **************************************xxx************************************** -------------------------------------------------------------------------------- /RACOG & wRACOG/SMOTEBoost.m: -------------------------------------------------------------------------------- 1 | function prediction = SMOTEBoost (TRAIN,TEST,WeakLearn,ClassDist) 2 | % This function implements the SMOTEBoost Algorithm. For more details on the 3 | % theoretical description of the algorithm please refer to the following 4 | % paper: 5 | % N.V. Chawla, A.Lazarevic, L.O. Hall, K. Bowyer, "SMOTEBoost: Improving 6 | % Prediction of Minority Class in Boosting, Journal of Knowledge Discovery 7 | % in Databases: PKDD, 2003. 8 | % Input: TRAIN = Training data as matrix 9 | % TEST = Test data as matrix 10 | % WeakLearn = String to choose algortihm. Choices are 11 | % 'svm','tree','knn' and 'logistic'. 12 | % ClassDist = true or false. true indicates that the class 13 | % distribution is maintained while doing weighted 14 | % resampling and before SMOTE is called at each 15 | % iteration. false indicates that the class distribution 16 | % is not maintained while resampling. 17 | % Output: prediction = size(TEST,1)x 2 matrix. Col 1 is class labels for 18 | % all instances. Col 2 is probability of the instances 19 | % being classified as positive class. 20 | 21 | javaaddpath('weka.jar'); 22 | 23 | %% Training SMOTEBoost 24 | % Total number of instances in the training set 25 | m = size(TRAIN,1); 26 | POS_DATA = TRAIN(TRAIN(:,end)==1,:); 27 | NEG_DATA = TRAIN(TRAIN(:,end)==0,:); 28 | pos_size = size(POS_DATA,1); 29 | neg_size = size(NEG_DATA,1); 30 | 31 | % Reorganize TRAIN by putting all the positive and negative exampels 32 | % together, respectively. 33 | TRAIN = [POS_DATA;NEG_DATA]; 34 | 35 | % Converting training set into Weka compatible format 36 | CSVtoARFF (TRAIN, 'train', 'train'); 37 | train_reader = javaObject('java.io.FileReader', 'train.arff'); 38 | train = javaObject('weka.core.Instances', train_reader); 39 | train.setClassIndex(train.numAttributes() - 1); 40 | 41 | % Total number of iterations of the boosting method 42 | T = 10; 43 | 44 | % W stores the weights of the instances in each row for every iteration of 45 | % boosting. Weights for all the instances are initialized by 1/m for the 46 | % first iteration. 47 | W = zeros(1,m); 48 | for i = 1:m 49 | W(1,i) = 1/m; 50 | end 51 | 52 | % L stores pseudo loss values, H stores hypothesis, B stores (1/beta) 53 | % values that is used as the weight of the % hypothesis while forming the 54 | % final hypothesis. % All of the following are of length <=T and stores 55 | % values for every iteration of the boosting process. 56 | L = []; 57 | H = {}; 58 | B = []; 59 | 60 | % Loop counter 61 | t = 1; 62 | 63 | % Keeps counts of the number of times the same boosting iteration have been 64 | % repeated 65 | count = 0; 66 | 67 | % Boosting T iterations 68 | while t <= T 69 | 70 | % LOG MESSAGE 71 | disp (['Boosting iteration #' int2str(t)]); 72 | 73 | if ClassDist == true 74 | % Resampling POS_DATA with weights of positive example 75 | POS_WT = zeros(1,pos_size); 76 | sum_POS_WT = sum(W(t,1:pos_size)); 77 | for i = 1:pos_size 78 | POS_WT(i) = W(t,i)/sum_POS_WT ; 79 | end 80 | RESAM_POS = POS_DATA(randsample(1:pos_size,pos_size,true,POS_WT),:); 81 | 82 | % Resampling NEG_DATA with weights of positive example 83 | NEG_WT = zeros(1,neg_size); 84 | sum_NEG_WT = sum(W(t,pos_size+1:m)); 85 | for i = 1:neg_size 86 | NEG_WT(i) = W(t,pos_size+i)/sum_NEG_WT ; 87 | end 88 | RESAM_NEG = NEG_DATA(randsample(1:neg_size,neg_size,true,NEG_WT),:); 89 | 90 | % Resampled TRAIN is stored in RESAMPLED 91 | RESAMPLED = [RESAM_POS;RESAM_NEG]; 92 | 93 | % Calulating the percentage of boosting the positive class. 'pert' 94 | % is used as a parameter of SMOTE 95 | pert = ((neg_size-pos_size)/pos_size)*100; 96 | else 97 | % Indices of resampled train 98 | RND_IDX = randsample(1:m,m,true,W(t,:)); 99 | 100 | % Resampled TRAIN is stored in RESAMPLED 101 | RESAMPLED = TRAIN(RND_IDX,:); 102 | 103 | % Calulating the percentage of boosting the positive class. 'pert' 104 | % is used as a parameter of SMOTE 105 | pos_size = sum(RESAMPLED(:,end)==1); 106 | neg_size = sum(RESAMPLED(:,end)==0); 107 | pert = ((neg_size-pos_size)/pos_size)*100; 108 | end 109 | 110 | % Converting resample training set into Weka compatible format 111 | CSVtoARFF (RESAMPLED,'resampled','resampled'); 112 | reader = javaObject('java.io.FileReader','resampled.arff'); 113 | resampled = javaObject('weka.core.Instances',reader); 114 | resampled.setClassIndex(resampled.numAttributes()-1); 115 | 116 | % New SMOTE boosted data gets stored in S 117 | smote = javaObject('weka.filters.supervised.instance.SMOTE'); 118 | pert = ((neg_size-pos_size)/pos_size)*100; 119 | smote.setPercentage(pert); 120 | smote.setInputFormat(resampled); 121 | 122 | S = weka.filters.Filter.useFilter(resampled, smote); 123 | 124 | % Training a weak learner. 'pred' is the weak hypothesis. However, the 125 | % hypothesis function is encoded in 'model'. 126 | switch WeakLearn 127 | case 'svm' 128 | model = javaObject('weka.classifiers.functions.SMO'); 129 | case 'tree' 130 | model = javaObject('weka.classifiers.trees.J48'); 131 | case 'knn' 132 | model = javaObject('weka.classifiers.lazy.IBk'); 133 | model.setKNN(5); 134 | case 'logistic' 135 | model = javaObject('weka.classifiers.functions.Logistic'); 136 | end 137 | model.buildClassifier(S); 138 | 139 | pred = zeros(m,1); 140 | for i = 0 : m - 1 141 | pred(i+1) = model.classifyInstance(train.instance(i)); 142 | end 143 | 144 | % Computing the pseudo loss of hypothesis 'model' 145 | loss = 0; 146 | for i = 1:m 147 | if TRAIN(i,end)==pred(i) 148 | continue; 149 | else 150 | loss = loss + W(t,i); 151 | end 152 | end 153 | 154 | % If count exceeds a pre-defined threshold (5 in the current 155 | % implementation), the loop is broken and rolled back to the state 156 | % where loss > 0.5 was not encountered. 157 | if count > 5 158 | L = L(1:t-1); 159 | H = H(1:t-1); 160 | B = B(1:t-1); 161 | disp (' Too many iterations have loss > 0.5'); 162 | disp (' Aborting boosting...'); 163 | break; 164 | end 165 | 166 | % If the loss is greater than 1/2, it means that an inverted 167 | % hypothesis would perform better. In such cases, do not take that 168 | % hypothesis into consideration and repeat the same iteration. 'count' 169 | % keeps counts of the number of times the same boosting iteration have 170 | % been repeated 171 | if loss > 0.5 172 | count = count + 1; 173 | continue; 174 | else 175 | count = 1; 176 | end 177 | 178 | L(t) = loss; % Pseudo-loss at each iteration 179 | H{t} = model; % Hypothesis function 180 | beta = loss/(1-loss); % Setting weight update parameter 'beta'. 181 | B(t) = log(1/beta); % Weight of the hypothesis 182 | 183 | % At the final iteration there is no need to update the weights any 184 | % further 185 | if t==T 186 | break; 187 | end 188 | 189 | % Updating weight 190 | for i = 1:m 191 | if TRAIN(i,end)==pred(i) 192 | W(t+1,i) = W(t,i)*beta; 193 | else 194 | W(t+1,i) = W(t,i); 195 | end 196 | end 197 | 198 | % Normalizing the weight for the next iteration 199 | sum_W = sum(W(t+1,:)); 200 | for i = 1:m 201 | W(t+1,i) = W(t+1,i)/sum_W; 202 | end 203 | 204 | % Incrementing loop counter 205 | t = t + 1; 206 | end 207 | 208 | % The final hypothesis is calculated and tested on the test set 209 | % simulteneously. 210 | 211 | %% Testing SMOTEBoost 212 | n = size(TEST,1); % Total number of instances in the test set 213 | 214 | CSVtoARFF(TEST,'test','test'); 215 | test = 'test.arff'; 216 | test_reader = javaObject('java.io.FileReader', test); 217 | test = javaObject('weka.core.Instances', test_reader); 218 | test.setClassIndex(test.numAttributes() - 1); 219 | 220 | % Normalizing B 221 | sum_B = sum(B); 222 | for i = 1:size(B,2) 223 | B(i) = B(i)/sum_B; 224 | end 225 | 226 | prediction = zeros(n,2); 227 | 228 | for i = 1:n 229 | % Calculating the total weight of the class labels from all the models 230 | % produced during boosting 231 | wt_zero = 0; 232 | wt_one = 0; 233 | for j = 1:size(H,2) 234 | p = H{j}.classifyInstance(test.instance(i-1)); 235 | if p==1 236 | wt_one = wt_one + B(j); 237 | else 238 | wt_zero = wt_zero + B(j); 239 | end 240 | end 241 | 242 | if (wt_one > wt_zero) 243 | prediction(i,:) = [1 wt_one]; 244 | else 245 | prediction(i,:) = [0 wt_one]; 246 | end 247 | end -------------------------------------------------------------------------------- /RACOG & wRACOG/TAN.m: -------------------------------------------------------------------------------- 1 | function [dependency prob prior] = TAN(data) 2 | 3 | m = size(data,1); 4 | k = size(data,2); 5 | values = Att_Values(); 6 | 7 | %% Dependencies 8 | dependency = [5;1;6;6;-1;5]; 9 | 10 | %% Calculating priors 11 | prior = cell(1,k); 12 | 13 | for i = 1:k 14 | ival = values{i}; 15 | prior{i} = zeros(1,size(ival,2)); 16 | for j = 1:size(ival,2) 17 | prior{i}(j) = length(find(data(:,i)==ival(j)))/m; 18 | end 19 | end 20 | 21 | % If any probability values is 0, replacing it with a VERY small constant 22 | % and adding the rest of the values by the same constant 23 | for i = 1:k 24 | for j = 1:size(values{i},2) 25 | prior{i}(j) = prior{i}(j) + 0.0001; 26 | end 27 | end 28 | 29 | %% Forming dependency table 30 | prob = cell(1,k); 31 | 32 | for i = 1:k 33 | d = dependency(i); 34 | 35 | % If the attribute is the root of the tree 36 | if d ==-1 37 | prob{i} = prior{i}; 38 | continue 39 | end 40 | 41 | ival = values{i}; 42 | dval = values{d}; 43 | 44 | % values of dependency variable in the rows and the current variable in 45 | % the columns 46 | D = zeros(size(dval,2),size(ival,2)); 47 | 48 | for row = 1: size(dval,2) 49 | for col = 1: size(ival,2) 50 | num = length(find(data(:,i)==ival(col) & data(:,d)==dval(row))); 51 | den = length(find(data(:,d)==dval(row))); 52 | 53 | if den == 0 54 | D(row,col) = 0; 55 | else 56 | D(row,col) = num/den; 57 | end 58 | end 59 | end 60 | 61 | prob{i} = D; 62 | 63 | end 64 | 65 | % If any probability values is 0, replacing it with a VERY small constant 66 | % and adding the rest of the values by the same constant 67 | for i = 1:k 68 | d = dependency(i); 69 | 70 | if d ==-1 71 | continue 72 | end 73 | 74 | for row = 1: size(values{d},2) 75 | for col = 1: size(values{i},2) 76 | prob{i}(row,col) = prob{i}(row,col) + 0.0001; 77 | end 78 | end 79 | end 80 | -------------------------------------------------------------------------------- /RACOG & wRACOG/WrapperGibbsSampler.m: -------------------------------------------------------------------------------- 1 | function newsamples = WrapperGibbsSampler(train,tan,wc,test_data) 2 | % WrapperGibbsSampler 3 | 4 | % Training the classifier on the initial training set 5 | model = ClassifierTrain(train,wc); 6 | 7 | % Extracting the positive training data 8 | label = train(:,end); 9 | idx = (label==1); 10 | train_p = train(idx,1:end-1); 11 | [d k] = size(train_p); 12 | 13 | % Assigning possible values to the attributes 14 | values = Att_Values(); 15 | 16 | % If the current instance has missing values in any attribute, replace it 17 | % with the mode of that attibute 18 | Z = train_p; 19 | for i = 1:d 20 | for j = 1:k 21 | if Z(i,j) == -1 22 | Z(i,j) = mode(train_p(train_p(:,j) > 0)); 23 | end 24 | end 25 | end 26 | 27 | % Buffers to store samples and accuracies 28 | sample = []; 29 | sensitivity = []; 30 | 31 | % Keeping track of the sample set number 32 | b = 0; 33 | 34 | % Change the batch size here 35 | batch_size = 10; 36 | 37 | % Number of instances added in each batch 38 | numaddinst = []; 39 | 40 | % Size of the sliding window that keeps track of the sensitivity 41 | sizewin = 10; 42 | 43 | % The sliding window that also keeps track of the batch where the value 44 | % occured 45 | slidewin = []; 46 | 47 | % Number of iterations of the Gibbs Sampler 48 | T = 500; 49 | 50 | % Performing Gibbs sampling 51 | for t = 1:T 52 | disp([' Iteration: ' int2str(t)]); 53 | % For every minority class sample in the training set 54 | for i = 1:d 55 | % For every attribute of the instance 56 | for j = 1:k 57 | ival = values{j}; 58 | % For all possible values of the current attribute 59 | P = zeros(size(ival,2),1); 60 | 61 | for x = 1:size(ival,2) 62 | Z(i,j) = ival(x); 63 | % Calculating the numerator without the normalization factor 64 | P(x) = NumFactor(Z(i,:),k,tan); 65 | end 66 | 67 | % Normalizing the probability 68 | psum = sum(P); 69 | for x = 1:size(values{j},2) 70 | P(x) = P(x)/psum; 71 | end 72 | 73 | % Sampling based on CDF 74 | u = rand(1,1); 75 | add = 0; 76 | for x = 1:size(values{j},2) 77 | add = add + P(x); 78 | if u <= add 79 | newattval = x; 80 | break 81 | end 82 | end 83 | 84 | % Assigning new value to Z(i,:) 85 | Z(i,j) = newattval; 86 | end 87 | sample = [sample;Z(i,:)]; 88 | end 89 | 90 | % Sample selection 91 | if mod(t,batch_size)== 0 92 | 93 | b = b + 1; 94 | 95 | % Performing prediction on newly generated samples 96 | predict = ClassifierPredict([sample ones(size(sample,1),1)],model); 97 | 98 | % Adding incorrectly classified samples to the training set 99 | idx = (predict(:,1)==0); 100 | new_train = [sample(idx,:) ones(size(sample(idx,:),1),1)]; 101 | numaddinst(b) = size(new_train,1); 102 | 103 | train = [new_train; train]; 104 | model = ClassifierTrain(train,wc); 105 | 106 | test_pred = ClassifierPredict(test_data,model); 107 | eval = Evaluate(test_data(:,end),test_pred); 108 | sensitivity = [sensitivity;eval(2)]; 109 | 110 | % Stopping criteria: 111 | % Include only constant of ascending order values in sliding window 112 | % If the standard deviation is less that a certain value, then stop 113 | % and find the batch number which gives the maximum value. Revert 114 | % the training instances to that point and return. 115 | 116 | if b==1 117 | slidewin = [slidewin; [sensitivity(b) b]]; 118 | continue 119 | end 120 | 121 | % Checking if the current value is greater than the last entry of the 122 | % sliding window 123 | winend = slidewin(end,:); 124 | if sensitivity(b) >= winend(1) 125 | slidewin = [slidewin; [sensitivity(b) b]]; 126 | end 127 | 128 | % Maintaining the size of the sliding window 129 | if size(slidewin,1) > sizewin 130 | slidewin = slidewin(2:end,:); 131 | end 132 | 133 | % Deciding on when to stop 134 | if (std(slidewin(:,1)) <= 0.02 && size(slidewin,1)==10) || (b-winend(2)>=15) 135 | [C,I] = max(slidewin(:,1)); 136 | revpoint = slidewin(I(1),:); 137 | revpoint = revpoint(2); 138 | if revpoint==b 139 | break 140 | else 141 | z = sum(numaddinst(revpoint+1:b)); 142 | train = train(z+1:end,:); 143 | break 144 | end 145 | end 146 | 147 | % Cleaning up sample 148 | sample = []; 149 | end 150 | 151 | end 152 | newsamples = train; 153 | % disp(sensitivity); 154 | % disp(slidewin); 155 | 156 | function prob = NumFactor(Z_i,k,tan) 157 | dependency = tan{1}; 158 | prob_table = tan{2}; 159 | prior = tan{3}; 160 | prob = 1; 161 | 162 | for i = 1:k 163 | cur_val = Z_i(i); 164 | 165 | dep = dependency(i); 166 | % Root of the tree 167 | if dep == -1 168 | pr = prob_table{i}(cur_val); 169 | else 170 | % Attribute has dependency 171 | dep_val = Z_i(dep); 172 | pr = prob_table{i}(dep_val,cur_val); 173 | end 174 | 175 | prob = prob * pr; 176 | end -------------------------------------------------------------------------------- /RACOG & wRACOG/data.csv: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,0 2 | 1,1,1,1,1,2,0 3 | 1,1,1,1,1,3,0 4 | 1,1,1,1,2,1,0 5 | 1,1,1,1,2,2,0 6 | 1,1,1,1,2,3,0 7 | 1,1,1,1,3,1,0 8 | 1,1,1,1,3,2,0 9 | 1,1,1,1,3,3,0 10 | 1,1,1,2,1,1,0 11 | 1,1,1,2,1,2,0 12 | 1,1,1,2,1,3,0 13 | 1,1,1,2,2,1,0 14 | 1,1,1,2,2,2,0 15 | 1,1,1,2,2,3,0 16 | 1,1,1,2,3,1,0 17 | 1,1,1,2,3,2,0 18 | 1,1,1,2,3,3,0 19 | 1,1,1,3,1,1,0 20 | 1,1,1,3,1,2,0 21 | 1,1,1,3,1,3,0 22 | 1,1,1,3,2,1,0 23 | 1,1,1,3,2,2,0 24 | 1,1,1,3,2,3,0 25 | 1,1,1,3,3,1,0 26 | 1,1,1,3,3,2,0 27 | 1,1,1,3,3,3,0 28 | 1,1,2,1,1,1,0 29 | 1,1,2,1,1,2,0 30 | 1,1,2,1,1,3,0 31 | 1,1,2,1,2,1,0 32 | 1,1,2,1,2,2,0 33 | 1,1,2,1,2,3,0 34 | 1,1,2,1,3,1,0 35 | 1,1,2,1,3,2,0 36 | 1,1,2,1,3,3,0 37 | 1,1,2,2,1,1,0 38 | 1,1,2,2,1,2,0 39 | 1,1,2,2,1,3,0 40 | 1,1,2,2,2,1,0 41 | 1,1,2,2,2,2,0 42 | 1,1,2,2,2,3,0 43 | 1,1,2,2,3,1,0 44 | 1,1,2,2,3,2,0 45 | 1,1,2,2,3,3,0 46 | 1,1,2,3,1,1,0 47 | 1,1,2,3,1,2,0 48 | 1,1,2,3,1,3,0 49 | 1,1,2,3,2,1,0 50 | 1,1,2,3,2,2,0 51 | 1,1,2,3,2,3,0 52 | 1,1,2,3,3,1,0 53 | 1,1,2,3,3,2,0 54 | 1,1,2,3,3,3,0 55 | 1,1,3,1,1,1,0 56 | 1,1,3,1,1,2,0 57 | 1,1,3,1,1,3,0 58 | 1,1,3,1,2,1,0 59 | 1,1,3,1,2,2,0 60 | 1,1,3,1,2,3,0 61 | 1,1,3,1,3,1,0 62 | 1,1,3,1,3,2,0 63 | 1,1,3,1,3,3,0 64 | 1,1,3,2,1,1,0 65 | 1,1,3,2,1,2,0 66 | 1,1,3,2,1,3,0 67 | 1,1,3,2,2,1,0 68 | 1,1,3,2,2,2,0 69 | 1,1,3,2,2,3,0 70 | 1,1,3,2,3,1,0 71 | 1,1,3,2,3,2,0 72 | 1,1,3,2,3,3,0 73 | 1,1,3,3,1,1,0 74 | 1,1,3,3,1,2,0 75 | 1,1,3,3,1,3,0 76 | 1,1,3,3,2,1,0 77 | 1,1,3,3,2,2,0 78 | 1,1,3,3,2,3,0 79 | 1,1,3,3,3,1,0 80 | 1,1,3,3,3,2,0 81 | 1,1,3,3,3,3,0 82 | 1,1,4,1,1,1,0 83 | 1,1,4,1,1,2,0 84 | 1,1,4,1,1,3,0 85 | 1,1,4,1,2,1,0 86 | 1,1,4,1,2,2,0 87 | 1,1,4,1,2,3,0 88 | 1,1,4,1,3,1,0 89 | 1,1,4,1,3,2,0 90 | 1,1,4,1,3,3,0 91 | 1,1,4,2,1,1,0 92 | 1,1,4,2,1,2,0 93 | 1,1,4,2,1,3,0 94 | 1,1,4,2,2,1,0 95 | 1,1,4,2,2,2,0 96 | 1,1,4,2,2,3,0 97 | 1,1,4,2,3,1,0 98 | 1,1,4,2,3,2,0 99 | 1,1,4,2,3,3,0 100 | 1,1,4,3,1,1,0 101 | 1,1,4,3,1,2,0 102 | 1,1,4,3,1,3,0 103 | 1,1,4,3,2,1,0 104 | 1,1,4,3,2,2,0 105 | 1,1,4,3,2,3,0 106 | 1,1,4,3,3,1,0 107 | 1,1,4,3,3,2,0 108 | 1,1,4,3,3,3,0 109 | 1,2,1,1,1,1,0 110 | 1,2,1,1,1,2,0 111 | 1,2,1,1,1,3,0 112 | 1,2,1,1,2,1,0 113 | 1,2,1,1,2,2,0 114 | 1,2,1,1,2,3,0 115 | 1,2,1,1,3,1,0 116 | 1,2,1,1,3,2,0 117 | 1,2,1,1,3,3,0 118 | 1,2,1,2,1,1,0 119 | 1,2,1,2,1,2,0 120 | 1,2,1,2,1,3,0 121 | 1,2,1,2,2,1,0 122 | 1,2,1,2,2,2,0 123 | 1,2,1,2,2,3,0 124 | 1,2,1,2,3,1,0 125 | 1,2,1,2,3,2,0 126 | 1,2,1,2,3,3,0 127 | 1,2,1,3,1,1,0 128 | 1,2,1,3,1,2,0 129 | 1,2,1,3,1,3,0 130 | 1,2,1,3,2,1,0 131 | 1,2,1,3,2,2,0 132 | 1,2,1,3,2,3,0 133 | 1,2,1,3,3,1,0 134 | 1,2,1,3,3,2,0 135 | 1,2,1,3,3,3,0 136 | 1,2,2,1,1,1,0 137 | 1,2,2,1,1,2,0 138 | 1,2,2,1,1,3,0 139 | 1,2,2,1,2,1,0 140 | 1,2,2,1,2,2,0 141 | 1,2,2,1,2,3,0 142 | 1,2,2,1,3,1,0 143 | 1,2,2,1,3,2,0 144 | 1,2,2,1,3,3,0 145 | 1,2,2,2,1,1,0 146 | 1,2,2,2,1,2,0 147 | 1,2,2,2,1,3,0 148 | 1,2,2,2,2,1,0 149 | 1,2,2,2,2,2,0 150 | 1,2,2,2,2,3,0 151 | 1,2,2,2,3,1,0 152 | 1,2,2,2,3,2,0 153 | 1,2,2,2,3,3,0 154 | 1,2,2,3,1,1,0 155 | 1,2,2,3,1,2,0 156 | 1,2,2,3,1,3,0 157 | 1,2,2,3,2,1,0 158 | 1,2,2,3,2,2,0 159 | 1,2,2,3,2,3,0 160 | 1,2,2,3,3,1,0 161 | 1,2,2,3,3,2,0 162 | 1,2,2,3,3,3,0 163 | 1,2,3,1,1,1,0 164 | 1,2,3,1,1,2,0 165 | 1,2,3,1,1,3,0 166 | 1,2,3,1,2,1,0 167 | 1,2,3,1,2,2,0 168 | 1,2,3,1,2,3,0 169 | 1,2,3,1,3,1,0 170 | 1,2,3,1,3,2,0 171 | 1,2,3,1,3,3,0 172 | 1,2,3,2,1,1,0 173 | 1,2,3,2,1,2,0 174 | 1,2,3,2,1,3,0 175 | 1,2,3,2,2,1,0 176 | 1,2,3,2,2,2,0 177 | 1,2,3,2,2,3,0 178 | 1,2,3,2,3,1,0 179 | 1,2,3,2,3,2,0 180 | 1,2,3,2,3,3,0 181 | 1,2,3,3,1,1,0 182 | 1,2,3,3,1,2,0 183 | 1,2,3,3,1,3,0 184 | 1,2,3,3,2,1,0 185 | 1,2,3,3,2,2,0 186 | 1,2,3,3,2,3,0 187 | 1,2,3,3,3,1,0 188 | 1,2,3,3,3,2,0 189 | 1,2,3,3,3,3,0 190 | 1,2,4,1,1,1,0 191 | 1,2,4,1,1,2,0 192 | 1,2,4,1,1,3,0 193 | 1,2,4,1,2,1,0 194 | 1,2,4,1,2,2,0 195 | 1,2,4,1,2,3,0 196 | 1,2,4,1,3,1,0 197 | 1,2,4,1,3,2,0 198 | 1,2,4,1,3,3,0 199 | 1,2,4,2,1,1,0 200 | 1,2,4,2,1,2,0 201 | 1,2,4,2,1,3,0 202 | 1,2,4,2,2,1,0 203 | 1,2,4,2,2,2,0 204 | 1,2,4,2,2,3,0 205 | 1,2,4,2,3,1,0 206 | 1,2,4,2,3,2,0 207 | 1,2,4,2,3,3,0 208 | 1,2,4,3,1,1,0 209 | 1,2,4,3,1,2,0 210 | 1,2,4,3,1,3,0 211 | 1,2,4,3,2,1,0 212 | 1,2,4,3,2,2,0 213 | 1,2,4,3,2,3,0 214 | 1,2,4,3,3,1,0 215 | 1,2,4,3,3,2,0 216 | 1,2,4,3,3,3,0 217 | 1,3,1,1,1,1,0 218 | 1,3,1,1,1,2,0 219 | 1,3,1,1,1,3,0 220 | 1,3,1,1,2,1,0 221 | 1,3,1,1,2,2,0 222 | 1,3,1,1,2,3,0 223 | 1,3,1,1,3,1,0 224 | 1,3,1,1,3,2,0 225 | 1,3,1,1,3,3,0 226 | 1,3,1,2,1,1,0 227 | 1,3,1,2,1,2,0 228 | 1,3,1,2,1,3,0 229 | 1,3,1,2,2,1,0 230 | 1,3,1,2,2,2,0 231 | 1,3,1,2,2,3,0 232 | 1,3,1,2,3,1,0 233 | 1,3,1,2,3,2,0 234 | 1,3,1,2,3,3,0 235 | 1,3,1,3,1,1,0 236 | 1,3,1,3,1,2,0 237 | 1,3,1,3,1,3,0 238 | 1,3,1,3,2,1,0 239 | 1,3,1,3,2,2,0 240 | 1,3,1,3,2,3,0 241 | 1,3,1,3,3,1,0 242 | 1,3,1,3,3,2,0 243 | 1,3,1,3,3,3,0 244 | 1,3,2,1,1,1,0 245 | 1,3,2,1,1,2,0 246 | 1,3,2,1,1,3,0 247 | 1,3,2,1,2,1,0 248 | 1,3,2,1,2,2,0 249 | 1,3,2,1,2,3,0 250 | 1,3,2,1,3,1,0 251 | 1,3,2,1,3,2,0 252 | 1,3,2,1,3,3,0 253 | 1,3,2,2,1,1,0 254 | 1,3,2,2,1,2,0 255 | 1,3,2,2,1,3,0 256 | 1,3,2,2,2,1,0 257 | 1,3,2,2,2,2,0 258 | 1,3,2,2,2,3,0 259 | 1,3,2,2,3,1,0 260 | 1,3,2,2,3,2,0 261 | 1,3,2,2,3,3,0 262 | 1,3,2,3,1,1,0 263 | 1,3,2,3,1,2,0 264 | 1,3,2,3,1,3,0 265 | 1,3,2,3,2,1,0 266 | 1,3,2,3,2,2,0 267 | 1,3,2,3,2,3,0 268 | 1,3,2,3,3,1,0 269 | 1,3,2,3,3,2,0 270 | 1,3,2,3,3,3,0 271 | 1,3,3,1,1,1,0 272 | 1,3,3,1,1,2,0 273 | 1,3,3,1,1,3,0 274 | 1,3,3,1,2,1,0 275 | 1,3,3,1,2,2,0 276 | 1,3,3,1,2,3,0 277 | 1,3,3,1,3,1,0 278 | 1,3,3,1,3,2,0 279 | 1,3,3,1,3,3,0 280 | 1,3,3,2,1,1,0 281 | 1,3,3,2,1,2,0 282 | 1,3,3,2,1,3,0 283 | 1,3,3,2,2,1,0 284 | 1,3,3,2,2,2,0 285 | 1,3,3,2,2,3,0 286 | 1,3,3,2,3,1,0 287 | 1,3,3,2,3,2,0 288 | 1,3,3,2,3,3,0 289 | 1,3,3,3,1,1,0 290 | 1,3,3,3,1,2,0 291 | 1,3,3,3,1,3,0 292 | 1,3,3,3,2,1,0 293 | 1,3,3,3,2,2,0 294 | 1,3,3,3,2,3,0 295 | 1,3,3,3,3,1,0 296 | 1,3,3,3,3,2,0 297 | 1,3,3,3,3,3,0 298 | 1,3,4,1,1,1,0 299 | 1,3,4,1,1,2,0 300 | 1,3,4,1,1,3,0 301 | 1,3,4,1,2,1,0 302 | 1,3,4,1,2,2,0 303 | 1,3,4,1,2,3,0 304 | 1,3,4,1,3,1,0 305 | 1,3,4,1,3,2,0 306 | 1,3,4,1,3,3,0 307 | 1,3,4,2,1,1,0 308 | 1,3,4,2,1,2,0 309 | 1,3,4,2,1,3,0 310 | 1,3,4,2,2,1,0 311 | 1,3,4,2,2,2,0 312 | 1,3,4,2,2,3,0 313 | 1,3,4,2,3,1,0 314 | 1,3,4,2,3,2,0 315 | 1,3,4,2,3,3,0 316 | 1,3,4,3,1,1,0 317 | 1,3,4,3,1,2,0 318 | 1,3,4,3,1,3,0 319 | 1,3,4,3,2,1,0 320 | 1,3,4,3,2,2,0 321 | 1,3,4,3,2,3,0 322 | 1,3,4,3,3,1,0 323 | 1,3,4,3,3,2,0 324 | 1,3,4,3,3,3,0 325 | 1,4,1,1,1,1,0 326 | 1,4,1,1,1,2,0 327 | 1,4,1,1,1,3,0 328 | 1,4,1,1,2,1,0 329 | 1,4,1,1,2,2,0 330 | 1,4,1,1,2,3,0 331 | 1,4,1,1,3,1,0 332 | 1,4,1,1,3,2,0 333 | 1,4,1,1,3,3,0 334 | 1,4,1,2,1,1,0 335 | 1,4,1,2,1,2,0 336 | 1,4,1,2,1,3,0 337 | 1,4,1,2,2,1,0 338 | 1,4,1,2,2,2,0 339 | 1,4,1,2,2,3,0 340 | 1,4,1,2,3,1,0 341 | 1,4,1,2,3,2,0 342 | 1,4,1,2,3,3,0 343 | 1,4,1,3,1,1,0 344 | 1,4,1,3,1,2,0 345 | 1,4,1,3,1,3,0 346 | 1,4,1,3,2,1,0 347 | 1,4,1,3,2,2,0 348 | 1,4,1,3,2,3,0 349 | 1,4,1,3,3,1,0 350 | 1,4,1,3,3,2,0 351 | 1,4,1,3,3,3,0 352 | 1,4,2,1,1,1,0 353 | 1,4,2,1,1,2,0 354 | 1,4,2,1,1,3,0 355 | 1,4,2,1,2,1,0 356 | 1,4,2,1,2,2,0 357 | 1,4,2,1,2,3,0 358 | 1,4,2,1,3,1,0 359 | 1,4,2,1,3,2,0 360 | 1,4,2,1,3,3,0 361 | 1,4,2,2,1,1,0 362 | 1,4,2,2,1,2,0 363 | 1,4,2,2,1,3,0 364 | 1,4,2,2,2,1,0 365 | 1,4,2,2,2,2,0 366 | 1,4,2,2,2,3,0 367 | 1,4,2,2,3,1,0 368 | 1,4,2,2,3,2,0 369 | 1,4,2,2,3,3,0 370 | 1,4,2,3,1,1,0 371 | 1,4,2,3,1,2,0 372 | 1,4,2,3,1,3,0 373 | 1,4,2,3,2,1,0 374 | 1,4,2,3,2,2,0 375 | 1,4,2,3,2,3,0 376 | 1,4,2,3,3,1,0 377 | 1,4,2,3,3,2,0 378 | 1,4,2,3,3,3,0 379 | 1,4,3,1,1,1,0 380 | 1,4,3,1,1,2,0 381 | 1,4,3,1,1,3,0 382 | 1,4,3,1,2,1,0 383 | 1,4,3,1,2,2,0 384 | 1,4,3,1,2,3,0 385 | 1,4,3,1,3,1,0 386 | 1,4,3,1,3,2,0 387 | 1,4,3,1,3,3,0 388 | 1,4,3,2,1,1,0 389 | 1,4,3,2,1,2,0 390 | 1,4,3,2,1,3,0 391 | 1,4,3,2,2,1,0 392 | 1,4,3,2,2,2,0 393 | 1,4,3,2,2,3,0 394 | 1,4,3,2,3,1,0 395 | 1,4,3,2,3,2,0 396 | 1,4,3,2,3,3,0 397 | 1,4,3,3,1,1,0 398 | 1,4,3,3,1,2,0 399 | 1,4,3,3,1,3,0 400 | 1,4,3,3,2,1,0 401 | 1,4,3,3,2,2,0 402 | 1,4,3,3,2,3,0 403 | 1,4,3,3,3,1,0 404 | 1,4,3,3,3,2,0 405 | 1,4,3,3,3,3,0 406 | 1,4,4,1,1,1,0 407 | 1,4,4,1,1,2,0 408 | 1,4,4,1,1,3,0 409 | 1,4,4,1,2,1,0 410 | 1,4,4,1,2,2,0 411 | 1,4,4,1,2,3,0 412 | 1,4,4,1,3,1,0 413 | 1,4,4,1,3,2,0 414 | 1,4,4,1,3,3,0 415 | 1,4,4,2,1,1,0 416 | 1,4,4,2,1,2,0 417 | 1,4,4,2,1,3,0 418 | 1,4,4,2,2,1,0 419 | 1,4,4,2,2,2,0 420 | 1,4,4,2,2,3,0 421 | 1,4,4,2,3,1,0 422 | 1,4,4,2,3,2,0 423 | 1,4,4,2,3,3,0 424 | 1,4,4,3,1,1,0 425 | 1,4,4,3,1,2,0 426 | 1,4,4,3,1,3,0 427 | 1,4,4,3,2,1,0 428 | 1,4,4,3,2,2,0 429 | 1,4,4,3,2,3,0 430 | 1,4,4,3,3,1,0 431 | 1,4,4,3,3,2,0 432 | 1,4,4,3,3,3,0 433 | 2,1,1,1,1,1,0 434 | 2,1,1,1,1,2,0 435 | 2,1,1,1,1,3,0 436 | 2,1,1,1,2,1,0 437 | 2,1,1,1,2,2,0 438 | 2,1,1,1,2,3,0 439 | 2,1,1,1,3,1,0 440 | 2,1,1,1,3,2,0 441 | 2,1,1,1,3,3,0 442 | 2,1,1,2,1,1,0 443 | 2,1,1,2,1,2,0 444 | 2,1,1,2,1,3,0 445 | 2,1,1,2,2,1,0 446 | 2,1,1,2,2,2,0 447 | 2,1,1,2,2,3,0 448 | 2,1,1,2,3,1,0 449 | 2,1,1,2,3,2,0 450 | 2,1,1,2,3,3,0 451 | 2,1,1,3,1,1,0 452 | 2,1,1,3,1,2,0 453 | 2,1,1,3,1,3,0 454 | 2,1,1,3,2,1,0 455 | 2,1,1,3,2,2,0 456 | 2,1,1,3,2,3,0 457 | 2,1,1,3,3,1,0 458 | 2,1,1,3,3,2,0 459 | 2,1,1,3,3,3,0 460 | 2,1,2,1,1,1,0 461 | 2,1,2,1,1,2,0 462 | 2,1,2,1,1,3,0 463 | 2,1,2,1,2,1,0 464 | 2,1,2,1,2,2,0 465 | 2,1,2,1,2,3,0 466 | 2,1,2,1,3,1,0 467 | 2,1,2,1,3,2,0 468 | 2,1,2,1,3,3,0 469 | 2,1,2,2,1,1,0 470 | 2,1,2,2,1,2,0 471 | 2,1,2,2,1,3,0 472 | 2,1,2,2,2,1,0 473 | 2,1,2,2,2,2,0 474 | 2,1,2,2,2,3,0 475 | 2,1,2,2,3,1,0 476 | 2,1,2,2,3,2,0 477 | 2,1,2,2,3,3,0 478 | 2,1,2,3,1,1,0 479 | 2,1,2,3,1,2,0 480 | 2,1,2,3,1,3,0 481 | 2,1,2,3,2,1,0 482 | 2,1,2,3,2,2,0 483 | 2,1,2,3,2,3,0 484 | 2,1,2,3,3,1,0 485 | 2,1,2,3,3,2,0 486 | 2,1,2,3,3,3,0 487 | 2,1,3,1,1,1,0 488 | 2,1,3,1,1,2,0 489 | 2,1,3,1,1,3,0 490 | 2,1,3,1,2,1,0 491 | 2,1,3,1,2,2,0 492 | 2,1,3,1,2,3,0 493 | 2,1,3,1,3,1,0 494 | 2,1,3,1,3,2,0 495 | 2,1,3,1,3,3,0 496 | 2,1,3,2,1,1,0 497 | 2,1,3,2,1,2,0 498 | 2,1,3,2,1,3,0 499 | 2,1,3,2,2,1,0 500 | 2,1,3,2,2,2,0 501 | 2,1,3,2,2,3,0 502 | 2,1,3,2,3,1,0 503 | 2,1,3,2,3,2,0 504 | 2,1,3,2,3,3,0 505 | 2,1,3,3,1,1,0 506 | 2,1,3,3,1,2,0 507 | 2,1,3,3,1,3,0 508 | 2,1,3,3,2,1,0 509 | 2,1,3,3,2,2,0 510 | 2,1,3,3,2,3,0 511 | 2,1,3,3,3,1,0 512 | 2,1,3,3,3,2,0 513 | 2,1,3,3,3,3,0 514 | 2,1,4,1,1,1,0 515 | 2,1,4,1,1,2,0 516 | 2,1,4,1,1,3,0 517 | 2,1,4,1,2,1,0 518 | 2,1,4,1,2,2,0 519 | 2,1,4,1,2,3,0 520 | 2,1,4,1,3,1,0 521 | 2,1,4,1,3,2,0 522 | 2,1,4,1,3,3,0 523 | 2,1,4,2,1,1,0 524 | 2,1,4,2,1,2,0 525 | 2,1,4,2,1,3,0 526 | 2,1,4,2,2,1,0 527 | 2,1,4,2,2,2,0 528 | 2,1,4,2,2,3,0 529 | 2,1,4,2,3,1,0 530 | 2,1,4,2,3,2,0 531 | 2,1,4,2,3,3,0 532 | 2,1,4,3,1,1,0 533 | 2,1,4,3,1,2,0 534 | 2,1,4,3,1,3,0 535 | 2,1,4,3,2,1,0 536 | 2,1,4,3,2,2,0 537 | 2,1,4,3,2,3,0 538 | 2,1,4,3,3,1,0 539 | 2,1,4,3,3,2,0 540 | 2,1,4,3,3,3,0 541 | 2,2,1,1,1,1,0 542 | 2,2,1,1,1,2,0 543 | 2,2,1,1,1,3,0 544 | 2,2,1,1,2,1,0 545 | 2,2,1,1,2,2,0 546 | 2,2,1,1,2,3,0 547 | 2,2,1,1,3,1,0 548 | 2,2,1,1,3,2,0 549 | 2,2,1,1,3,3,0 550 | 2,2,1,2,1,1,0 551 | 2,2,1,2,1,2,0 552 | 2,2,1,2,1,3,0 553 | 2,2,1,2,2,1,0 554 | 2,2,1,2,2,2,0 555 | 2,2,1,2,2,3,0 556 | 2,2,1,2,3,1,0 557 | 2,2,1,2,3,2,0 558 | 2,2,1,2,3,3,0 559 | 2,2,1,3,1,1,0 560 | 2,2,1,3,1,2,0 561 | 2,2,1,3,1,3,0 562 | 2,2,1,3,2,1,0 563 | 2,2,1,3,2,2,0 564 | 2,2,1,3,2,3,0 565 | 2,2,1,3,3,1,0 566 | 2,2,1,3,3,2,0 567 | 2,2,1,3,3,3,0 568 | 2,2,2,1,1,1,0 569 | 2,2,2,1,1,2,0 570 | 2,2,2,1,1,3,0 571 | 2,2,2,1,2,1,0 572 | 2,2,2,1,2,2,0 573 | 2,2,2,1,2,3,0 574 | 2,2,2,1,3,1,0 575 | 2,2,2,1,3,2,0 576 | 2,2,2,1,3,3,0 577 | 2,2,2,2,1,1,0 578 | 2,2,2,2,1,2,0 579 | 2,2,2,2,1,3,0 580 | 2,2,2,2,2,1,0 581 | 2,2,2,2,2,2,0 582 | 2,2,2,2,2,3,0 583 | 2,2,2,2,3,1,0 584 | 2,2,2,2,3,2,0 585 | 2,2,2,2,3,3,0 586 | 2,2,2,3,1,1,0 587 | 2,2,2,3,1,2,0 588 | 2,2,2,3,1,3,0 589 | 2,2,2,3,2,1,0 590 | 2,2,2,3,2,2,0 591 | 2,2,2,3,2,3,0 592 | 2,2,2,3,3,1,0 593 | 2,2,2,3,3,2,0 594 | 2,2,2,3,3,3,0 595 | 2,2,3,1,1,1,0 596 | 2,2,3,1,1,2,0 597 | 2,2,3,1,1,3,0 598 | 2,2,3,1,2,1,0 599 | 2,2,3,1,2,2,0 600 | 2,2,3,1,2,3,0 601 | 2,2,3,1,3,1,0 602 | 2,2,3,1,3,2,0 603 | 2,2,3,1,3,3,0 604 | 2,2,3,2,1,1,0 605 | 2,2,3,2,1,2,0 606 | 2,2,3,2,1,3,0 607 | 2,2,3,2,2,1,0 608 | 2,2,3,2,2,2,0 609 | 2,2,3,2,2,3,0 610 | 2,2,3,2,3,1,0 611 | 2,2,3,2,3,2,0 612 | 2,2,3,2,3,3,0 613 | 2,2,3,3,1,1,0 614 | 2,2,3,3,1,2,0 615 | 2,2,3,3,1,3,0 616 | 2,2,3,3,2,1,0 617 | 2,2,3,3,2,2,0 618 | 2,2,3,3,2,3,0 619 | 2,2,3,3,3,1,0 620 | 2,2,3,3,3,2,0 621 | 2,2,3,3,3,3,0 622 | 2,2,4,1,1,1,0 623 | 2,2,4,1,1,2,0 624 | 2,2,4,1,1,3,0 625 | 2,2,4,1,2,1,0 626 | 2,2,4,1,2,2,0 627 | 2,2,4,1,2,3,0 628 | 2,2,4,1,3,1,0 629 | 2,2,4,1,3,2,0 630 | 2,2,4,1,3,3,0 631 | 2,2,4,2,1,1,0 632 | 2,2,4,2,1,2,0 633 | 2,2,4,2,1,3,0 634 | 2,2,4,2,2,1,0 635 | 2,2,4,2,2,2,0 636 | 2,2,4,2,2,3,0 637 | 2,2,4,2,3,1,0 638 | 2,2,4,2,3,2,0 639 | 2,2,4,2,3,3,0 640 | 2,2,4,3,1,1,0 641 | 2,2,4,3,1,2,0 642 | 2,2,4,3,1,3,0 643 | 2,2,4,3,2,1,0 644 | 2,2,4,3,2,2,0 645 | 2,2,4,3,2,3,0 646 | 2,2,4,3,3,1,0 647 | 2,2,4,3,3,2,0 648 | 2,2,4,3,3,3,0 649 | 2,3,1,1,1,1,0 650 | 2,3,1,1,1,2,0 651 | 2,3,1,1,1,3,0 652 | 2,3,1,1,2,1,0 653 | 2,3,1,1,2,2,0 654 | 2,3,1,1,2,3,0 655 | 2,3,1,1,3,1,0 656 | 2,3,1,1,3,2,0 657 | 2,3,1,1,3,3,0 658 | 2,3,1,2,1,1,0 659 | 2,3,1,2,1,2,0 660 | 2,3,1,2,1,3,0 661 | 2,3,1,2,2,1,0 662 | 2,3,1,2,2,2,0 663 | 2,3,1,2,2,3,0 664 | 2,3,1,2,3,1,0 665 | 2,3,1,2,3,2,0 666 | 2,3,1,2,3,3,0 667 | 2,3,1,3,1,1,0 668 | 2,3,1,3,1,2,0 669 | 2,3,1,3,1,3,0 670 | 2,3,1,3,2,1,0 671 | 2,3,1,3,2,2,0 672 | 2,3,1,3,2,3,0 673 | 2,3,1,3,3,1,0 674 | 2,3,1,3,3,2,0 675 | 2,3,1,3,3,3,0 676 | 2,3,2,1,1,1,0 677 | 2,3,2,1,1,2,0 678 | 2,3,2,1,1,3,0 679 | 2,3,2,1,2,1,0 680 | 2,3,2,1,2,2,0 681 | 2,3,2,1,2,3,0 682 | 2,3,2,1,3,1,0 683 | 2,3,2,1,3,2,0 684 | 2,3,2,1,3,3,0 685 | 2,3,2,2,1,1,0 686 | 2,3,2,2,1,2,0 687 | 2,3,2,2,1,3,0 688 | 2,3,2,2,2,1,0 689 | 2,3,2,2,2,2,0 690 | 2,3,2,2,2,3,0 691 | 2,3,2,2,3,1,0 692 | 2,3,2,2,3,2,0 693 | 2,3,2,2,3,3,0 694 | 2,3,2,3,1,1,0 695 | 2,3,2,3,1,2,0 696 | 2,3,2,3,1,3,0 697 | 2,3,2,3,2,1,0 698 | 2,3,2,3,2,2,0 699 | 2,3,2,3,2,3,0 700 | 2,3,2,3,3,1,0 701 | 2,3,2,3,3,2,0 702 | 2,3,2,3,3,3,0 703 | 2,3,3,1,1,1,0 704 | 2,3,3,1,1,2,0 705 | 2,3,3,1,1,3,0 706 | 2,3,3,1,2,1,0 707 | 2,3,3,1,2,2,0 708 | 2,3,3,1,2,3,0 709 | 2,3,3,1,3,1,0 710 | 2,3,3,1,3,2,0 711 | 2,3,3,1,3,3,0 712 | 2,3,3,2,1,1,0 713 | 2,3,3,2,1,2,0 714 | 2,3,3,2,1,3,0 715 | 2,3,3,2,2,1,0 716 | 2,3,3,2,2,2,0 717 | 2,3,3,2,2,3,0 718 | 2,3,3,2,3,1,0 719 | 2,3,3,2,3,2,0 720 | 2,3,3,2,3,3,0 721 | 2,3,3,3,1,1,0 722 | 2,3,3,3,1,2,0 723 | 2,3,3,3,1,3,0 724 | 2,3,3,3,2,1,0 725 | 2,3,3,3,2,2,0 726 | 2,3,3,3,2,3,0 727 | 2,3,3,3,3,1,0 728 | 2,3,3,3,3,2,0 729 | 2,3,3,3,3,3,0 730 | 2,3,4,1,1,1,0 731 | 2,3,4,1,1,2,0 732 | 2,3,4,1,1,3,0 733 | 2,3,4,1,2,1,0 734 | 2,3,4,1,2,2,0 735 | 2,3,4,1,2,3,0 736 | 2,3,4,1,3,1,0 737 | 2,3,4,1,3,2,0 738 | 2,3,4,1,3,3,0 739 | 2,3,4,2,1,1,0 740 | 2,3,4,2,1,2,0 741 | 2,3,4,2,1,3,0 742 | 2,3,4,2,2,1,0 743 | 2,3,4,2,2,2,0 744 | 2,3,4,2,2,3,0 745 | 2,3,4,2,3,1,0 746 | 2,3,4,2,3,2,0 747 | 2,3,4,2,3,3,0 748 | 2,3,4,3,1,1,0 749 | 2,3,4,3,1,2,0 750 | 2,3,4,3,1,3,0 751 | 2,3,4,3,2,1,0 752 | 2,3,4,3,2,2,0 753 | 2,3,4,3,2,3,0 754 | 2,3,4,3,3,1,0 755 | 2,3,4,3,3,2,0 756 | 2,3,4,3,3,3,0 757 | 2,4,1,1,1,1,0 758 | 2,4,1,1,1,2,0 759 | 2,4,1,1,1,3,0 760 | 2,4,1,1,2,1,0 761 | 2,4,1,1,2,2,0 762 | 2,4,1,1,2,3,0 763 | 2,4,1,1,3,1,0 764 | 2,4,1,1,3,2,0 765 | 2,4,1,1,3,3,0 766 | 2,4,1,2,1,1,0 767 | 2,4,1,2,1,2,0 768 | 2,4,1,2,1,3,0 769 | 2,4,1,2,2,1,0 770 | 2,4,1,2,2,2,0 771 | 2,4,1,2,2,3,0 772 | 2,4,1,2,3,1,0 773 | 2,4,1,2,3,2,0 774 | 2,4,1,2,3,3,0 775 | 2,4,1,3,1,1,0 776 | 2,4,1,3,1,2,0 777 | 2,4,1,3,1,3,0 778 | 2,4,1,3,2,1,0 779 | 2,4,1,3,2,2,0 780 | 2,4,1,3,2,3,0 781 | 2,4,1,3,3,1,0 782 | 2,4,1,3,3,2,0 783 | 2,4,1,3,3,3,0 784 | 2,4,2,1,1,1,0 785 | 2,4,2,1,1,2,0 786 | 2,4,2,1,1,3,0 787 | 2,4,2,1,2,1,0 788 | 2,4,2,1,2,2,0 789 | 2,4,2,1,2,3,0 790 | 2,4,2,1,3,1,0 791 | 2,4,2,1,3,2,0 792 | 2,4,2,1,3,3,0 793 | 2,4,2,2,1,1,0 794 | 2,4,2,2,1,2,0 795 | 2,4,2,2,1,3,0 796 | 2,4,2,2,2,1,0 797 | 2,4,2,2,2,2,0 798 | 2,4,2,2,2,3,0 799 | 2,4,2,2,3,1,0 800 | 2,4,2,2,3,2,0 801 | 2,4,2,2,3,3,0 802 | 2,4,2,3,1,1,0 803 | 2,4,2,3,1,2,0 804 | 2,4,2,3,1,3,0 805 | 2,4,2,3,2,1,0 806 | 2,4,2,3,2,2,0 807 | 2,4,2,3,2,3,0 808 | 2,4,2,3,3,1,0 809 | 2,4,2,3,3,2,0 810 | 2,4,2,3,3,3,0 811 | 2,4,3,1,1,1,0 812 | 2,4,3,1,1,2,0 813 | 2,4,3,1,1,3,0 814 | 2,4,3,1,2,1,0 815 | 2,4,3,1,2,2,0 816 | 2,4,3,1,2,3,0 817 | 2,4,3,1,3,1,0 818 | 2,4,3,1,3,2,0 819 | 2,4,3,1,3,3,0 820 | 2,4,3,2,1,1,0 821 | 2,4,3,2,1,2,0 822 | 2,4,3,2,1,3,0 823 | 2,4,3,2,2,1,0 824 | 2,4,3,2,2,2,0 825 | 2,4,3,2,2,3,0 826 | 2,4,3,2,3,1,0 827 | 2,4,3,2,3,2,0 828 | 2,4,3,2,3,3,0 829 | 2,4,3,3,1,1,0 830 | 2,4,3,3,1,2,0 831 | 2,4,3,3,1,3,0 832 | 2,4,3,3,2,1,0 833 | 2,4,3,3,2,2,0 834 | 2,4,3,3,2,3,0 835 | 2,4,3,3,3,1,0 836 | 2,4,3,3,3,2,0 837 | 2,4,3,3,3,3,0 838 | 2,4,4,1,1,1,0 839 | 2,4,4,1,1,2,0 840 | 2,4,4,1,1,3,0 841 | 2,4,4,1,2,1,0 842 | 2,4,4,1,2,2,0 843 | 2,4,4,1,2,3,0 844 | 2,4,4,1,3,1,0 845 | 2,4,4,1,3,2,0 846 | 2,4,4,1,3,3,0 847 | 2,4,4,2,1,1,0 848 | 2,4,4,2,1,2,0 849 | 2,4,4,2,1,3,0 850 | 2,4,4,2,2,1,0 851 | 2,4,4,2,2,2,0 852 | 2,4,4,2,2,3,0 853 | 2,4,4,2,3,1,0 854 | 2,4,4,2,3,2,0 855 | 2,4,4,2,3,3,0 856 | 2,4,4,3,1,1,0 857 | 2,4,4,3,1,2,0 858 | 2,4,4,3,1,3,0 859 | 2,4,4,3,2,1,0 860 | 2,4,4,3,2,2,0 861 | 2,4,4,3,2,3,0 862 | 2,4,4,3,3,1,0 863 | 2,4,4,3,3,2,0 864 | 2,4,4,3,3,3,0 865 | 3,1,1,1,1,1,0 866 | 3,1,1,1,1,2,0 867 | 3,1,1,1,1,3,0 868 | 3,1,1,1,2,1,0 869 | 3,1,1,1,2,2,0 870 | 3,1,1,1,2,3,0 871 | 3,1,1,1,3,1,0 872 | 3,1,1,1,3,2,0 873 | 3,1,1,1,3,3,0 874 | 3,1,1,2,1,1,0 875 | 3,1,1,2,1,2,0 876 | 3,1,1,2,1,3,0 877 | 3,1,1,2,2,1,0 878 | 3,1,1,2,2,2,0 879 | 3,1,1,2,2,3,0 880 | 3,1,1,2,3,1,0 881 | 3,1,1,2,3,2,0 882 | 3,1,1,2,3,3,0 883 | 3,1,1,3,1,1,0 884 | 3,1,1,3,1,2,0 885 | 3,1,1,3,1,3,0 886 | 3,1,1,3,2,1,0 887 | 3,1,1,3,2,2,0 888 | 3,1,1,3,2,3,0 889 | 3,1,1,3,3,1,0 890 | 3,1,1,3,3,2,0 891 | 3,1,1,3,3,3,0 892 | 3,1,2,1,1,1,0 893 | 3,1,2,1,1,2,0 894 | 3,1,2,1,1,3,0 895 | 3,1,2,1,2,1,0 896 | 3,1,2,1,2,2,0 897 | 3,1,2,1,2,3,0 898 | 3,1,2,1,3,1,0 899 | 3,1,2,1,3,2,0 900 | 3,1,2,1,3,3,0 901 | 3,1,2,2,1,1,0 902 | 3,1,2,2,1,2,0 903 | 3,1,2,2,1,3,0 904 | 3,1,2,2,2,1,0 905 | 3,1,2,2,2,2,0 906 | 3,1,2,2,2,3,0 907 | 3,1,2,2,3,1,0 908 | 3,1,2,2,3,2,0 909 | 3,1,2,2,3,3,0 910 | 3,1,2,3,1,1,0 911 | 3,1,2,3,1,2,0 912 | 3,1,2,3,1,3,0 913 | 3,1,2,3,2,1,0 914 | 3,1,2,3,2,2,0 915 | 3,1,2,3,2,3,0 916 | 3,1,2,3,3,1,0 917 | 3,1,2,3,3,2,0 918 | 3,1,2,3,3,3,0 919 | 3,1,3,1,1,1,0 920 | 3,1,3,1,1,2,0 921 | 3,1,3,1,1,3,0 922 | 3,1,3,1,2,1,0 923 | 3,1,3,1,2,2,0 924 | 3,1,3,1,2,3,0 925 | 3,1,3,1,3,1,0 926 | 3,1,3,1,3,2,0 927 | 3,1,3,1,3,3,0 928 | 3,1,3,2,1,1,0 929 | 3,1,3,2,1,2,0 930 | 3,1,3,2,1,3,0 931 | 3,1,3,2,2,1,0 932 | 3,1,3,2,2,2,0 933 | 3,1,3,2,2,3,0 934 | 3,1,3,2,3,1,0 935 | 3,1,3,2,3,2,0 936 | 3,1,3,2,3,3,0 937 | 3,1,3,3,1,1,0 938 | 3,1,3,3,1,2,0 939 | 3,1,3,3,1,3,0 940 | 3,1,3,3,2,1,0 941 | 3,1,3,3,2,2,0 942 | 3,1,3,3,2,3,0 943 | 3,1,3,3,3,1,0 944 | 3,1,3,3,3,2,0 945 | 3,1,3,3,3,3,0 946 | 3,1,4,1,1,1,0 947 | 3,1,4,1,1,2,0 948 | 3,1,4,1,1,3,0 949 | 3,1,4,1,2,1,0 950 | 3,1,4,1,2,2,0 951 | 3,1,4,1,2,3,0 952 | 3,1,4,1,3,1,0 953 | 3,1,4,1,3,2,0 954 | 3,1,4,1,3,3,0 955 | 3,1,4,2,1,1,0 956 | 3,1,4,2,1,2,0 957 | 3,1,4,2,1,3,0 958 | 3,1,4,2,2,1,0 959 | 3,1,4,2,2,2,0 960 | 3,1,4,2,2,3,0 961 | 3,1,4,2,3,1,0 962 | 3,1,4,2,3,2,0 963 | 3,1,4,2,3,3,0 964 | 3,1,4,3,1,1,0 965 | 3,1,4,3,1,2,0 966 | 3,1,4,3,1,3,0 967 | 3,1,4,3,2,1,0 968 | 3,1,4,3,2,2,0 969 | 3,1,4,3,2,3,0 970 | 3,1,4,3,3,1,0 971 | 3,1,4,3,3,2,0 972 | 3,1,4,3,3,3,0 973 | 3,2,1,1,1,1,0 974 | 3,2,1,1,1,2,0 975 | 3,2,1,1,1,3,0 976 | 3,2,1,1,2,1,0 977 | 3,2,1,1,2,2,0 978 | 3,2,1,1,2,3,0 979 | 3,2,1,1,3,1,0 980 | 3,2,1,1,3,2,0 981 | 3,2,1,1,3,3,0 982 | 3,2,1,2,1,1,0 983 | 3,2,1,2,1,2,0 984 | 3,2,1,2,1,3,0 985 | 3,2,1,2,2,1,0 986 | 3,2,1,2,2,2,0 987 | 3,2,1,2,2,3,0 988 | 3,2,1,2,3,1,0 989 | 3,2,1,2,3,2,0 990 | 3,2,1,2,3,3,0 991 | 3,2,1,3,1,1,0 992 | 3,2,1,3,1,2,0 993 | 3,2,1,3,1,3,0 994 | 3,2,1,3,2,1,0 995 | 3,2,1,3,2,2,0 996 | 3,2,1,3,2,3,0 997 | 3,2,1,3,3,1,0 998 | 3,2,1,3,3,2,0 999 | 3,2,1,3,3,3,0 1000 | 3,2,2,1,1,1,0 1001 | 3,2,2,1,1,2,0 1002 | 3,2,2,1,1,3,0 1003 | 3,2,2,1,2,1,0 1004 | 3,2,2,1,2,2,0 1005 | 3,2,2,1,2,3,0 1006 | 3,2,2,1,3,1,0 1007 | 3,2,2,1,3,2,0 1008 | 3,2,2,1,3,3,0 1009 | 3,2,2,2,1,1,0 1010 | 3,2,2,2,1,2,0 1011 | 3,2,2,2,1,3,0 1012 | 3,2,2,2,2,1,0 1013 | 3,2,2,2,2,2,0 1014 | 3,2,2,2,2,3,0 1015 | 3,2,2,2,3,1,0 1016 | 3,2,2,2,3,2,0 1017 | 3,2,2,2,3,3,0 1018 | 3,2,2,3,1,1,0 1019 | 3,2,2,3,1,2,0 1020 | 3,2,2,3,1,3,0 1021 | 3,2,2,3,2,1,0 1022 | 3,2,2,3,2,2,0 1023 | 3,2,2,3,2,3,0 1024 | 3,2,2,3,3,1,0 1025 | 3,2,2,3,3,2,0 1026 | 3,2,2,3,3,3,0 1027 | 3,2,3,1,1,1,0 1028 | 3,2,3,1,1,2,0 1029 | 3,2,3,1,1,3,0 1030 | 3,2,3,1,2,1,0 1031 | 3,2,3,1,2,2,0 1032 | 3,2,3,1,2,3,0 1033 | 3,2,3,1,3,1,0 1034 | 3,2,3,1,3,2,0 1035 | 3,2,3,1,3,3,0 1036 | 3,2,3,2,1,1,0 1037 | 3,2,3,2,1,2,0 1038 | 3,2,3,2,1,3,0 1039 | 3,2,3,2,2,1,0 1040 | 3,2,3,2,2,2,0 1041 | 3,2,3,2,2,3,0 1042 | 3,2,3,2,3,1,0 1043 | 3,2,3,2,3,2,0 1044 | 3,2,3,2,3,3,0 1045 | 3,2,3,3,1,1,0 1046 | 3,2,3,3,1,2,0 1047 | 3,2,3,3,1,3,0 1048 | 3,2,3,3,2,1,0 1049 | 3,2,3,3,2,2,0 1050 | 3,2,3,3,2,3,0 1051 | 3,2,3,3,3,1,0 1052 | 3,2,3,3,3,2,0 1053 | 3,2,3,3,3,3,0 1054 | 3,2,4,1,1,1,0 1055 | 3,2,4,1,1,2,0 1056 | 3,2,4,1,1,3,0 1057 | 3,2,4,1,2,1,0 1058 | 3,2,4,1,2,2,0 1059 | 3,2,4,1,2,3,0 1060 | 3,2,4,1,3,1,0 1061 | 3,2,4,1,3,2,0 1062 | 3,2,4,1,3,3,0 1063 | 3,2,4,2,1,1,0 1064 | 3,2,4,2,1,2,0 1065 | 3,2,4,2,1,3,0 1066 | 3,2,4,2,2,1,0 1067 | 3,2,4,2,2,2,0 1068 | 3,2,4,2,2,3,0 1069 | 3,2,4,2,3,1,0 1070 | 3,2,4,2,3,2,0 1071 | 3,2,4,2,3,3,0 1072 | 3,2,4,3,1,1,0 1073 | 3,2,4,3,1,2,0 1074 | 3,2,4,3,1,3,0 1075 | 3,2,4,3,2,1,0 1076 | 3,2,4,3,2,2,0 1077 | 3,2,4,3,2,3,0 1078 | 3,2,4,3,3,1,0 1079 | 3,2,4,3,3,2,0 1080 | 3,2,4,3,3,3,0 1081 | 3,3,1,1,1,1,0 1082 | 3,3,1,1,1,2,0 1083 | 3,3,1,1,1,3,0 1084 | 3,3,1,1,2,1,0 1085 | 3,3,1,1,2,2,0 1086 | 3,3,1,1,2,3,0 1087 | 3,3,1,1,3,1,0 1088 | 3,3,1,1,3,2,0 1089 | 3,3,1,1,3,3,0 1090 | 3,3,1,2,1,1,0 1091 | 3,3,1,2,1,2,0 1092 | 3,3,1,2,1,3,0 1093 | 3,3,1,2,2,1,0 1094 | 3,3,1,2,2,2,0 1095 | 3,3,1,2,2,3,0 1096 | 3,3,1,2,3,1,0 1097 | 3,3,1,2,3,2,0 1098 | 3,3,1,2,3,3,0 1099 | 3,3,1,3,1,1,0 1100 | 3,3,1,3,1,2,0 1101 | 3,3,1,3,1,3,0 1102 | 3,3,1,3,2,1,0 1103 | 3,3,1,3,2,2,0 1104 | 3,3,1,3,2,3,0 1105 | 3,3,1,3,3,1,0 1106 | 3,3,1,3,3,2,0 1107 | 3,3,1,3,3,3,0 1108 | 3,3,2,1,1,1,0 1109 | 3,3,2,1,1,2,0 1110 | 3,3,2,1,1,3,0 1111 | 3,3,2,1,2,1,0 1112 | 3,3,2,1,2,2,0 1113 | 3,3,2,1,2,3,0 1114 | 3,3,2,1,3,1,0 1115 | 3,3,2,1,3,2,0 1116 | 3,3,2,1,3,3,0 1117 | 3,3,2,2,1,1,0 1118 | 3,3,2,2,1,2,0 1119 | 3,3,2,2,1,3,0 1120 | 3,3,2,2,2,1,0 1121 | 3,3,2,2,2,2,0 1122 | 3,3,2,2,2,3,0 1123 | 3,3,2,2,3,1,0 1124 | 3,3,2,2,3,2,0 1125 | 3,3,2,2,3,3,0 1126 | 3,3,2,3,1,1,0 1127 | 3,3,2,3,1,2,0 1128 | 3,3,2,3,1,3,0 1129 | 3,3,2,3,2,1,0 1130 | 3,3,2,3,2,2,0 1131 | 3,3,2,3,2,3,0 1132 | 3,3,2,3,3,1,0 1133 | 3,3,2,3,3,2,0 1134 | 3,3,2,3,3,3,0 1135 | 3,3,3,1,1,1,0 1136 | 3,3,3,1,1,2,0 1137 | 3,3,3,1,1,3,0 1138 | 3,3,3,1,2,1,0 1139 | 3,3,3,1,2,2,0 1140 | 3,3,3,1,2,3,0 1141 | 3,3,3,1,3,1,0 1142 | 3,3,3,1,3,2,0 1143 | 3,3,3,1,3,3,0 1144 | 3,3,3,2,1,1,0 1145 | 3,3,3,2,1,2,0 1146 | 3,3,3,2,1,3,0 1147 | 3,3,3,2,2,1,0 1148 | 3,3,3,2,2,2,0 1149 | 3,3,3,2,2,3,0 1150 | 3,3,3,2,3,1,0 1151 | 3,3,3,2,3,2,0 1152 | 3,3,3,2,3,3,0 1153 | 3,3,3,3,1,1,0 1154 | 3,3,3,3,1,2,0 1155 | 3,3,3,3,1,3,0 1156 | 3,3,3,3,2,1,0 1157 | 3,3,3,3,2,2,0 1158 | 3,3,3,3,2,3,0 1159 | 3,3,3,3,3,1,0 1160 | 3,3,3,3,3,2,0 1161 | 3,3,3,3,3,3,0 1162 | 3,3,4,1,1,1,0 1163 | 3,3,4,1,1,2,0 1164 | 3,3,4,1,1,3,0 1165 | 3,3,4,1,2,1,0 1166 | 3,3,4,1,2,2,0 1167 | 3,3,4,1,2,3,0 1168 | 3,3,4,1,3,1,0 1169 | 3,3,4,1,3,2,0 1170 | 3,3,4,1,3,3,0 1171 | 3,3,4,2,1,1,0 1172 | 3,3,4,2,1,2,0 1173 | 3,3,4,2,1,3,0 1174 | 3,3,4,2,2,1,0 1175 | 3,3,4,2,2,2,0 1176 | 3,3,4,2,2,3,0 1177 | 3,3,4,2,3,1,0 1178 | 3,3,4,2,3,2,0 1179 | 3,3,4,2,3,3,0 1180 | 3,3,4,3,1,1,0 1181 | 3,3,4,3,1,2,0 1182 | 3,3,4,3,1,3,0 1183 | 3,3,4,3,2,1,0 1184 | 3,3,4,3,2,2,0 1185 | 3,3,4,3,2,3,0 1186 | 3,3,4,3,3,1,0 1187 | 3,3,4,3,3,2,0 1188 | 3,3,4,3,3,3,0 1189 | 3,4,1,1,1,1,0 1190 | 3,4,1,1,1,2,0 1191 | 3,4,1,1,1,3,0 1192 | 3,4,1,1,2,1,0 1193 | 3,4,1,1,2,2,0 1194 | 3,4,1,1,2,3,0 1195 | 3,4,1,1,3,1,0 1196 | 3,4,1,1,3,2,0 1197 | 3,4,1,1,3,3,0 1198 | 3,4,1,2,1,1,0 1199 | 3,4,1,2,1,2,0 1200 | 3,4,1,2,1,3,1 1201 | 3,4,1,2,2,1,0 1202 | 3,4,1,2,2,2,0 1203 | 3,4,1,2,2,3,1 1204 | 3,4,1,2,3,1,0 1205 | 3,4,1,2,3,2,1 1206 | 3,4,1,2,3,3,0 1207 | 3,4,1,3,1,1,0 1208 | 3,4,1,3,1,2,0 1209 | 3,4,1,3,1,3,0 1210 | 3,4,1,3,2,1,0 1211 | 3,4,1,3,2,2,0 1212 | 3,4,1,3,2,3,1 1213 | 3,4,1,3,3,1,0 1214 | 3,4,1,3,3,2,1 1215 | 3,4,1,3,3,3,0 1216 | 3,4,2,1,1,1,0 1217 | 3,4,2,1,1,2,0 1218 | 3,4,2,1,1,3,0 1219 | 3,4,2,1,2,1,0 1220 | 3,4,2,1,2,2,0 1221 | 3,4,2,1,2,3,0 1222 | 3,4,2,1,3,1,0 1223 | 3,4,2,1,3,2,0 1224 | 3,4,2,1,3,3,0 1225 | 3,4,2,2,1,1,0 1226 | 3,4,2,2,1,2,0 1227 | 3,4,2,2,1,3,1 1228 | 3,4,2,2,2,1,0 1229 | 3,4,2,2,2,2,0 1230 | 3,4,2,2,2,3,1 1231 | 3,4,2,2,3,1,0 1232 | 3,4,2,2,3,2,1 1233 | 3,4,2,2,3,3,0 1234 | 3,4,2,3,1,1,0 1235 | 3,4,2,3,1,2,0 1236 | 3,4,2,3,1,3,1 1237 | 3,4,2,3,2,1,0 1238 | 3,4,2,3,2,2,1 1239 | 3,4,2,3,2,3,0 1240 | 3,4,2,3,3,1,0 1241 | 3,4,2,3,3,2,1 1242 | 3,4,2,3,3,3,0 1243 | 3,4,3,1,1,1,0 1244 | 3,4,3,1,1,2,0 1245 | 3,4,3,1,1,3,0 1246 | 3,4,3,1,2,1,0 1247 | 3,4,3,1,2,2,0 1248 | 3,4,3,1,2,3,0 1249 | 3,4,3,1,3,1,0 1250 | 3,4,3,1,3,2,0 1251 | 3,4,3,1,3,3,0 1252 | 3,4,3,2,1,1,0 1253 | 3,4,3,2,1,2,0 1254 | 3,4,3,2,1,3,1 1255 | 3,4,3,2,2,1,0 1256 | 3,4,3,2,2,2,1 1257 | 3,4,3,2,2,3,0 1258 | 3,4,3,2,3,1,0 1259 | 3,4,3,2,3,2,1 1260 | 3,4,3,2,3,3,0 1261 | 3,4,3,3,1,1,0 1262 | 3,4,3,3,1,2,0 1263 | 3,4,3,3,1,3,1 1264 | 3,4,3,3,2,1,0 1265 | 3,4,3,3,2,2,1 1266 | 3,4,3,3,2,3,0 1267 | 3,4,3,3,3,1,0 1268 | 3,4,3,3,3,2,1 1269 | 3,4,3,3,3,3,0 1270 | 3,4,4,1,1,1,0 1271 | 3,4,4,1,1,2,0 1272 | 3,4,4,1,1,3,0 1273 | 3,4,4,1,2,1,0 1274 | 3,4,4,1,2,2,0 1275 | 3,4,4,1,2,3,0 1276 | 3,4,4,1,3,1,0 1277 | 3,4,4,1,3,2,0 1278 | 3,4,4,1,3,3,0 1279 | 3,4,4,2,1,1,0 1280 | 3,4,4,2,1,2,0 1281 | 3,4,4,2,1,3,1 1282 | 3,4,4,2,2,1,0 1283 | 3,4,4,2,2,2,1 1284 | 3,4,4,2,2,3,0 1285 | 3,4,4,2,3,1,0 1286 | 3,4,4,2,3,2,1 1287 | 3,4,4,2,3,3,0 1288 | 3,4,4,3,1,1,0 1289 | 3,4,4,3,1,2,0 1290 | 3,4,4,3,1,3,1 1291 | 3,4,4,3,2,1,0 1292 | 3,4,4,3,2,2,1 1293 | 3,4,4,3,2,3,0 1294 | 3,4,4,3,3,1,0 1295 | 3,4,4,3,3,2,1 1296 | 3,4,4,3,3,3,0 1297 | 4,1,1,1,1,1,0 1298 | 4,1,1,1,1,2,0 1299 | 4,1,1,1,1,3,0 1300 | 4,1,1,1,2,1,0 1301 | 4,1,1,1,2,2,0 1302 | 4,1,1,1,2,3,0 1303 | 4,1,1,1,3,1,0 1304 | 4,1,1,1,3,2,0 1305 | 4,1,1,1,3,3,0 1306 | 4,1,1,2,1,1,0 1307 | 4,1,1,2,1,2,0 1308 | 4,1,1,2,1,3,0 1309 | 4,1,1,2,2,1,0 1310 | 4,1,1,2,2,2,0 1311 | 4,1,1,2,2,3,0 1312 | 4,1,1,2,3,1,0 1313 | 4,1,1,2,3,2,0 1314 | 4,1,1,2,3,3,0 1315 | 4,1,1,3,1,1,0 1316 | 4,1,1,3,1,2,0 1317 | 4,1,1,3,1,3,0 1318 | 4,1,1,3,2,1,0 1319 | 4,1,1,3,2,2,0 1320 | 4,1,1,3,2,3,0 1321 | 4,1,1,3,3,1,0 1322 | 4,1,1,3,3,2,0 1323 | 4,1,1,3,3,3,0 1324 | 4,1,2,1,1,1,0 1325 | 4,1,2,1,1,2,0 1326 | 4,1,2,1,1,3,0 1327 | 4,1,2,1,2,1,0 1328 | 4,1,2,1,2,2,0 1329 | 4,1,2,1,2,3,0 1330 | 4,1,2,1,3,1,0 1331 | 4,1,2,1,3,2,0 1332 | 4,1,2,1,3,3,0 1333 | 4,1,2,2,1,1,0 1334 | 4,1,2,2,1,2,0 1335 | 4,1,2,2,1,3,0 1336 | 4,1,2,2,2,1,0 1337 | 4,1,2,2,2,2,0 1338 | 4,1,2,2,2,3,0 1339 | 4,1,2,2,3,1,0 1340 | 4,1,2,2,3,2,0 1341 | 4,1,2,2,3,3,0 1342 | 4,1,2,3,1,1,0 1343 | 4,1,2,3,1,2,0 1344 | 4,1,2,3,1,3,0 1345 | 4,1,2,3,2,1,0 1346 | 4,1,2,3,2,2,0 1347 | 4,1,2,3,2,3,0 1348 | 4,1,2,3,3,1,0 1349 | 4,1,2,3,3,2,0 1350 | 4,1,2,3,3,3,0 1351 | 4,1,3,1,1,1,0 1352 | 4,1,3,1,1,2,0 1353 | 4,1,3,1,1,3,0 1354 | 4,1,3,1,2,1,0 1355 | 4,1,3,1,2,2,0 1356 | 4,1,3,1,2,3,0 1357 | 4,1,3,1,3,1,0 1358 | 4,1,3,1,3,2,0 1359 | 4,1,3,1,3,3,0 1360 | 4,1,3,2,1,1,0 1361 | 4,1,3,2,1,2,0 1362 | 4,1,3,2,1,3,0 1363 | 4,1,3,2,2,1,0 1364 | 4,1,3,2,2,2,0 1365 | 4,1,3,2,2,3,0 1366 | 4,1,3,2,3,1,0 1367 | 4,1,3,2,3,2,0 1368 | 4,1,3,2,3,3,0 1369 | 4,1,3,3,1,1,0 1370 | 4,1,3,3,1,2,0 1371 | 4,1,3,3,1,3,0 1372 | 4,1,3,3,2,1,0 1373 | 4,1,3,3,2,2,0 1374 | 4,1,3,3,2,3,0 1375 | 4,1,3,3,3,1,0 1376 | 4,1,3,3,3,2,0 1377 | 4,1,3,3,3,3,0 1378 | 4,1,4,1,1,1,0 1379 | 4,1,4,1,1,2,0 1380 | 4,1,4,1,1,3,0 1381 | 4,1,4,1,2,1,0 1382 | 4,1,4,1,2,2,0 1383 | 4,1,4,1,2,3,0 1384 | 4,1,4,1,3,1,0 1385 | 4,1,4,1,3,2,0 1386 | 4,1,4,1,3,3,0 1387 | 4,1,4,2,1,1,0 1388 | 4,1,4,2,1,2,0 1389 | 4,1,4,2,1,3,0 1390 | 4,1,4,2,2,1,0 1391 | 4,1,4,2,2,2,0 1392 | 4,1,4,2,2,3,0 1393 | 4,1,4,2,3,1,0 1394 | 4,1,4,2,3,2,0 1395 | 4,1,4,2,3,3,0 1396 | 4,1,4,3,1,1,0 1397 | 4,1,4,3,1,2,0 1398 | 4,1,4,3,1,3,0 1399 | 4,1,4,3,2,1,0 1400 | 4,1,4,3,2,2,0 1401 | 4,1,4,3,2,3,0 1402 | 4,1,4,3,3,1,0 1403 | 4,1,4,3,3,2,0 1404 | 4,1,4,3,3,3,0 1405 | 4,2,1,1,1,1,0 1406 | 4,2,1,1,1,2,0 1407 | 4,2,1,1,1,3,0 1408 | 4,2,1,1,2,1,0 1409 | 4,2,1,1,2,2,0 1410 | 4,2,1,1,2,3,0 1411 | 4,2,1,1,3,1,0 1412 | 4,2,1,1,3,2,0 1413 | 4,2,1,1,3,3,0 1414 | 4,2,1,2,1,1,0 1415 | 4,2,1,2,1,2,0 1416 | 4,2,1,2,1,3,0 1417 | 4,2,1,2,2,1,0 1418 | 4,2,1,2,2,2,0 1419 | 4,2,1,2,2,3,0 1420 | 4,2,1,2,3,1,0 1421 | 4,2,1,2,3,2,0 1422 | 4,2,1,2,3,3,0 1423 | 4,2,1,3,1,1,0 1424 | 4,2,1,3,1,2,0 1425 | 4,2,1,3,1,3,0 1426 | 4,2,1,3,2,1,0 1427 | 4,2,1,3,2,2,0 1428 | 4,2,1,3,2,3,0 1429 | 4,2,1,3,3,1,0 1430 | 4,2,1,3,3,2,0 1431 | 4,2,1,3,3,3,0 1432 | 4,2,2,1,1,1,0 1433 | 4,2,2,1,1,2,0 1434 | 4,2,2,1,1,3,0 1435 | 4,2,2,1,2,1,0 1436 | 4,2,2,1,2,2,0 1437 | 4,2,2,1,2,3,0 1438 | 4,2,2,1,3,1,0 1439 | 4,2,2,1,3,2,0 1440 | 4,2,2,1,3,3,0 1441 | 4,2,2,2,1,1,0 1442 | 4,2,2,2,1,2,0 1443 | 4,2,2,2,1,3,0 1444 | 4,2,2,2,2,1,0 1445 | 4,2,2,2,2,2,0 1446 | 4,2,2,2,2,3,0 1447 | 4,2,2,2,3,1,0 1448 | 4,2,2,2,3,2,0 1449 | 4,2,2,2,3,3,0 1450 | 4,2,2,3,1,1,0 1451 | 4,2,2,3,1,2,0 1452 | 4,2,2,3,1,3,0 1453 | 4,2,2,3,2,1,0 1454 | 4,2,2,3,2,2,0 1455 | 4,2,2,3,2,3,0 1456 | 4,2,2,3,3,1,0 1457 | 4,2,2,3,3,2,0 1458 | 4,2,2,3,3,3,0 1459 | 4,2,3,1,1,1,0 1460 | 4,2,3,1,1,2,0 1461 | 4,2,3,1,1,3,0 1462 | 4,2,3,1,2,1,0 1463 | 4,2,3,1,2,2,0 1464 | 4,2,3,1,2,3,0 1465 | 4,2,3,1,3,1,0 1466 | 4,2,3,1,3,2,0 1467 | 4,2,3,1,3,3,0 1468 | 4,2,3,2,1,1,0 1469 | 4,2,3,2,1,2,0 1470 | 4,2,3,2,1,3,0 1471 | 4,2,3,2,2,1,0 1472 | 4,2,3,2,2,2,0 1473 | 4,2,3,2,2,3,0 1474 | 4,2,3,2,3,1,0 1475 | 4,2,3,2,3,2,0 1476 | 4,2,3,2,3,3,0 1477 | 4,2,3,3,1,1,0 1478 | 4,2,3,3,1,2,0 1479 | 4,2,3,3,1,3,0 1480 | 4,2,3,3,2,1,0 1481 | 4,2,3,3,2,2,0 1482 | 4,2,3,3,2,3,0 1483 | 4,2,3,3,3,1,0 1484 | 4,2,3,3,3,2,0 1485 | 4,2,3,3,3,3,0 1486 | 4,2,4,1,1,1,0 1487 | 4,2,4,1,1,2,0 1488 | 4,2,4,1,1,3,0 1489 | 4,2,4,1,2,1,0 1490 | 4,2,4,1,2,2,0 1491 | 4,2,4,1,2,3,0 1492 | 4,2,4,1,3,1,0 1493 | 4,2,4,1,3,2,0 1494 | 4,2,4,1,3,3,0 1495 | 4,2,4,2,1,1,0 1496 | 4,2,4,2,1,2,0 1497 | 4,2,4,2,1,3,0 1498 | 4,2,4,2,2,1,0 1499 | 4,2,4,2,2,2,0 1500 | 4,2,4,2,2,3,0 1501 | 4,2,4,2,3,1,0 1502 | 4,2,4,2,3,2,0 1503 | 4,2,4,2,3,3,0 1504 | 4,2,4,3,1,1,0 1505 | 4,2,4,3,1,2,0 1506 | 4,2,4,3,1,3,0 1507 | 4,2,4,3,2,1,0 1508 | 4,2,4,3,2,2,0 1509 | 4,2,4,3,2,3,0 1510 | 4,2,4,3,3,1,0 1511 | 4,2,4,3,3,2,0 1512 | 4,2,4,3,3,3,0 1513 | 4,3,1,1,1,1,0 1514 | 4,3,1,1,1,2,0 1515 | 4,3,1,1,1,3,0 1516 | 4,3,1,1,2,1,0 1517 | 4,3,1,1,2,2,0 1518 | 4,3,1,1,2,3,0 1519 | 4,3,1,1,3,1,0 1520 | 4,3,1,1,3,2,0 1521 | 4,3,1,1,3,3,0 1522 | 4,3,1,2,1,1,0 1523 | 4,3,1,2,1,2,0 1524 | 4,3,1,2,1,3,1 1525 | 4,3,1,2,2,1,0 1526 | 4,3,1,2,2,2,0 1527 | 4,3,1,2,2,3,1 1528 | 4,3,1,2,3,1,0 1529 | 4,3,1,2,3,2,1 1530 | 4,3,1,2,3,3,0 1531 | 4,3,1,3,1,1,0 1532 | 4,3,1,3,1,2,0 1533 | 4,3,1,3,1,3,0 1534 | 4,3,1,3,2,1,0 1535 | 4,3,1,3,2,2,0 1536 | 4,3,1,3,2,3,1 1537 | 4,3,1,3,3,1,0 1538 | 4,3,1,3,3,2,1 1539 | 4,3,1,3,3,3,0 1540 | 4,3,2,1,1,1,0 1541 | 4,3,2,1,1,2,0 1542 | 4,3,2,1,1,3,0 1543 | 4,3,2,1,2,1,0 1544 | 4,3,2,1,2,2,0 1545 | 4,3,2,1,2,3,0 1546 | 4,3,2,1,3,1,0 1547 | 4,3,2,1,3,2,0 1548 | 4,3,2,1,3,3,0 1549 | 4,3,2,2,1,1,0 1550 | 4,3,2,2,1,2,0 1551 | 4,3,2,2,1,3,1 1552 | 4,3,2,2,2,1,0 1553 | 4,3,2,2,2,2,0 1554 | 4,3,2,2,2,3,1 1555 | 4,3,2,2,3,1,0 1556 | 4,3,2,2,3,2,1 1557 | 4,3,2,2,3,3,0 1558 | 4,3,2,3,1,1,0 1559 | 4,3,2,3,1,2,0 1560 | 4,3,2,3,1,3,1 1561 | 4,3,2,3,2,1,0 1562 | 4,3,2,3,2,2,1 1563 | 4,3,2,3,2,3,0 1564 | 4,3,2,3,3,1,0 1565 | 4,3,2,3,3,2,1 1566 | 4,3,2,3,3,3,0 1567 | 4,3,3,1,1,1,0 1568 | 4,3,3,1,1,2,0 1569 | 4,3,3,1,1,3,0 1570 | 4,3,3,1,2,1,0 1571 | 4,3,3,1,2,2,0 1572 | 4,3,3,1,2,3,0 1573 | 4,3,3,1,3,1,0 1574 | 4,3,3,1,3,2,0 1575 | 4,3,3,1,3,3,0 1576 | 4,3,3,2,1,1,0 1577 | 4,3,3,2,1,2,0 1578 | 4,3,3,2,1,3,1 1579 | 4,3,3,2,2,1,0 1580 | 4,3,3,2,2,2,1 1581 | 4,3,3,2,2,3,0 1582 | 4,3,3,2,3,1,0 1583 | 4,3,3,2,3,2,1 1584 | 4,3,3,2,3,3,0 1585 | 4,3,3,3,1,1,0 1586 | 4,3,3,3,1,2,0 1587 | 4,3,3,3,1,3,1 1588 | 4,3,3,3,2,1,0 1589 | 4,3,3,3,2,2,1 1590 | 4,3,3,3,2,3,0 1591 | 4,3,3,3,3,1,0 1592 | 4,3,3,3,3,2,1 1593 | 4,3,3,3,3,3,0 1594 | 4,3,4,1,1,1,0 1595 | 4,3,4,1,1,2,0 1596 | 4,3,4,1,1,3,0 1597 | 4,3,4,1,2,1,0 1598 | 4,3,4,1,2,2,0 1599 | 4,3,4,1,2,3,0 1600 | 4,3,4,1,3,1,0 1601 | 4,3,4,1,3,2,0 1602 | 4,3,4,1,3,3,0 1603 | 4,3,4,2,1,1,0 1604 | 4,3,4,2,1,2,0 1605 | 4,3,4,2,1,3,1 1606 | 4,3,4,2,2,1,0 1607 | 4,3,4,2,2,2,1 1608 | 4,3,4,2,2,3,0 1609 | 4,3,4,2,3,1,0 1610 | 4,3,4,2,3,2,1 1611 | 4,3,4,2,3,3,0 1612 | 4,3,4,3,1,1,0 1613 | 4,3,4,3,1,2,0 1614 | 4,3,4,3,1,3,1 1615 | 4,3,4,3,2,1,0 1616 | 4,3,4,3,2,2,1 1617 | 4,3,4,3,2,3,0 1618 | 4,3,4,3,3,1,0 1619 | 4,3,4,3,3,2,1 1620 | 4,3,4,3,3,3,0 1621 | 4,4,1,1,1,1,0 1622 | 4,4,1,1,1,2,0 1623 | 4,4,1,1,1,3,0 1624 | 4,4,1,1,2,1,0 1625 | 4,4,1,1,2,2,0 1626 | 4,4,1,1,2,3,0 1627 | 4,4,1,1,3,1,0 1628 | 4,4,1,1,3,2,0 1629 | 4,4,1,1,3,3,0 1630 | 4,4,1,2,1,1,0 1631 | 4,4,1,2,1,2,0 1632 | 4,4,1,2,1,3,1 1633 | 4,4,1,2,2,1,0 1634 | 4,4,1,2,2,2,0 1635 | 4,4,1,2,2,3,1 1636 | 4,4,1,2,3,1,0 1637 | 4,4,1,2,3,2,1 1638 | 4,4,1,2,3,3,0 1639 | 4,4,1,3,1,1,0 1640 | 4,4,1,3,1,2,0 1641 | 4,4,1,3,1,3,0 1642 | 4,4,1,3,2,1,0 1643 | 4,4,1,3,2,2,0 1644 | 4,4,1,3,2,3,1 1645 | 4,4,1,3,3,1,0 1646 | 4,4,1,3,3,2,1 1647 | 4,4,1,3,3,3,0 1648 | 4,4,2,1,1,1,0 1649 | 4,4,2,1,1,2,0 1650 | 4,4,2,1,1,3,0 1651 | 4,4,2,1,2,1,0 1652 | 4,4,2,1,2,2,0 1653 | 4,4,2,1,2,3,0 1654 | 4,4,2,1,3,1,0 1655 | 4,4,2,1,3,2,0 1656 | 4,4,2,1,3,3,0 1657 | 4,4,2,2,1,1,0 1658 | 4,4,2,2,1,2,0 1659 | 4,4,2,2,1,3,1 1660 | 4,4,2,2,2,1,0 1661 | 4,4,2,2,2,2,0 1662 | 4,4,2,2,2,3,1 1663 | 4,4,2,2,3,1,0 1664 | 4,4,2,2,3,2,1 1665 | 4,4,2,2,3,3,0 1666 | 4,4,2,3,1,1,0 1667 | 4,4,2,3,1,2,0 1668 | 4,4,2,3,1,3,1 1669 | 4,4,2,3,2,1,0 1670 | 4,4,2,3,2,2,1 1671 | 4,4,2,3,2,3,0 1672 | 4,4,2,3,3,1,0 1673 | 4,4,2,3,3,2,1 1674 | 4,4,2,3,3,3,0 1675 | 4,4,3,1,1,1,0 1676 | 4,4,3,1,1,2,0 1677 | 4,4,3,1,1,3,0 1678 | 4,4,3,1,2,1,0 1679 | 4,4,3,1,2,2,0 1680 | 4,4,3,1,2,3,0 1681 | 4,4,3,1,3,1,0 1682 | 4,4,3,1,3,2,0 1683 | 4,4,3,1,3,3,0 1684 | 4,4,3,2,1,1,0 1685 | 4,4,3,2,1,2,0 1686 | 4,4,3,2,1,3,1 1687 | 4,4,3,2,2,1,0 1688 | 4,4,3,2,2,2,1 1689 | 4,4,3,2,2,3,0 1690 | 4,4,3,2,3,1,0 1691 | 4,4,3,2,3,2,1 1692 | 4,4,3,2,3,3,0 1693 | 4,4,3,3,1,1,0 1694 | 4,4,3,3,1,2,0 1695 | 4,4,3,3,1,3,1 1696 | 4,4,3,3,2,1,0 1697 | 4,4,3,3,2,2,1 1698 | 4,4,3,3,2,3,0 1699 | 4,4,3,3,3,1,0 1700 | 4,4,3,3,3,2,1 1701 | 4,4,3,3,3,3,0 1702 | 4,4,4,1,1,1,0 1703 | 4,4,4,1,1,2,0 1704 | 4,4,4,1,1,3,0 1705 | 4,4,4,1,2,1,0 1706 | 4,4,4,1,2,2,0 1707 | 4,4,4,1,2,3,0 1708 | 4,4,4,1,3,1,0 1709 | 4,4,4,1,3,2,0 1710 | 4,4,4,1,3,3,0 1711 | 4,4,4,2,1,1,0 1712 | 4,4,4,2,1,2,0 1713 | 4,4,4,2,1,3,1 1714 | 4,4,4,2,2,1,0 1715 | 4,4,4,2,2,2,1 1716 | 4,4,4,2,2,3,0 1717 | 4,4,4,2,3,1,0 1718 | 4,4,4,2,3,2,1 1719 | 4,4,4,2,3,3,0 1720 | 4,4,4,3,1,1,0 1721 | 4,4,4,3,1,2,0 1722 | 4,4,4,3,1,3,1 1723 | 4,4,4,3,2,1,0 1724 | 4,4,4,3,2,2,1 1725 | 4,4,4,3,2,3,0 1726 | 4,4,4,3,3,1,0 1727 | 4,4,4,3,3,2,1 1728 | 4,4,4,3,3,3,0 1729 | -------------------------------------------------------------------------------- /RACOG & wRACOG/wRACOG.m: -------------------------------------------------------------------------------- 1 | clc; 2 | clear all; 3 | close all; 4 | 5 | file = 'data.csv'; % Dataset 6 | folds = 5; % Value of k in K-fold Cross Validation 7 | wc = 'tree'; % Wrapper Classifiers: tree, knn, logistic, smo 8 | 9 | % Reading training file 10 | data = dlmread(file); 11 | label = data(:,end); 12 | 13 | % Extracting positive data points 14 | idx = (label==1); 15 | pos_data = data(idx,:); 16 | row_pos = size(pos_data,1); 17 | 18 | % Extracting negative data points 19 | neg_data = data(~idx,:); 20 | row_neg = size(neg_data,1); 21 | 22 | % Performing tests on 4 different classifiers 23 | results = cell(4,1); 24 | 25 | for fold = 1:folds 26 | disp (['Fold: ' int2str(fold)]); 27 | disp ('----------------------------------------------'); 28 | % Random permuation of positive and negative data points 29 | p = randperm(row_pos); 30 | n = randperm(row_neg); 31 | 32 | % Always use 80-20 split 33 | tstpf = p(1:round(row_pos/5)); 34 | tstnf = n(1:round(row_neg/5)); 35 | trpf = setdiff(p, tstpf); 36 | trnf = setdiff(n, tstnf); 37 | 38 | train_data = [pos_data(trpf,:);neg_data(trnf,:)]; 39 | test_data = [pos_data(tstpf,:);neg_data(tstnf,:)]; 40 | train_pos = pos_data(trpf,:); 41 | 42 | % Defining the initial probability distribution 43 | [dependency prob prior] = TAN(train_pos(:,1:end-1)); 44 | tan = {dependency,prob,prior}; 45 | 46 | % Generating samples using Gibbs Sampler 47 | new_data = WrapperGibbsSampler(train_data,tan,wc,test_data); 48 | 49 | % Decision Tree 50 | disp('Testing with J48 ...'); 51 | model = ClassifierTrain(new_data,'tree'); 52 | predicted = ClassifierPredict(test_data,model); 53 | eval = Evaluate(test_data(:,end),predicted); 54 | results{1} = [results{1}; eval]; 55 | 56 | % SVM 57 | disp('Testing with SMO ...'); 58 | model = ClassifierTrain(new_data,'svm'); 59 | predicted = ClassifierPredict(test_data,model); 60 | eval = Evaluate(test_data(:,end),predicted); 61 | results{2} = [results{2}; eval]; 62 | 63 | % kNN 64 | disp('Testing with IBk ...'); 65 | model = ClassifierTrain(new_data,'knn'); 66 | predicted = ClassifierPredict(test_data,model); 67 | eval = Evaluate(test_data(:,end),predicted); 68 | results{3} = [results{3}; eval]; 69 | 70 | % Logistic Regression 71 | disp('Testing with Logistic ...'); 72 | model = ClassifierTrain(new_data,'logistic'); 73 | predicted = ClassifierPredict(test_data,model); 74 | eval = Evaluate(test_data(:,end),predicted); 75 | results{4} = [results{4}; eval]; 76 | 77 | end 78 | 79 | disp('*********************************************************************************'); 80 | disp('Classifier: J48'); 81 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 82 | % disp(results{1}); 83 | disp(mean(results{1})); 84 | disp(std(results{1})); 85 | 86 | disp('Classifier: SMO'); 87 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 88 | % disp(results{2}); 89 | disp(mean(results{2})); 90 | disp(std(results{2})); 91 | 92 | disp('Classifier: kNN'); 93 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 94 | % disp(results{3}); 95 | disp(mean(results{3})); 96 | disp(std(results{3})); 97 | 98 | disp('Classifier: Logistic Regression'); 99 | disp(' Accuracy Sensitivity Specificity FP Rate G-means Precision F-Measure AUC-ROC'); 100 | % disp(results{2}); 101 | disp(mean(results{4})); 102 | disp(std(results{4})); 103 | disp('*********************************************************************************'); 104 | -------------------------------------------------------------------------------- /RACOG & wRACOG/weka.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnandas/DataSamplingTools/c6501b4d5d4094e06f8bfb2daee42c02ee296a3c/RACOG & wRACOG/weka.jar -------------------------------------------------------------------------------- /RACOG_TKDE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnandas/DataSamplingTools/c6501b4d5d4094e06f8bfb2daee42c02ee296a3c/RACOG_TKDE.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | As machine learning techniques mature and are used to tackle complex scientific problems, challenges arise such 2 | as the imbalanced class distribution problem, where one of the target class labels is under-represented in comparison with 3 | other classes. Existing oversampling approaches for addressing this problem typically do not consider the probability distribution 4 | of the minority class while synthetically generating new samples. As a result, the minority class is not represented well which 5 | leads to high misclassification error. 6 | 7 | This repository contains two probabilistic oversampling approaches, namely RACOG and wRACOG, that can be used to 8 | to synthetically generate and strategically select new minority class samples. The proposed approaches use the joint 9 | probability distribution of data attributes and Gibbs sampling to generate new minority class samples. While RACOG selects 10 | samples produced by the Gibbs sampler based on a predefined lag, wRACOG selects those samples that have the highest 11 | probability of being misclassified by the existing learning model. In addition, this repository contains two other sampling techniques, 12 | namely, RUSBoost and SMOTEBoost. 13 | 14 | Please refer to the following article for more details: 15 | Das, B., Krishnan, N.C. and Cook, D.J., 2015. RACOG and wRACOG: 16 | Two Probabilistic Oversampling Techniques. Knowledge and Data Engineering, IEEE Transactions on, 27(1), pp.222-234. 17 | -------------------------------------------------------------------------------- /RUSBoost/ARFFheader.txt: -------------------------------------------------------------------------------- 1 | @relation sample 2 | 3 | @attribute att1 {1,2,3,4} 4 | @attribute att2 {1,2,3,4} 5 | @attribute att3 {1,2,3,4} 6 | @attribute att4 {1,2,3} 7 | @attribute att5 {1,2,3} 8 | @attribute att6 {1,2,3} 9 | @attribute class {0,1} 10 | 11 | @data 12 | -------------------------------------------------------------------------------- /RUSBoost/CSVtoARFF.m: -------------------------------------------------------------------------------- 1 | function r = CSVtoARFF (data, relation, type) 2 | % csv to arff file converter 3 | 4 | % load the csv data 5 | [rows cols] = size(data); 6 | 7 | % open the arff file for writing 8 | farff = fopen(strcat(type,'.arff'), 'w'); 9 | 10 | % print the relation part of the header 11 | fprintf(farff, '@relation %s', relation); 12 | 13 | % Reading from the ARFF header 14 | fid = fopen('ARFFheader.txt','r'); 15 | tline = fgets(fid); 16 | while ischar(tline) 17 | tline = fgets(fid); 18 | fprintf(farff,'%s',tline); 19 | end 20 | fclose(fid); 21 | 22 | % Converting the data 23 | for i = 1 : rows 24 | % print the attribute values for the data point 25 | for j = 1 : cols - 1 26 | if data(i,j) ~= -1 % check if it is a missing value 27 | fprintf(farff, '%d,', data(i,j)); 28 | else 29 | fprintf(farff, '?,'); 30 | end 31 | end 32 | % print the label for the data point 33 | fprintf(farff, '%d\n', data(i,end)); 34 | end 35 | 36 | % close the file 37 | fclose(farff); 38 | 39 | r = 0; -------------------------------------------------------------------------------- /RUSBoost/ClassifierPredict.m: -------------------------------------------------------------------------------- 1 | function prediction = ClassifierPredict(data,model) 2 | % Predicting the labels of the test instances 3 | % Input: data = test data 4 | % model = the trained model 5 | % type = type of classifier 6 | % Output: prediction = prediction labels 7 | 8 | javaaddpath('weka.jar'); 9 | 10 | CSVtoARFF(data,'test','test'); 11 | test_file = 'test.arff'; 12 | reader = javaObject('java.io.FileReader', test_file); 13 | test = javaObject('weka.core.Instances', reader); 14 | test.setClassIndex(test.numAttributes() - 1); 15 | 16 | prediction = []; 17 | for i = 0 : size(data,1) - 1 18 | p = model.classifyInstance(test.instance(i)); 19 | prediction = [prediction; p]; 20 | end -------------------------------------------------------------------------------- /RUSBoost/ClassifierTrain.m: -------------------------------------------------------------------------------- 1 | function model = ClassifierTrain(data,type) 2 | % Training the classifier that would do the sample selection 3 | 4 | javaaddpath('weka.jar'); 5 | 6 | CSVtoARFF(data,'train','train'); 7 | train_file = 'train.arff'; 8 | reader = javaObject('java.io.FileReader', train_file); 9 | train = javaObject('weka.core.Instances', reader); 10 | train.setClassIndex(train.numAttributes() - 1); 11 | % options = javaObject('java.lang.String'); 12 | 13 | switch type 14 | case 'svm' 15 | model = javaObject('weka.classifiers.functions.SMO'); 16 | kernel = javaObject('weka.classifiers.functions.supportVector.RBFKernel'); 17 | model.setKernel(kernel); 18 | case 'tree' 19 | model = javaObject('weka.classifiers.trees.J48'); 20 | % options = weka.core.Utils.splitOptions('-C 0.2'); 21 | % model.setOptions(options); 22 | case 'knn' 23 | model = javaObject('weka.classifiers.lazy.IBk'); 24 | model.setKNN(5); 25 | case 'logistic' 26 | model = javaObject('weka.classifiers.functions.Logistic'); 27 | end 28 | 29 | model.buildClassifier(train); -------------------------------------------------------------------------------- /RUSBoost/README.txt: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | Author: Barnan Das 3 | Email: barnandas@wsu.edu 4 | Homepage: www.eecs.wsu.edu/~bdas1 5 | Last Updated: June 25, 2012 6 | ****************************************************************************** 7 | 8 | Description of Algorithm: 9 | This code implements RUSBoost. RUSBoost is an algorithm to handle class 10 | imbalance problem in data with discrete class labels. It uses a combination of 11 | RUS (random under-sampling) and the standard boosting procedure AdaBoost, to 12 | better model the minority class by removing majority class samples. It is very 13 | similar to SMOTEBoost, which is another algorithm that combines boosting and 14 | data sampling, but claims to achieves the goal with random under-sampling (RUS) 15 | of majority class examples. This method results in a simpler algorithm with 16 | faster model training time. 17 | 18 | For more detail on the theoretical description of the algorithm please refer to 19 | the following paper: 20 | C. Seiffert, T.M. Khoshgoftaar, J. Van Hulse and A. Napolitano, "RUSBoost: 21 | A Hybrid Approach to Alleviating Class Imbalance, IEEE Transaction on Systems, 22 | Man and Cybernetics-Part A: Systems and Human, Vol.40(1), January 2010. 23 | 24 | Description of Implementation: 25 | The current implementation of RUSBoost has been independently done by the author 26 | for the purpose of research. In order to enable the users use a lot of different 27 | weak learners for boosting, an interface is created with Weka API. Currently, 28 | four Weka algortihms could be used as weak learner: J48, SMO, IBk, Logistic. It 29 | uses 10 boosting iterations and achieves a class imbalance ratio of 35:65 30 | (minority:majority) at each boosting iteration by removing the majority class 31 | samples. 32 | 33 | Files: 34 | weka.jar -> Weka jar file that is called by several Matlab scripts in this 35 | directory. 36 | 37 | train.arff, test.arff, resampled.arff -> ARFF (Weka compatible) files generated 38 | by some of the Matlab scripts. 39 | 40 | ARFFheader.txt -> Defines the ARFF header for the data file "data.csv". Please 41 | refer to the following link to learn more about ARFF format. 42 | http://www.cs.waikato.ac.nz/ml/weka/arff.html 43 | 44 | RUSBoost.m -> Matlab script that implements the RUSBoost algorithm. Please 45 | type "help RUSBoost" in Matlab Console to understand the arguments 46 | for this function. 47 | 48 | Test.m -> Matlab script that shows a sample code to use RUSBoost function in 49 | Matlab. 50 | 51 | ClassifierTrain.m, ClassifierPredict.m, CSVtoARFF.m -> Matlab functions used by 52 | RUSBoost.m 53 | 54 | 55 | **************************************xxx************************************** -------------------------------------------------------------------------------- /RUSBoost/RUSBoost.m: -------------------------------------------------------------------------------- 1 | function prediction = RUSBoost (TRAIN,TEST,WeakLearn) 2 | % This function implements the RUSBoost Algorithm. For more details on the 3 | % theoretical description of the algorithm please refer to the following 4 | % paper: 5 | % C. Seiffert, T.M. Khoshgoftaar, J. Van Hulse and A. Napolitano, 6 | % "RUSBoost: A Hybrid Approach to Alleviating Class Imbalance, IEEE 7 | % Transaction on Systems, Man and Cybernetics-Part A: Systems and Human, 8 | % Vol.40(1), January 2010. 9 | % Input: TRAIN = Training data as matrix 10 | % TEST = Test data as matrix 11 | % WeakLearn = String to choose algortihm. Choices are 12 | % 'svm','tree','knn' and 'logistic'. 13 | % Output: prediction = size(TEST,1)x 2 matrix. Col 1 is class labels for 14 | % all instances. Col 2 is probability of the instances 15 | % being classified as positive class. 16 | 17 | 18 | javaaddpath('weka.jar'); 19 | 20 | %% Training RUSBoost 21 | % Total number of instances in the training set 22 | m = size(TRAIN,1); 23 | POS_DATA = TRAIN(TRAIN(:,end)==1,:); 24 | NEG_DATA = TRAIN(TRAIN(:,end)==0,:); 25 | pos_size = size(POS_DATA,1); 26 | neg_size = size(NEG_DATA,1); 27 | 28 | % Reorganize TRAIN by putting all the positive and negative exampels 29 | % together, respectively. 30 | TRAIN = [POS_DATA;NEG_DATA]; 31 | 32 | % Converting training set into Weka compatible format 33 | CSVtoARFF (TRAIN, 'train', 'train'); 34 | train_reader = javaObject('java.io.FileReader', 'train.arff'); 35 | train = javaObject('weka.core.Instances', train_reader); 36 | train.setClassIndex(train.numAttributes() - 1); 37 | 38 | % 65% of NEG_DATA 39 | neg65 = round(pos_size * (65/35)); 40 | 41 | % Total number of iterations of the boosting method 42 | T = 10; 43 | 44 | % W stores the weights of the instances in each row for every iteration of 45 | % boosting. Weights for all the instances are initialized by 1/m for the 46 | % first iteration. 47 | W = zeros(1,m); 48 | for i = 1:m 49 | W(1,i) = 1/m; 50 | end 51 | 52 | % L stores pseudo loss values, H stores hypothesis, B stores (1/beta) 53 | % values that is used as the weight of the % hypothesis while forming the 54 | % final hypothesis. % All of the following are of length <=T and stores 55 | % values for every iteration of the boosting process. 56 | L = []; 57 | H = {}; 58 | B = []; 59 | 60 | % Loop counter 61 | t = 1; 62 | 63 | % Keeps counts of the number of times the same boosting iteration have been 64 | % repeated 65 | count = 0; 66 | 67 | % Boosting T iterations 68 | while t <= T 69 | 70 | % LOG MESSAGE 71 | disp (['Boosting iteration #' int2str(t)]); 72 | 73 | % Resampling NEG_DATA with weights of positive example 74 | RESAM_NEG = NEG_DATA(randsample(1:neg_size,neg65,false),:); 75 | RESAMPLED = [POS_DATA;RESAM_NEG]; 76 | 77 | % Converting resample training set into Weka compatible format 78 | CSVtoARFF (RESAMPLED,'resampled','resampled'); 79 | reader = javaObject('java.io.FileReader','resampled.arff'); 80 | resampled = javaObject('weka.core.Instances',reader); 81 | resampled.setClassIndex(resampled.numAttributes()-1); 82 | 83 | % Training a weak learner. 'pred' is the weak hypothesis. However, the 84 | % hypothesis function is encoded in 'model'. 85 | switch WeakLearn 86 | case 'svm' 87 | model = javaObject('weka.classifiers.functions.SMO'); 88 | case 'tree' 89 | model = javaObject('weka.classifiers.trees.J48'); 90 | case 'knn' 91 | model = javaObject('weka.classifiers.lazy.IBk'); 92 | model.setKNN(5); 93 | case 'logistic' 94 | model = javaObject('weka.classifiers.functions.Logistic'); 95 | end 96 | model.buildClassifier(resampled); 97 | 98 | pred = zeros(m,1); 99 | for i = 0 : m - 1 100 | pred(i+1) = model.classifyInstance(train.instance(i)); 101 | end 102 | 103 | % Computing the pseudo loss of hypothesis 'model' 104 | loss = 0; 105 | for i = 1:m 106 | if TRAIN(i,end)==pred(i) 107 | continue; 108 | else 109 | loss = loss + W(t,i); 110 | end 111 | end 112 | 113 | % If count exceeds a pre-defined threshold (5 in the current 114 | % implementation), the loop is broken and rolled back to the state 115 | % where loss > 0.5 was not encountered. 116 | if count > 5 117 | L = L(1:t-1); 118 | H = H(1:t-1); 119 | B = B(1:t-1); 120 | disp ('Too many iterations have loss > 0.5'); 121 | disp ('Aborting boosting...'); 122 | break; 123 | end 124 | 125 | % If the loss is greater than 1/2, it means that an inverted 126 | % hypothesis would perform better. In such cases, do not take that 127 | % hypothesis into consideration and repeat the same iteration. 'count' 128 | % keeps counts of the number of times the same boosting iteration have 129 | % been repeated 130 | if loss > 0.5 131 | count = count + 1; 132 | continue; 133 | else 134 | count = 1; 135 | end 136 | 137 | L(t) = loss; % Pseudo-loss at each iteration 138 | H{t} = model; % Hypothesis function 139 | beta = loss/(1-loss); % Setting weight update parameter 'beta'. 140 | B(t) = log(1/beta); % Weight of the hypothesis 141 | 142 | % At the final iteration there is no need to update the weights any 143 | % further 144 | if t==T 145 | break; 146 | end 147 | 148 | % Updating weight 149 | for i = 1:m 150 | if TRAIN(i,end)==pred(i) 151 | W(t+1,i) = W(t,i)*beta; 152 | else 153 | W(t+1,i) = W(t,i); 154 | end 155 | end 156 | 157 | % Normalizing the weight for the next iteration 158 | sum_W = sum(W(t+1,:)); 159 | for i = 1:m 160 | W(t+1,i) = W(t+1,i)/sum_W; 161 | end 162 | 163 | % Incrementing loop counter 164 | t = t + 1; 165 | end 166 | 167 | % The final hypothesis is calculated and tested on the test set 168 | % simulteneously. 169 | 170 | %% Testing RUSBoost 171 | n = size(TEST,1); % Total number of instances in the test set 172 | 173 | CSVtoARFF(TEST,'test','test'); 174 | test = 'test.arff'; 175 | test_reader = javaObject('java.io.FileReader', test); 176 | test = javaObject('weka.core.Instances', test_reader); 177 | test.setClassIndex(test.numAttributes() - 1); 178 | 179 | % Normalizing B 180 | sum_B = sum(B); 181 | for i = 1:size(B,2) 182 | B(i) = B(i)/sum_B; 183 | end 184 | 185 | prediction = zeros(n,2); 186 | 187 | for i = 1:n 188 | % Calculating the total weight of the class labels from all the models 189 | % produced during boosting 190 | wt_zero = 0; 191 | wt_one = 0; 192 | for j = 1:size(H,2) 193 | p = H{j}.classifyInstance(test.instance(i-1)); 194 | if p==1 195 | wt_one = wt_one + B(j); 196 | else 197 | wt_zero = wt_zero + B(j); 198 | end 199 | end 200 | 201 | if (wt_one > wt_zero) 202 | prediction(i,:) = [1 wt_one]; 203 | else 204 | prediction(i,:) = [0 wt_one]; 205 | end 206 | end -------------------------------------------------------------------------------- /RUSBoost/Test.m: -------------------------------------------------------------------------------- 1 | clc; 2 | clear all; 3 | close all; 4 | 5 | file = 'data.csv'; % Dataset 6 | 7 | % Reading training file 8 | data = dlmread(file); 9 | label = data(:,end); 10 | 11 | % Extracting positive data points 12 | idx = (label==1); 13 | pos_data = data(idx,:); 14 | row_pos = size(pos_data,1); 15 | 16 | % Extracting negative data points 17 | neg_data = data(~idx,:); 18 | row_neg = size(neg_data,1); 19 | 20 | % Random permuation of positive and negative data points 21 | p = randperm(row_pos); 22 | n = randperm(row_neg); 23 | 24 | % 80-20 split for training and test 25 | tstpf = p(1:round(row_pos/5)); 26 | tstnf = n(1:round(row_neg/5)); 27 | trpf = setdiff(p, tstpf); 28 | trnf = setdiff(n, tstnf); 29 | 30 | train_data = [pos_data(trpf,:);neg_data(trnf,:)]; 31 | test_data = [pos_data(tstpf,:);neg_data(tstnf,:)]; 32 | 33 | % Calling RUSBoost with decision tree as the weak learner 34 | prediction = RUSBoost(train_data,test_data,'tree'); 35 | disp (' Label Probability'); 36 | disp ('-----------------------------'); 37 | disp (prediction); -------------------------------------------------------------------------------- /RUSBoost/data.csv: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,0 2 | 1,1,1,1,1,2,0 3 | 1,1,1,1,1,3,0 4 | 1,1,1,1,2,1,0 5 | 1,1,1,1,2,2,0 6 | 1,1,1,1,2,3,0 7 | 1,1,1,1,3,1,0 8 | 1,1,1,1,3,2,0 9 | 1,1,1,1,3,3,0 10 | 1,1,1,2,1,1,0 11 | 1,1,1,2,1,2,0 12 | 1,1,1,2,1,3,0 13 | 1,1,1,2,2,1,0 14 | 1,1,1,2,2,2,0 15 | 1,1,1,2,2,3,0 16 | 1,1,1,2,3,1,0 17 | 1,1,1,2,3,2,0 18 | 1,1,1,2,3,3,0 19 | 1,1,1,3,1,1,0 20 | 1,1,1,3,1,2,0 21 | 1,1,1,3,1,3,0 22 | 1,1,1,3,2,1,0 23 | 1,1,1,3,2,2,0 24 | 1,1,1,3,2,3,0 25 | 1,1,1,3,3,1,0 26 | 1,1,1,3,3,2,0 27 | 1,1,1,3,3,3,0 28 | 1,1,2,1,1,1,0 29 | 1,1,2,1,1,2,0 30 | 1,1,2,1,1,3,0 31 | 1,1,2,1,2,1,0 32 | 1,1,2,1,2,2,0 33 | 1,1,2,1,2,3,0 34 | 1,1,2,1,3,1,0 35 | 1,1,2,1,3,2,0 36 | 1,1,2,1,3,3,0 37 | 1,1,2,2,1,1,0 38 | 1,1,2,2,1,2,0 39 | 1,1,2,2,1,3,0 40 | 1,1,2,2,2,1,0 41 | 1,1,2,2,2,2,0 42 | 1,1,2,2,2,3,0 43 | 1,1,2,2,3,1,0 44 | 1,1,2,2,3,2,0 45 | 1,1,2,2,3,3,0 46 | 1,1,2,3,1,1,0 47 | 1,1,2,3,1,2,0 48 | 1,1,2,3,1,3,0 49 | 1,1,2,3,2,1,0 50 | 1,1,2,3,2,2,0 51 | 1,1,2,3,2,3,0 52 | 1,1,2,3,3,1,0 53 | 1,1,2,3,3,2,0 54 | 1,1,2,3,3,3,0 55 | 1,1,3,1,1,1,0 56 | 1,1,3,1,1,2,0 57 | 1,1,3,1,1,3,0 58 | 1,1,3,1,2,1,0 59 | 1,1,3,1,2,2,0 60 | 1,1,3,1,2,3,0 61 | 1,1,3,1,3,1,0 62 | 1,1,3,1,3,2,0 63 | 1,1,3,1,3,3,0 64 | 1,1,3,2,1,1,0 65 | 1,1,3,2,1,2,0 66 | 1,1,3,2,1,3,0 67 | 1,1,3,2,2,1,0 68 | 1,1,3,2,2,2,0 69 | 1,1,3,2,2,3,0 70 | 1,1,3,2,3,1,0 71 | 1,1,3,2,3,2,0 72 | 1,1,3,2,3,3,0 73 | 1,1,3,3,1,1,0 74 | 1,1,3,3,1,2,0 75 | 1,1,3,3,1,3,0 76 | 1,1,3,3,2,1,0 77 | 1,1,3,3,2,2,0 78 | 1,1,3,3,2,3,0 79 | 1,1,3,3,3,1,0 80 | 1,1,3,3,3,2,0 81 | 1,1,3,3,3,3,0 82 | 1,1,4,1,1,1,0 83 | 1,1,4,1,1,2,0 84 | 1,1,4,1,1,3,0 85 | 1,1,4,1,2,1,0 86 | 1,1,4,1,2,2,0 87 | 1,1,4,1,2,3,0 88 | 1,1,4,1,3,1,0 89 | 1,1,4,1,3,2,0 90 | 1,1,4,1,3,3,0 91 | 1,1,4,2,1,1,0 92 | 1,1,4,2,1,2,0 93 | 1,1,4,2,1,3,0 94 | 1,1,4,2,2,1,0 95 | 1,1,4,2,2,2,0 96 | 1,1,4,2,2,3,0 97 | 1,1,4,2,3,1,0 98 | 1,1,4,2,3,2,0 99 | 1,1,4,2,3,3,0 100 | 1,1,4,3,1,1,0 101 | 1,1,4,3,1,2,0 102 | 1,1,4,3,1,3,0 103 | 1,1,4,3,2,1,0 104 | 1,1,4,3,2,2,0 105 | 1,1,4,3,2,3,0 106 | 1,1,4,3,3,1,0 107 | 1,1,4,3,3,2,0 108 | 1,1,4,3,3,3,0 109 | 1,2,1,1,1,1,0 110 | 1,2,1,1,1,2,0 111 | 1,2,1,1,1,3,0 112 | 1,2,1,1,2,1,0 113 | 1,2,1,1,2,2,0 114 | 1,2,1,1,2,3,0 115 | 1,2,1,1,3,1,0 116 | 1,2,1,1,3,2,0 117 | 1,2,1,1,3,3,0 118 | 1,2,1,2,1,1,0 119 | 1,2,1,2,1,2,0 120 | 1,2,1,2,1,3,0 121 | 1,2,1,2,2,1,0 122 | 1,2,1,2,2,2,0 123 | 1,2,1,2,2,3,0 124 | 1,2,1,2,3,1,0 125 | 1,2,1,2,3,2,0 126 | 1,2,1,2,3,3,0 127 | 1,2,1,3,1,1,0 128 | 1,2,1,3,1,2,0 129 | 1,2,1,3,1,3,0 130 | 1,2,1,3,2,1,0 131 | 1,2,1,3,2,2,0 132 | 1,2,1,3,2,3,0 133 | 1,2,1,3,3,1,0 134 | 1,2,1,3,3,2,0 135 | 1,2,1,3,3,3,0 136 | 1,2,2,1,1,1,0 137 | 1,2,2,1,1,2,0 138 | 1,2,2,1,1,3,0 139 | 1,2,2,1,2,1,0 140 | 1,2,2,1,2,2,0 141 | 1,2,2,1,2,3,0 142 | 1,2,2,1,3,1,0 143 | 1,2,2,1,3,2,0 144 | 1,2,2,1,3,3,0 145 | 1,2,2,2,1,1,0 146 | 1,2,2,2,1,2,0 147 | 1,2,2,2,1,3,0 148 | 1,2,2,2,2,1,0 149 | 1,2,2,2,2,2,0 150 | 1,2,2,2,2,3,0 151 | 1,2,2,2,3,1,0 152 | 1,2,2,2,3,2,0 153 | 1,2,2,2,3,3,0 154 | 1,2,2,3,1,1,0 155 | 1,2,2,3,1,2,0 156 | 1,2,2,3,1,3,0 157 | 1,2,2,3,2,1,0 158 | 1,2,2,3,2,2,0 159 | 1,2,2,3,2,3,0 160 | 1,2,2,3,3,1,0 161 | 1,2,2,3,3,2,0 162 | 1,2,2,3,3,3,0 163 | 1,2,3,1,1,1,0 164 | 1,2,3,1,1,2,0 165 | 1,2,3,1,1,3,0 166 | 1,2,3,1,2,1,0 167 | 1,2,3,1,2,2,0 168 | 1,2,3,1,2,3,0 169 | 1,2,3,1,3,1,0 170 | 1,2,3,1,3,2,0 171 | 1,2,3,1,3,3,0 172 | 1,2,3,2,1,1,0 173 | 1,2,3,2,1,2,0 174 | 1,2,3,2,1,3,0 175 | 1,2,3,2,2,1,0 176 | 1,2,3,2,2,2,0 177 | 1,2,3,2,2,3,0 178 | 1,2,3,2,3,1,0 179 | 1,2,3,2,3,2,0 180 | 1,2,3,2,3,3,0 181 | 1,2,3,3,1,1,0 182 | 1,2,3,3,1,2,0 183 | 1,2,3,3,1,3,0 184 | 1,2,3,3,2,1,0 185 | 1,2,3,3,2,2,0 186 | 1,2,3,3,2,3,0 187 | 1,2,3,3,3,1,0 188 | 1,2,3,3,3,2,0 189 | 1,2,3,3,3,3,0 190 | 1,2,4,1,1,1,0 191 | 1,2,4,1,1,2,0 192 | 1,2,4,1,1,3,0 193 | 1,2,4,1,2,1,0 194 | 1,2,4,1,2,2,0 195 | 1,2,4,1,2,3,0 196 | 1,2,4,1,3,1,0 197 | 1,2,4,1,3,2,0 198 | 1,2,4,1,3,3,0 199 | 1,2,4,2,1,1,0 200 | 1,2,4,2,1,2,0 201 | 1,2,4,2,1,3,0 202 | 1,2,4,2,2,1,0 203 | 1,2,4,2,2,2,0 204 | 1,2,4,2,2,3,0 205 | 1,2,4,2,3,1,0 206 | 1,2,4,2,3,2,0 207 | 1,2,4,2,3,3,0 208 | 1,2,4,3,1,1,0 209 | 1,2,4,3,1,2,0 210 | 1,2,4,3,1,3,0 211 | 1,2,4,3,2,1,0 212 | 1,2,4,3,2,2,0 213 | 1,2,4,3,2,3,0 214 | 1,2,4,3,3,1,0 215 | 1,2,4,3,3,2,0 216 | 1,2,4,3,3,3,0 217 | 1,3,1,1,1,1,0 218 | 1,3,1,1,1,2,0 219 | 1,3,1,1,1,3,0 220 | 1,3,1,1,2,1,0 221 | 1,3,1,1,2,2,0 222 | 1,3,1,1,2,3,0 223 | 1,3,1,1,3,1,0 224 | 1,3,1,1,3,2,0 225 | 1,3,1,1,3,3,0 226 | 1,3,1,2,1,1,0 227 | 1,3,1,2,1,2,0 228 | 1,3,1,2,1,3,0 229 | 1,3,1,2,2,1,0 230 | 1,3,1,2,2,2,0 231 | 1,3,1,2,2,3,0 232 | 1,3,1,2,3,1,0 233 | 1,3,1,2,3,2,0 234 | 1,3,1,2,3,3,0 235 | 1,3,1,3,1,1,0 236 | 1,3,1,3,1,2,0 237 | 1,3,1,3,1,3,0 238 | 1,3,1,3,2,1,0 239 | 1,3,1,3,2,2,0 240 | 1,3,1,3,2,3,0 241 | 1,3,1,3,3,1,0 242 | 1,3,1,3,3,2,0 243 | 1,3,1,3,3,3,0 244 | 1,3,2,1,1,1,0 245 | 1,3,2,1,1,2,0 246 | 1,3,2,1,1,3,0 247 | 1,3,2,1,2,1,0 248 | 1,3,2,1,2,2,0 249 | 1,3,2,1,2,3,0 250 | 1,3,2,1,3,1,0 251 | 1,3,2,1,3,2,0 252 | 1,3,2,1,3,3,0 253 | 1,3,2,2,1,1,0 254 | 1,3,2,2,1,2,0 255 | 1,3,2,2,1,3,0 256 | 1,3,2,2,2,1,0 257 | 1,3,2,2,2,2,0 258 | 1,3,2,2,2,3,0 259 | 1,3,2,2,3,1,0 260 | 1,3,2,2,3,2,0 261 | 1,3,2,2,3,3,0 262 | 1,3,2,3,1,1,0 263 | 1,3,2,3,1,2,0 264 | 1,3,2,3,1,3,0 265 | 1,3,2,3,2,1,0 266 | 1,3,2,3,2,2,0 267 | 1,3,2,3,2,3,0 268 | 1,3,2,3,3,1,0 269 | 1,3,2,3,3,2,0 270 | 1,3,2,3,3,3,0 271 | 1,3,3,1,1,1,0 272 | 1,3,3,1,1,2,0 273 | 1,3,3,1,1,3,0 274 | 1,3,3,1,2,1,0 275 | 1,3,3,1,2,2,0 276 | 1,3,3,1,2,3,0 277 | 1,3,3,1,3,1,0 278 | 1,3,3,1,3,2,0 279 | 1,3,3,1,3,3,0 280 | 1,3,3,2,1,1,0 281 | 1,3,3,2,1,2,0 282 | 1,3,3,2,1,3,0 283 | 1,3,3,2,2,1,0 284 | 1,3,3,2,2,2,0 285 | 1,3,3,2,2,3,0 286 | 1,3,3,2,3,1,0 287 | 1,3,3,2,3,2,0 288 | 1,3,3,2,3,3,0 289 | 1,3,3,3,1,1,0 290 | 1,3,3,3,1,2,0 291 | 1,3,3,3,1,3,0 292 | 1,3,3,3,2,1,0 293 | 1,3,3,3,2,2,0 294 | 1,3,3,3,2,3,0 295 | 1,3,3,3,3,1,0 296 | 1,3,3,3,3,2,0 297 | 1,3,3,3,3,3,0 298 | 1,3,4,1,1,1,0 299 | 1,3,4,1,1,2,0 300 | 1,3,4,1,1,3,0 301 | 1,3,4,1,2,1,0 302 | 1,3,4,1,2,2,0 303 | 1,3,4,1,2,3,0 304 | 1,3,4,1,3,1,0 305 | 1,3,4,1,3,2,0 306 | 1,3,4,1,3,3,0 307 | 1,3,4,2,1,1,0 308 | 1,3,4,2,1,2,0 309 | 1,3,4,2,1,3,0 310 | 1,3,4,2,2,1,0 311 | 1,3,4,2,2,2,0 312 | 1,3,4,2,2,3,0 313 | 1,3,4,2,3,1,0 314 | 1,3,4,2,3,2,0 315 | 1,3,4,2,3,3,0 316 | 1,3,4,3,1,1,0 317 | 1,3,4,3,1,2,0 318 | 1,3,4,3,1,3,0 319 | 1,3,4,3,2,1,0 320 | 1,3,4,3,2,2,0 321 | 1,3,4,3,2,3,0 322 | 1,3,4,3,3,1,0 323 | 1,3,4,3,3,2,0 324 | 1,3,4,3,3,3,0 325 | 1,4,1,1,1,1,0 326 | 1,4,1,1,1,2,0 327 | 1,4,1,1,1,3,0 328 | 1,4,1,1,2,1,0 329 | 1,4,1,1,2,2,0 330 | 1,4,1,1,2,3,0 331 | 1,4,1,1,3,1,0 332 | 1,4,1,1,3,2,0 333 | 1,4,1,1,3,3,0 334 | 1,4,1,2,1,1,0 335 | 1,4,1,2,1,2,0 336 | 1,4,1,2,1,3,0 337 | 1,4,1,2,2,1,0 338 | 1,4,1,2,2,2,0 339 | 1,4,1,2,2,3,0 340 | 1,4,1,2,3,1,0 341 | 1,4,1,2,3,2,0 342 | 1,4,1,2,3,3,0 343 | 1,4,1,3,1,1,0 344 | 1,4,1,3,1,2,0 345 | 1,4,1,3,1,3,0 346 | 1,4,1,3,2,1,0 347 | 1,4,1,3,2,2,0 348 | 1,4,1,3,2,3,0 349 | 1,4,1,3,3,1,0 350 | 1,4,1,3,3,2,0 351 | 1,4,1,3,3,3,0 352 | 1,4,2,1,1,1,0 353 | 1,4,2,1,1,2,0 354 | 1,4,2,1,1,3,0 355 | 1,4,2,1,2,1,0 356 | 1,4,2,1,2,2,0 357 | 1,4,2,1,2,3,0 358 | 1,4,2,1,3,1,0 359 | 1,4,2,1,3,2,0 360 | 1,4,2,1,3,3,0 361 | 1,4,2,2,1,1,0 362 | 1,4,2,2,1,2,0 363 | 1,4,2,2,1,3,0 364 | 1,4,2,2,2,1,0 365 | 1,4,2,2,2,2,0 366 | 1,4,2,2,2,3,0 367 | 1,4,2,2,3,1,0 368 | 1,4,2,2,3,2,0 369 | 1,4,2,2,3,3,0 370 | 1,4,2,3,1,1,0 371 | 1,4,2,3,1,2,0 372 | 1,4,2,3,1,3,0 373 | 1,4,2,3,2,1,0 374 | 1,4,2,3,2,2,0 375 | 1,4,2,3,2,3,0 376 | 1,4,2,3,3,1,0 377 | 1,4,2,3,3,2,0 378 | 1,4,2,3,3,3,0 379 | 1,4,3,1,1,1,0 380 | 1,4,3,1,1,2,0 381 | 1,4,3,1,1,3,0 382 | 1,4,3,1,2,1,0 383 | 1,4,3,1,2,2,0 384 | 1,4,3,1,2,3,0 385 | 1,4,3,1,3,1,0 386 | 1,4,3,1,3,2,0 387 | 1,4,3,1,3,3,0 388 | 1,4,3,2,1,1,0 389 | 1,4,3,2,1,2,0 390 | 1,4,3,2,1,3,0 391 | 1,4,3,2,2,1,0 392 | 1,4,3,2,2,2,0 393 | 1,4,3,2,2,3,0 394 | 1,4,3,2,3,1,0 395 | 1,4,3,2,3,2,0 396 | 1,4,3,2,3,3,0 397 | 1,4,3,3,1,1,0 398 | 1,4,3,3,1,2,0 399 | 1,4,3,3,1,3,0 400 | 1,4,3,3,2,1,0 401 | 1,4,3,3,2,2,0 402 | 1,4,3,3,2,3,0 403 | 1,4,3,3,3,1,0 404 | 1,4,3,3,3,2,0 405 | 1,4,3,3,3,3,0 406 | 1,4,4,1,1,1,0 407 | 1,4,4,1,1,2,0 408 | 1,4,4,1,1,3,0 409 | 1,4,4,1,2,1,0 410 | 1,4,4,1,2,2,0 411 | 1,4,4,1,2,3,0 412 | 1,4,4,1,3,1,0 413 | 1,4,4,1,3,2,0 414 | 1,4,4,1,3,3,0 415 | 1,4,4,2,1,1,0 416 | 1,4,4,2,1,2,0 417 | 1,4,4,2,1,3,0 418 | 1,4,4,2,2,1,0 419 | 1,4,4,2,2,2,0 420 | 1,4,4,2,2,3,0 421 | 1,4,4,2,3,1,0 422 | 1,4,4,2,3,2,0 423 | 1,4,4,2,3,3,0 424 | 1,4,4,3,1,1,0 425 | 1,4,4,3,1,2,0 426 | 1,4,4,3,1,3,0 427 | 1,4,4,3,2,1,0 428 | 1,4,4,3,2,2,0 429 | 1,4,4,3,2,3,0 430 | 1,4,4,3,3,1,0 431 | 1,4,4,3,3,2,0 432 | 1,4,4,3,3,3,0 433 | 2,1,1,1,1,1,0 434 | 2,1,1,1,1,2,0 435 | 2,1,1,1,1,3,0 436 | 2,1,1,1,2,1,0 437 | 2,1,1,1,2,2,0 438 | 2,1,1,1,2,3,0 439 | 2,1,1,1,3,1,0 440 | 2,1,1,1,3,2,0 441 | 2,1,1,1,3,3,0 442 | 2,1,1,2,1,1,0 443 | 2,1,1,2,1,2,0 444 | 2,1,1,2,1,3,0 445 | 2,1,1,2,2,1,0 446 | 2,1,1,2,2,2,0 447 | 2,1,1,2,2,3,0 448 | 2,1,1,2,3,1,0 449 | 2,1,1,2,3,2,0 450 | 2,1,1,2,3,3,0 451 | 2,1,1,3,1,1,0 452 | 2,1,1,3,1,2,0 453 | 2,1,1,3,1,3,0 454 | 2,1,1,3,2,1,0 455 | 2,1,1,3,2,2,0 456 | 2,1,1,3,2,3,0 457 | 2,1,1,3,3,1,0 458 | 2,1,1,3,3,2,0 459 | 2,1,1,3,3,3,0 460 | 2,1,2,1,1,1,0 461 | 2,1,2,1,1,2,0 462 | 2,1,2,1,1,3,0 463 | 2,1,2,1,2,1,0 464 | 2,1,2,1,2,2,0 465 | 2,1,2,1,2,3,0 466 | 2,1,2,1,3,1,0 467 | 2,1,2,1,3,2,0 468 | 2,1,2,1,3,3,0 469 | 2,1,2,2,1,1,0 470 | 2,1,2,2,1,2,0 471 | 2,1,2,2,1,3,0 472 | 2,1,2,2,2,1,0 473 | 2,1,2,2,2,2,0 474 | 2,1,2,2,2,3,0 475 | 2,1,2,2,3,1,0 476 | 2,1,2,2,3,2,0 477 | 2,1,2,2,3,3,0 478 | 2,1,2,3,1,1,0 479 | 2,1,2,3,1,2,0 480 | 2,1,2,3,1,3,0 481 | 2,1,2,3,2,1,0 482 | 2,1,2,3,2,2,0 483 | 2,1,2,3,2,3,0 484 | 2,1,2,3,3,1,0 485 | 2,1,2,3,3,2,0 486 | 2,1,2,3,3,3,0 487 | 2,1,3,1,1,1,0 488 | 2,1,3,1,1,2,0 489 | 2,1,3,1,1,3,0 490 | 2,1,3,1,2,1,0 491 | 2,1,3,1,2,2,0 492 | 2,1,3,1,2,3,0 493 | 2,1,3,1,3,1,0 494 | 2,1,3,1,3,2,0 495 | 2,1,3,1,3,3,0 496 | 2,1,3,2,1,1,0 497 | 2,1,3,2,1,2,0 498 | 2,1,3,2,1,3,0 499 | 2,1,3,2,2,1,0 500 | 2,1,3,2,2,2,0 501 | 2,1,3,2,2,3,0 502 | 2,1,3,2,3,1,0 503 | 2,1,3,2,3,2,0 504 | 2,1,3,2,3,3,0 505 | 2,1,3,3,1,1,0 506 | 2,1,3,3,1,2,0 507 | 2,1,3,3,1,3,0 508 | 2,1,3,3,2,1,0 509 | 2,1,3,3,2,2,0 510 | 2,1,3,3,2,3,0 511 | 2,1,3,3,3,1,0 512 | 2,1,3,3,3,2,0 513 | 2,1,3,3,3,3,0 514 | 2,1,4,1,1,1,0 515 | 2,1,4,1,1,2,0 516 | 2,1,4,1,1,3,0 517 | 2,1,4,1,2,1,0 518 | 2,1,4,1,2,2,0 519 | 2,1,4,1,2,3,0 520 | 2,1,4,1,3,1,0 521 | 2,1,4,1,3,2,0 522 | 2,1,4,1,3,3,0 523 | 2,1,4,2,1,1,0 524 | 2,1,4,2,1,2,0 525 | 2,1,4,2,1,3,0 526 | 2,1,4,2,2,1,0 527 | 2,1,4,2,2,2,0 528 | 2,1,4,2,2,3,0 529 | 2,1,4,2,3,1,0 530 | 2,1,4,2,3,2,0 531 | 2,1,4,2,3,3,0 532 | 2,1,4,3,1,1,0 533 | 2,1,4,3,1,2,0 534 | 2,1,4,3,1,3,0 535 | 2,1,4,3,2,1,0 536 | 2,1,4,3,2,2,0 537 | 2,1,4,3,2,3,0 538 | 2,1,4,3,3,1,0 539 | 2,1,4,3,3,2,0 540 | 2,1,4,3,3,3,0 541 | 2,2,1,1,1,1,0 542 | 2,2,1,1,1,2,0 543 | 2,2,1,1,1,3,0 544 | 2,2,1,1,2,1,0 545 | 2,2,1,1,2,2,0 546 | 2,2,1,1,2,3,0 547 | 2,2,1,1,3,1,0 548 | 2,2,1,1,3,2,0 549 | 2,2,1,1,3,3,0 550 | 2,2,1,2,1,1,0 551 | 2,2,1,2,1,2,0 552 | 2,2,1,2,1,3,0 553 | 2,2,1,2,2,1,0 554 | 2,2,1,2,2,2,0 555 | 2,2,1,2,2,3,0 556 | 2,2,1,2,3,1,0 557 | 2,2,1,2,3,2,0 558 | 2,2,1,2,3,3,0 559 | 2,2,1,3,1,1,0 560 | 2,2,1,3,1,2,0 561 | 2,2,1,3,1,3,0 562 | 2,2,1,3,2,1,0 563 | 2,2,1,3,2,2,0 564 | 2,2,1,3,2,3,0 565 | 2,2,1,3,3,1,0 566 | 2,2,1,3,3,2,0 567 | 2,2,1,3,3,3,0 568 | 2,2,2,1,1,1,0 569 | 2,2,2,1,1,2,0 570 | 2,2,2,1,1,3,0 571 | 2,2,2,1,2,1,0 572 | 2,2,2,1,2,2,0 573 | 2,2,2,1,2,3,0 574 | 2,2,2,1,3,1,0 575 | 2,2,2,1,3,2,0 576 | 2,2,2,1,3,3,0 577 | 2,2,2,2,1,1,0 578 | 2,2,2,2,1,2,0 579 | 2,2,2,2,1,3,0 580 | 2,2,2,2,2,1,0 581 | 2,2,2,2,2,2,0 582 | 2,2,2,2,2,3,0 583 | 2,2,2,2,3,1,0 584 | 2,2,2,2,3,2,0 585 | 2,2,2,2,3,3,0 586 | 2,2,2,3,1,1,0 587 | 2,2,2,3,1,2,0 588 | 2,2,2,3,1,3,0 589 | 2,2,2,3,2,1,0 590 | 2,2,2,3,2,2,0 591 | 2,2,2,3,2,3,0 592 | 2,2,2,3,3,1,0 593 | 2,2,2,3,3,2,0 594 | 2,2,2,3,3,3,0 595 | 2,2,3,1,1,1,0 596 | 2,2,3,1,1,2,0 597 | 2,2,3,1,1,3,0 598 | 2,2,3,1,2,1,0 599 | 2,2,3,1,2,2,0 600 | 2,2,3,1,2,3,0 601 | 2,2,3,1,3,1,0 602 | 2,2,3,1,3,2,0 603 | 2,2,3,1,3,3,0 604 | 2,2,3,2,1,1,0 605 | 2,2,3,2,1,2,0 606 | 2,2,3,2,1,3,0 607 | 2,2,3,2,2,1,0 608 | 2,2,3,2,2,2,0 609 | 2,2,3,2,2,3,0 610 | 2,2,3,2,3,1,0 611 | 2,2,3,2,3,2,0 612 | 2,2,3,2,3,3,0 613 | 2,2,3,3,1,1,0 614 | 2,2,3,3,1,2,0 615 | 2,2,3,3,1,3,0 616 | 2,2,3,3,2,1,0 617 | 2,2,3,3,2,2,0 618 | 2,2,3,3,2,3,0 619 | 2,2,3,3,3,1,0 620 | 2,2,3,3,3,2,0 621 | 2,2,3,3,3,3,0 622 | 2,2,4,1,1,1,0 623 | 2,2,4,1,1,2,0 624 | 2,2,4,1,1,3,0 625 | 2,2,4,1,2,1,0 626 | 2,2,4,1,2,2,0 627 | 2,2,4,1,2,3,0 628 | 2,2,4,1,3,1,0 629 | 2,2,4,1,3,2,0 630 | 2,2,4,1,3,3,0 631 | 2,2,4,2,1,1,0 632 | 2,2,4,2,1,2,0 633 | 2,2,4,2,1,3,0 634 | 2,2,4,2,2,1,0 635 | 2,2,4,2,2,2,0 636 | 2,2,4,2,2,3,0 637 | 2,2,4,2,3,1,0 638 | 2,2,4,2,3,2,0 639 | 2,2,4,2,3,3,0 640 | 2,2,4,3,1,1,0 641 | 2,2,4,3,1,2,0 642 | 2,2,4,3,1,3,0 643 | 2,2,4,3,2,1,0 644 | 2,2,4,3,2,2,0 645 | 2,2,4,3,2,3,0 646 | 2,2,4,3,3,1,0 647 | 2,2,4,3,3,2,0 648 | 2,2,4,3,3,3,0 649 | 2,3,1,1,1,1,0 650 | 2,3,1,1,1,2,0 651 | 2,3,1,1,1,3,0 652 | 2,3,1,1,2,1,0 653 | 2,3,1,1,2,2,0 654 | 2,3,1,1,2,3,0 655 | 2,3,1,1,3,1,0 656 | 2,3,1,1,3,2,0 657 | 2,3,1,1,3,3,0 658 | 2,3,1,2,1,1,0 659 | 2,3,1,2,1,2,0 660 | 2,3,1,2,1,3,0 661 | 2,3,1,2,2,1,0 662 | 2,3,1,2,2,2,0 663 | 2,3,1,2,2,3,0 664 | 2,3,1,2,3,1,0 665 | 2,3,1,2,3,2,0 666 | 2,3,1,2,3,3,0 667 | 2,3,1,3,1,1,0 668 | 2,3,1,3,1,2,0 669 | 2,3,1,3,1,3,0 670 | 2,3,1,3,2,1,0 671 | 2,3,1,3,2,2,0 672 | 2,3,1,3,2,3,0 673 | 2,3,1,3,3,1,0 674 | 2,3,1,3,3,2,0 675 | 2,3,1,3,3,3,0 676 | 2,3,2,1,1,1,0 677 | 2,3,2,1,1,2,0 678 | 2,3,2,1,1,3,0 679 | 2,3,2,1,2,1,0 680 | 2,3,2,1,2,2,0 681 | 2,3,2,1,2,3,0 682 | 2,3,2,1,3,1,0 683 | 2,3,2,1,3,2,0 684 | 2,3,2,1,3,3,0 685 | 2,3,2,2,1,1,0 686 | 2,3,2,2,1,2,0 687 | 2,3,2,2,1,3,0 688 | 2,3,2,2,2,1,0 689 | 2,3,2,2,2,2,0 690 | 2,3,2,2,2,3,0 691 | 2,3,2,2,3,1,0 692 | 2,3,2,2,3,2,0 693 | 2,3,2,2,3,3,0 694 | 2,3,2,3,1,1,0 695 | 2,3,2,3,1,2,0 696 | 2,3,2,3,1,3,0 697 | 2,3,2,3,2,1,0 698 | 2,3,2,3,2,2,0 699 | 2,3,2,3,2,3,0 700 | 2,3,2,3,3,1,0 701 | 2,3,2,3,3,2,0 702 | 2,3,2,3,3,3,0 703 | 2,3,3,1,1,1,0 704 | 2,3,3,1,1,2,0 705 | 2,3,3,1,1,3,0 706 | 2,3,3,1,2,1,0 707 | 2,3,3,1,2,2,0 708 | 2,3,3,1,2,3,0 709 | 2,3,3,1,3,1,0 710 | 2,3,3,1,3,2,0 711 | 2,3,3,1,3,3,0 712 | 2,3,3,2,1,1,0 713 | 2,3,3,2,1,2,0 714 | 2,3,3,2,1,3,0 715 | 2,3,3,2,2,1,0 716 | 2,3,3,2,2,2,0 717 | 2,3,3,2,2,3,0 718 | 2,3,3,2,3,1,0 719 | 2,3,3,2,3,2,0 720 | 2,3,3,2,3,3,0 721 | 2,3,3,3,1,1,0 722 | 2,3,3,3,1,2,0 723 | 2,3,3,3,1,3,0 724 | 2,3,3,3,2,1,0 725 | 2,3,3,3,2,2,0 726 | 2,3,3,3,2,3,0 727 | 2,3,3,3,3,1,0 728 | 2,3,3,3,3,2,0 729 | 2,3,3,3,3,3,0 730 | 2,3,4,1,1,1,0 731 | 2,3,4,1,1,2,0 732 | 2,3,4,1,1,3,0 733 | 2,3,4,1,2,1,0 734 | 2,3,4,1,2,2,0 735 | 2,3,4,1,2,3,0 736 | 2,3,4,1,3,1,0 737 | 2,3,4,1,3,2,0 738 | 2,3,4,1,3,3,0 739 | 2,3,4,2,1,1,0 740 | 2,3,4,2,1,2,0 741 | 2,3,4,2,1,3,0 742 | 2,3,4,2,2,1,0 743 | 2,3,4,2,2,2,0 744 | 2,3,4,2,2,3,0 745 | 2,3,4,2,3,1,0 746 | 2,3,4,2,3,2,0 747 | 2,3,4,2,3,3,0 748 | 2,3,4,3,1,1,0 749 | 2,3,4,3,1,2,0 750 | 2,3,4,3,1,3,0 751 | 2,3,4,3,2,1,0 752 | 2,3,4,3,2,2,0 753 | 2,3,4,3,2,3,0 754 | 2,3,4,3,3,1,0 755 | 2,3,4,3,3,2,0 756 | 2,3,4,3,3,3,0 757 | 2,4,1,1,1,1,0 758 | 2,4,1,1,1,2,0 759 | 2,4,1,1,1,3,0 760 | 2,4,1,1,2,1,0 761 | 2,4,1,1,2,2,0 762 | 2,4,1,1,2,3,0 763 | 2,4,1,1,3,1,0 764 | 2,4,1,1,3,2,0 765 | 2,4,1,1,3,3,0 766 | 2,4,1,2,1,1,0 767 | 2,4,1,2,1,2,0 768 | 2,4,1,2,1,3,0 769 | 2,4,1,2,2,1,0 770 | 2,4,1,2,2,2,0 771 | 2,4,1,2,2,3,0 772 | 2,4,1,2,3,1,0 773 | 2,4,1,2,3,2,0 774 | 2,4,1,2,3,3,0 775 | 2,4,1,3,1,1,0 776 | 2,4,1,3,1,2,0 777 | 2,4,1,3,1,3,0 778 | 2,4,1,3,2,1,0 779 | 2,4,1,3,2,2,0 780 | 2,4,1,3,2,3,0 781 | 2,4,1,3,3,1,0 782 | 2,4,1,3,3,2,0 783 | 2,4,1,3,3,3,0 784 | 2,4,2,1,1,1,0 785 | 2,4,2,1,1,2,0 786 | 2,4,2,1,1,3,0 787 | 2,4,2,1,2,1,0 788 | 2,4,2,1,2,2,0 789 | 2,4,2,1,2,3,0 790 | 2,4,2,1,3,1,0 791 | 2,4,2,1,3,2,0 792 | 2,4,2,1,3,3,0 793 | 2,4,2,2,1,1,0 794 | 2,4,2,2,1,2,0 795 | 2,4,2,2,1,3,0 796 | 2,4,2,2,2,1,0 797 | 2,4,2,2,2,2,0 798 | 2,4,2,2,2,3,0 799 | 2,4,2,2,3,1,0 800 | 2,4,2,2,3,2,0 801 | 2,4,2,2,3,3,0 802 | 2,4,2,3,1,1,0 803 | 2,4,2,3,1,2,0 804 | 2,4,2,3,1,3,0 805 | 2,4,2,3,2,1,0 806 | 2,4,2,3,2,2,0 807 | 2,4,2,3,2,3,0 808 | 2,4,2,3,3,1,0 809 | 2,4,2,3,3,2,0 810 | 2,4,2,3,3,3,0 811 | 2,4,3,1,1,1,0 812 | 2,4,3,1,1,2,0 813 | 2,4,3,1,1,3,0 814 | 2,4,3,1,2,1,0 815 | 2,4,3,1,2,2,0 816 | 2,4,3,1,2,3,0 817 | 2,4,3,1,3,1,0 818 | 2,4,3,1,3,2,0 819 | 2,4,3,1,3,3,0 820 | 2,4,3,2,1,1,0 821 | 2,4,3,2,1,2,0 822 | 2,4,3,2,1,3,0 823 | 2,4,3,2,2,1,0 824 | 2,4,3,2,2,2,0 825 | 2,4,3,2,2,3,0 826 | 2,4,3,2,3,1,0 827 | 2,4,3,2,3,2,0 828 | 2,4,3,2,3,3,0 829 | 2,4,3,3,1,1,0 830 | 2,4,3,3,1,2,0 831 | 2,4,3,3,1,3,0 832 | 2,4,3,3,2,1,0 833 | 2,4,3,3,2,2,0 834 | 2,4,3,3,2,3,0 835 | 2,4,3,3,3,1,0 836 | 2,4,3,3,3,2,0 837 | 2,4,3,3,3,3,0 838 | 2,4,4,1,1,1,0 839 | 2,4,4,1,1,2,0 840 | 2,4,4,1,1,3,0 841 | 2,4,4,1,2,1,0 842 | 2,4,4,1,2,2,0 843 | 2,4,4,1,2,3,0 844 | 2,4,4,1,3,1,0 845 | 2,4,4,1,3,2,0 846 | 2,4,4,1,3,3,0 847 | 2,4,4,2,1,1,0 848 | 2,4,4,2,1,2,0 849 | 2,4,4,2,1,3,0 850 | 2,4,4,2,2,1,0 851 | 2,4,4,2,2,2,0 852 | 2,4,4,2,2,3,0 853 | 2,4,4,2,3,1,0 854 | 2,4,4,2,3,2,0 855 | 2,4,4,2,3,3,0 856 | 2,4,4,3,1,1,0 857 | 2,4,4,3,1,2,0 858 | 2,4,4,3,1,3,0 859 | 2,4,4,3,2,1,0 860 | 2,4,4,3,2,2,0 861 | 2,4,4,3,2,3,0 862 | 2,4,4,3,3,1,0 863 | 2,4,4,3,3,2,0 864 | 2,4,4,3,3,3,0 865 | 3,1,1,1,1,1,0 866 | 3,1,1,1,1,2,0 867 | 3,1,1,1,1,3,0 868 | 3,1,1,1,2,1,0 869 | 3,1,1,1,2,2,0 870 | 3,1,1,1,2,3,0 871 | 3,1,1,1,3,1,0 872 | 3,1,1,1,3,2,0 873 | 3,1,1,1,3,3,0 874 | 3,1,1,2,1,1,0 875 | 3,1,1,2,1,2,0 876 | 3,1,1,2,1,3,0 877 | 3,1,1,2,2,1,0 878 | 3,1,1,2,2,2,0 879 | 3,1,1,2,2,3,0 880 | 3,1,1,2,3,1,0 881 | 3,1,1,2,3,2,0 882 | 3,1,1,2,3,3,0 883 | 3,1,1,3,1,1,0 884 | 3,1,1,3,1,2,0 885 | 3,1,1,3,1,3,0 886 | 3,1,1,3,2,1,0 887 | 3,1,1,3,2,2,0 888 | 3,1,1,3,2,3,0 889 | 3,1,1,3,3,1,0 890 | 3,1,1,3,3,2,0 891 | 3,1,1,3,3,3,0 892 | 3,1,2,1,1,1,0 893 | 3,1,2,1,1,2,0 894 | 3,1,2,1,1,3,0 895 | 3,1,2,1,2,1,0 896 | 3,1,2,1,2,2,0 897 | 3,1,2,1,2,3,0 898 | 3,1,2,1,3,1,0 899 | 3,1,2,1,3,2,0 900 | 3,1,2,1,3,3,0 901 | 3,1,2,2,1,1,0 902 | 3,1,2,2,1,2,0 903 | 3,1,2,2,1,3,0 904 | 3,1,2,2,2,1,0 905 | 3,1,2,2,2,2,0 906 | 3,1,2,2,2,3,0 907 | 3,1,2,2,3,1,0 908 | 3,1,2,2,3,2,0 909 | 3,1,2,2,3,3,0 910 | 3,1,2,3,1,1,0 911 | 3,1,2,3,1,2,0 912 | 3,1,2,3,1,3,0 913 | 3,1,2,3,2,1,0 914 | 3,1,2,3,2,2,0 915 | 3,1,2,3,2,3,0 916 | 3,1,2,3,3,1,0 917 | 3,1,2,3,3,2,0 918 | 3,1,2,3,3,3,0 919 | 3,1,3,1,1,1,0 920 | 3,1,3,1,1,2,0 921 | 3,1,3,1,1,3,0 922 | 3,1,3,1,2,1,0 923 | 3,1,3,1,2,2,0 924 | 3,1,3,1,2,3,0 925 | 3,1,3,1,3,1,0 926 | 3,1,3,1,3,2,0 927 | 3,1,3,1,3,3,0 928 | 3,1,3,2,1,1,0 929 | 3,1,3,2,1,2,0 930 | 3,1,3,2,1,3,0 931 | 3,1,3,2,2,1,0 932 | 3,1,3,2,2,2,0 933 | 3,1,3,2,2,3,0 934 | 3,1,3,2,3,1,0 935 | 3,1,3,2,3,2,0 936 | 3,1,3,2,3,3,0 937 | 3,1,3,3,1,1,0 938 | 3,1,3,3,1,2,0 939 | 3,1,3,3,1,3,0 940 | 3,1,3,3,2,1,0 941 | 3,1,3,3,2,2,0 942 | 3,1,3,3,2,3,0 943 | 3,1,3,3,3,1,0 944 | 3,1,3,3,3,2,0 945 | 3,1,3,3,3,3,0 946 | 3,1,4,1,1,1,0 947 | 3,1,4,1,1,2,0 948 | 3,1,4,1,1,3,0 949 | 3,1,4,1,2,1,0 950 | 3,1,4,1,2,2,0 951 | 3,1,4,1,2,3,0 952 | 3,1,4,1,3,1,0 953 | 3,1,4,1,3,2,0 954 | 3,1,4,1,3,3,0 955 | 3,1,4,2,1,1,0 956 | 3,1,4,2,1,2,0 957 | 3,1,4,2,1,3,0 958 | 3,1,4,2,2,1,0 959 | 3,1,4,2,2,2,0 960 | 3,1,4,2,2,3,0 961 | 3,1,4,2,3,1,0 962 | 3,1,4,2,3,2,0 963 | 3,1,4,2,3,3,0 964 | 3,1,4,3,1,1,0 965 | 3,1,4,3,1,2,0 966 | 3,1,4,3,1,3,0 967 | 3,1,4,3,2,1,0 968 | 3,1,4,3,2,2,0 969 | 3,1,4,3,2,3,0 970 | 3,1,4,3,3,1,0 971 | 3,1,4,3,3,2,0 972 | 3,1,4,3,3,3,0 973 | 3,2,1,1,1,1,0 974 | 3,2,1,1,1,2,0 975 | 3,2,1,1,1,3,0 976 | 3,2,1,1,2,1,0 977 | 3,2,1,1,2,2,0 978 | 3,2,1,1,2,3,0 979 | 3,2,1,1,3,1,0 980 | 3,2,1,1,3,2,0 981 | 3,2,1,1,3,3,0 982 | 3,2,1,2,1,1,0 983 | 3,2,1,2,1,2,0 984 | 3,2,1,2,1,3,0 985 | 3,2,1,2,2,1,0 986 | 3,2,1,2,2,2,0 987 | 3,2,1,2,2,3,0 988 | 3,2,1,2,3,1,0 989 | 3,2,1,2,3,2,0 990 | 3,2,1,2,3,3,0 991 | 3,2,1,3,1,1,0 992 | 3,2,1,3,1,2,0 993 | 3,2,1,3,1,3,0 994 | 3,2,1,3,2,1,0 995 | 3,2,1,3,2,2,0 996 | 3,2,1,3,2,3,0 997 | 3,2,1,3,3,1,0 998 | 3,2,1,3,3,2,0 999 | 3,2,1,3,3,3,0 1000 | 3,2,2,1,1,1,0 1001 | 3,2,2,1,1,2,0 1002 | 3,2,2,1,1,3,0 1003 | 3,2,2,1,2,1,0 1004 | 3,2,2,1,2,2,0 1005 | 3,2,2,1,2,3,0 1006 | 3,2,2,1,3,1,0 1007 | 3,2,2,1,3,2,0 1008 | 3,2,2,1,3,3,0 1009 | 3,2,2,2,1,1,0 1010 | 3,2,2,2,1,2,0 1011 | 3,2,2,2,1,3,0 1012 | 3,2,2,2,2,1,0 1013 | 3,2,2,2,2,2,0 1014 | 3,2,2,2,2,3,0 1015 | 3,2,2,2,3,1,0 1016 | 3,2,2,2,3,2,0 1017 | 3,2,2,2,3,3,0 1018 | 3,2,2,3,1,1,0 1019 | 3,2,2,3,1,2,0 1020 | 3,2,2,3,1,3,0 1021 | 3,2,2,3,2,1,0 1022 | 3,2,2,3,2,2,0 1023 | 3,2,2,3,2,3,0 1024 | 3,2,2,3,3,1,0 1025 | 3,2,2,3,3,2,0 1026 | 3,2,2,3,3,3,0 1027 | 3,2,3,1,1,1,0 1028 | 3,2,3,1,1,2,0 1029 | 3,2,3,1,1,3,0 1030 | 3,2,3,1,2,1,0 1031 | 3,2,3,1,2,2,0 1032 | 3,2,3,1,2,3,0 1033 | 3,2,3,1,3,1,0 1034 | 3,2,3,1,3,2,0 1035 | 3,2,3,1,3,3,0 1036 | 3,2,3,2,1,1,0 1037 | 3,2,3,2,1,2,0 1038 | 3,2,3,2,1,3,0 1039 | 3,2,3,2,2,1,0 1040 | 3,2,3,2,2,2,0 1041 | 3,2,3,2,2,3,0 1042 | 3,2,3,2,3,1,0 1043 | 3,2,3,2,3,2,0 1044 | 3,2,3,2,3,3,0 1045 | 3,2,3,3,1,1,0 1046 | 3,2,3,3,1,2,0 1047 | 3,2,3,3,1,3,0 1048 | 3,2,3,3,2,1,0 1049 | 3,2,3,3,2,2,0 1050 | 3,2,3,3,2,3,0 1051 | 3,2,3,3,3,1,0 1052 | 3,2,3,3,3,2,0 1053 | 3,2,3,3,3,3,0 1054 | 3,2,4,1,1,1,0 1055 | 3,2,4,1,1,2,0 1056 | 3,2,4,1,1,3,0 1057 | 3,2,4,1,2,1,0 1058 | 3,2,4,1,2,2,0 1059 | 3,2,4,1,2,3,0 1060 | 3,2,4,1,3,1,0 1061 | 3,2,4,1,3,2,0 1062 | 3,2,4,1,3,3,0 1063 | 3,2,4,2,1,1,0 1064 | 3,2,4,2,1,2,0 1065 | 3,2,4,2,1,3,0 1066 | 3,2,4,2,2,1,0 1067 | 3,2,4,2,2,2,0 1068 | 3,2,4,2,2,3,0 1069 | 3,2,4,2,3,1,0 1070 | 3,2,4,2,3,2,0 1071 | 3,2,4,2,3,3,0 1072 | 3,2,4,3,1,1,0 1073 | 3,2,4,3,1,2,0 1074 | 3,2,4,3,1,3,0 1075 | 3,2,4,3,2,1,0 1076 | 3,2,4,3,2,2,0 1077 | 3,2,4,3,2,3,0 1078 | 3,2,4,3,3,1,0 1079 | 3,2,4,3,3,2,0 1080 | 3,2,4,3,3,3,0 1081 | 3,3,1,1,1,1,0 1082 | 3,3,1,1,1,2,0 1083 | 3,3,1,1,1,3,0 1084 | 3,3,1,1,2,1,0 1085 | 3,3,1,1,2,2,0 1086 | 3,3,1,1,2,3,0 1087 | 3,3,1,1,3,1,0 1088 | 3,3,1,1,3,2,0 1089 | 3,3,1,1,3,3,0 1090 | 3,3,1,2,1,1,0 1091 | 3,3,1,2,1,2,0 1092 | 3,3,1,2,1,3,0 1093 | 3,3,1,2,2,1,0 1094 | 3,3,1,2,2,2,0 1095 | 3,3,1,2,2,3,0 1096 | 3,3,1,2,3,1,0 1097 | 3,3,1,2,3,2,0 1098 | 3,3,1,2,3,3,0 1099 | 3,3,1,3,1,1,0 1100 | 3,3,1,3,1,2,0 1101 | 3,3,1,3,1,3,0 1102 | 3,3,1,3,2,1,0 1103 | 3,3,1,3,2,2,0 1104 | 3,3,1,3,2,3,0 1105 | 3,3,1,3,3,1,0 1106 | 3,3,1,3,3,2,0 1107 | 3,3,1,3,3,3,0 1108 | 3,3,2,1,1,1,0 1109 | 3,3,2,1,1,2,0 1110 | 3,3,2,1,1,3,0 1111 | 3,3,2,1,2,1,0 1112 | 3,3,2,1,2,2,0 1113 | 3,3,2,1,2,3,0 1114 | 3,3,2,1,3,1,0 1115 | 3,3,2,1,3,2,0 1116 | 3,3,2,1,3,3,0 1117 | 3,3,2,2,1,1,0 1118 | 3,3,2,2,1,2,0 1119 | 3,3,2,2,1,3,0 1120 | 3,3,2,2,2,1,0 1121 | 3,3,2,2,2,2,0 1122 | 3,3,2,2,2,3,0 1123 | 3,3,2,2,3,1,0 1124 | 3,3,2,2,3,2,0 1125 | 3,3,2,2,3,3,0 1126 | 3,3,2,3,1,1,0 1127 | 3,3,2,3,1,2,0 1128 | 3,3,2,3,1,3,0 1129 | 3,3,2,3,2,1,0 1130 | 3,3,2,3,2,2,0 1131 | 3,3,2,3,2,3,0 1132 | 3,3,2,3,3,1,0 1133 | 3,3,2,3,3,2,0 1134 | 3,3,2,3,3,3,0 1135 | 3,3,3,1,1,1,0 1136 | 3,3,3,1,1,2,0 1137 | 3,3,3,1,1,3,0 1138 | 3,3,3,1,2,1,0 1139 | 3,3,3,1,2,2,0 1140 | 3,3,3,1,2,3,0 1141 | 3,3,3,1,3,1,0 1142 | 3,3,3,1,3,2,0 1143 | 3,3,3,1,3,3,0 1144 | 3,3,3,2,1,1,0 1145 | 3,3,3,2,1,2,0 1146 | 3,3,3,2,1,3,0 1147 | 3,3,3,2,2,1,0 1148 | 3,3,3,2,2,2,0 1149 | 3,3,3,2,2,3,0 1150 | 3,3,3,2,3,1,0 1151 | 3,3,3,2,3,2,0 1152 | 3,3,3,2,3,3,0 1153 | 3,3,3,3,1,1,0 1154 | 3,3,3,3,1,2,0 1155 | 3,3,3,3,1,3,0 1156 | 3,3,3,3,2,1,0 1157 | 3,3,3,3,2,2,0 1158 | 3,3,3,3,2,3,0 1159 | 3,3,3,3,3,1,0 1160 | 3,3,3,3,3,2,0 1161 | 3,3,3,3,3,3,0 1162 | 3,3,4,1,1,1,0 1163 | 3,3,4,1,1,2,0 1164 | 3,3,4,1,1,3,0 1165 | 3,3,4,1,2,1,0 1166 | 3,3,4,1,2,2,0 1167 | 3,3,4,1,2,3,0 1168 | 3,3,4,1,3,1,0 1169 | 3,3,4,1,3,2,0 1170 | 3,3,4,1,3,3,0 1171 | 3,3,4,2,1,1,0 1172 | 3,3,4,2,1,2,0 1173 | 3,3,4,2,1,3,0 1174 | 3,3,4,2,2,1,0 1175 | 3,3,4,2,2,2,0 1176 | 3,3,4,2,2,3,0 1177 | 3,3,4,2,3,1,0 1178 | 3,3,4,2,3,2,0 1179 | 3,3,4,2,3,3,0 1180 | 3,3,4,3,1,1,0 1181 | 3,3,4,3,1,2,0 1182 | 3,3,4,3,1,3,0 1183 | 3,3,4,3,2,1,0 1184 | 3,3,4,3,2,2,0 1185 | 3,3,4,3,2,3,0 1186 | 3,3,4,3,3,1,0 1187 | 3,3,4,3,3,2,0 1188 | 3,3,4,3,3,3,0 1189 | 3,4,1,1,1,1,0 1190 | 3,4,1,1,1,2,0 1191 | 3,4,1,1,1,3,0 1192 | 3,4,1,1,2,1,0 1193 | 3,4,1,1,2,2,0 1194 | 3,4,1,1,2,3,0 1195 | 3,4,1,1,3,1,0 1196 | 3,4,1,1,3,2,0 1197 | 3,4,1,1,3,3,0 1198 | 3,4,1,2,1,1,0 1199 | 3,4,1,2,1,2,0 1200 | 3,4,1,2,1,3,1 1201 | 3,4,1,2,2,1,0 1202 | 3,4,1,2,2,2,0 1203 | 3,4,1,2,2,3,1 1204 | 3,4,1,2,3,1,0 1205 | 3,4,1,2,3,2,1 1206 | 3,4,1,2,3,3,0 1207 | 3,4,1,3,1,1,0 1208 | 3,4,1,3,1,2,0 1209 | 3,4,1,3,1,3,0 1210 | 3,4,1,3,2,1,0 1211 | 3,4,1,3,2,2,0 1212 | 3,4,1,3,2,3,1 1213 | 3,4,1,3,3,1,0 1214 | 3,4,1,3,3,2,1 1215 | 3,4,1,3,3,3,0 1216 | 3,4,2,1,1,1,0 1217 | 3,4,2,1,1,2,0 1218 | 3,4,2,1,1,3,0 1219 | 3,4,2,1,2,1,0 1220 | 3,4,2,1,2,2,0 1221 | 3,4,2,1,2,3,0 1222 | 3,4,2,1,3,1,0 1223 | 3,4,2,1,3,2,0 1224 | 3,4,2,1,3,3,0 1225 | 3,4,2,2,1,1,0 1226 | 3,4,2,2,1,2,0 1227 | 3,4,2,2,1,3,1 1228 | 3,4,2,2,2,1,0 1229 | 3,4,2,2,2,2,0 1230 | 3,4,2,2,2,3,1 1231 | 3,4,2,2,3,1,0 1232 | 3,4,2,2,3,2,1 1233 | 3,4,2,2,3,3,0 1234 | 3,4,2,3,1,1,0 1235 | 3,4,2,3,1,2,0 1236 | 3,4,2,3,1,3,1 1237 | 3,4,2,3,2,1,0 1238 | 3,4,2,3,2,2,1 1239 | 3,4,2,3,2,3,0 1240 | 3,4,2,3,3,1,0 1241 | 3,4,2,3,3,2,1 1242 | 3,4,2,3,3,3,0 1243 | 3,4,3,1,1,1,0 1244 | 3,4,3,1,1,2,0 1245 | 3,4,3,1,1,3,0 1246 | 3,4,3,1,2,1,0 1247 | 3,4,3,1,2,2,0 1248 | 3,4,3,1,2,3,0 1249 | 3,4,3,1,3,1,0 1250 | 3,4,3,1,3,2,0 1251 | 3,4,3,1,3,3,0 1252 | 3,4,3,2,1,1,0 1253 | 3,4,3,2,1,2,0 1254 | 3,4,3,2,1,3,1 1255 | 3,4,3,2,2,1,0 1256 | 3,4,3,2,2,2,1 1257 | 3,4,3,2,2,3,0 1258 | 3,4,3,2,3,1,0 1259 | 3,4,3,2,3,2,1 1260 | 3,4,3,2,3,3,0 1261 | 3,4,3,3,1,1,0 1262 | 3,4,3,3,1,2,0 1263 | 3,4,3,3,1,3,1 1264 | 3,4,3,3,2,1,0 1265 | 3,4,3,3,2,2,1 1266 | 3,4,3,3,2,3,0 1267 | 3,4,3,3,3,1,0 1268 | 3,4,3,3,3,2,1 1269 | 3,4,3,3,3,3,0 1270 | 3,4,4,1,1,1,0 1271 | 3,4,4,1,1,2,0 1272 | 3,4,4,1,1,3,0 1273 | 3,4,4,1,2,1,0 1274 | 3,4,4,1,2,2,0 1275 | 3,4,4,1,2,3,0 1276 | 3,4,4,1,3,1,0 1277 | 3,4,4,1,3,2,0 1278 | 3,4,4,1,3,3,0 1279 | 3,4,4,2,1,1,0 1280 | 3,4,4,2,1,2,0 1281 | 3,4,4,2,1,3,1 1282 | 3,4,4,2,2,1,0 1283 | 3,4,4,2,2,2,1 1284 | 3,4,4,2,2,3,0 1285 | 3,4,4,2,3,1,0 1286 | 3,4,4,2,3,2,1 1287 | 3,4,4,2,3,3,0 1288 | 3,4,4,3,1,1,0 1289 | 3,4,4,3,1,2,0 1290 | 3,4,4,3,1,3,1 1291 | 3,4,4,3,2,1,0 1292 | 3,4,4,3,2,2,1 1293 | 3,4,4,3,2,3,0 1294 | 3,4,4,3,3,1,0 1295 | 3,4,4,3,3,2,1 1296 | 3,4,4,3,3,3,0 1297 | 4,1,1,1,1,1,0 1298 | 4,1,1,1,1,2,0 1299 | 4,1,1,1,1,3,0 1300 | 4,1,1,1,2,1,0 1301 | 4,1,1,1,2,2,0 1302 | 4,1,1,1,2,3,0 1303 | 4,1,1,1,3,1,0 1304 | 4,1,1,1,3,2,0 1305 | 4,1,1,1,3,3,0 1306 | 4,1,1,2,1,1,0 1307 | 4,1,1,2,1,2,0 1308 | 4,1,1,2,1,3,0 1309 | 4,1,1,2,2,1,0 1310 | 4,1,1,2,2,2,0 1311 | 4,1,1,2,2,3,0 1312 | 4,1,1,2,3,1,0 1313 | 4,1,1,2,3,2,0 1314 | 4,1,1,2,3,3,0 1315 | 4,1,1,3,1,1,0 1316 | 4,1,1,3,1,2,0 1317 | 4,1,1,3,1,3,0 1318 | 4,1,1,3,2,1,0 1319 | 4,1,1,3,2,2,0 1320 | 4,1,1,3,2,3,0 1321 | 4,1,1,3,3,1,0 1322 | 4,1,1,3,3,2,0 1323 | 4,1,1,3,3,3,0 1324 | 4,1,2,1,1,1,0 1325 | 4,1,2,1,1,2,0 1326 | 4,1,2,1,1,3,0 1327 | 4,1,2,1,2,1,0 1328 | 4,1,2,1,2,2,0 1329 | 4,1,2,1,2,3,0 1330 | 4,1,2,1,3,1,0 1331 | 4,1,2,1,3,2,0 1332 | 4,1,2,1,3,3,0 1333 | 4,1,2,2,1,1,0 1334 | 4,1,2,2,1,2,0 1335 | 4,1,2,2,1,3,0 1336 | 4,1,2,2,2,1,0 1337 | 4,1,2,2,2,2,0 1338 | 4,1,2,2,2,3,0 1339 | 4,1,2,2,3,1,0 1340 | 4,1,2,2,3,2,0 1341 | 4,1,2,2,3,3,0 1342 | 4,1,2,3,1,1,0 1343 | 4,1,2,3,1,2,0 1344 | 4,1,2,3,1,3,0 1345 | 4,1,2,3,2,1,0 1346 | 4,1,2,3,2,2,0 1347 | 4,1,2,3,2,3,0 1348 | 4,1,2,3,3,1,0 1349 | 4,1,2,3,3,2,0 1350 | 4,1,2,3,3,3,0 1351 | 4,1,3,1,1,1,0 1352 | 4,1,3,1,1,2,0 1353 | 4,1,3,1,1,3,0 1354 | 4,1,3,1,2,1,0 1355 | 4,1,3,1,2,2,0 1356 | 4,1,3,1,2,3,0 1357 | 4,1,3,1,3,1,0 1358 | 4,1,3,1,3,2,0 1359 | 4,1,3,1,3,3,0 1360 | 4,1,3,2,1,1,0 1361 | 4,1,3,2,1,2,0 1362 | 4,1,3,2,1,3,0 1363 | 4,1,3,2,2,1,0 1364 | 4,1,3,2,2,2,0 1365 | 4,1,3,2,2,3,0 1366 | 4,1,3,2,3,1,0 1367 | 4,1,3,2,3,2,0 1368 | 4,1,3,2,3,3,0 1369 | 4,1,3,3,1,1,0 1370 | 4,1,3,3,1,2,0 1371 | 4,1,3,3,1,3,0 1372 | 4,1,3,3,2,1,0 1373 | 4,1,3,3,2,2,0 1374 | 4,1,3,3,2,3,0 1375 | 4,1,3,3,3,1,0 1376 | 4,1,3,3,3,2,0 1377 | 4,1,3,3,3,3,0 1378 | 4,1,4,1,1,1,0 1379 | 4,1,4,1,1,2,0 1380 | 4,1,4,1,1,3,0 1381 | 4,1,4,1,2,1,0 1382 | 4,1,4,1,2,2,0 1383 | 4,1,4,1,2,3,0 1384 | 4,1,4,1,3,1,0 1385 | 4,1,4,1,3,2,0 1386 | 4,1,4,1,3,3,0 1387 | 4,1,4,2,1,1,0 1388 | 4,1,4,2,1,2,0 1389 | 4,1,4,2,1,3,0 1390 | 4,1,4,2,2,1,0 1391 | 4,1,4,2,2,2,0 1392 | 4,1,4,2,2,3,0 1393 | 4,1,4,2,3,1,0 1394 | 4,1,4,2,3,2,0 1395 | 4,1,4,2,3,3,0 1396 | 4,1,4,3,1,1,0 1397 | 4,1,4,3,1,2,0 1398 | 4,1,4,3,1,3,0 1399 | 4,1,4,3,2,1,0 1400 | 4,1,4,3,2,2,0 1401 | 4,1,4,3,2,3,0 1402 | 4,1,4,3,3,1,0 1403 | 4,1,4,3,3,2,0 1404 | 4,1,4,3,3,3,0 1405 | 4,2,1,1,1,1,0 1406 | 4,2,1,1,1,2,0 1407 | 4,2,1,1,1,3,0 1408 | 4,2,1,1,2,1,0 1409 | 4,2,1,1,2,2,0 1410 | 4,2,1,1,2,3,0 1411 | 4,2,1,1,3,1,0 1412 | 4,2,1,1,3,2,0 1413 | 4,2,1,1,3,3,0 1414 | 4,2,1,2,1,1,0 1415 | 4,2,1,2,1,2,0 1416 | 4,2,1,2,1,3,0 1417 | 4,2,1,2,2,1,0 1418 | 4,2,1,2,2,2,0 1419 | 4,2,1,2,2,3,0 1420 | 4,2,1,2,3,1,0 1421 | 4,2,1,2,3,2,0 1422 | 4,2,1,2,3,3,0 1423 | 4,2,1,3,1,1,0 1424 | 4,2,1,3,1,2,0 1425 | 4,2,1,3,1,3,0 1426 | 4,2,1,3,2,1,0 1427 | 4,2,1,3,2,2,0 1428 | 4,2,1,3,2,3,0 1429 | 4,2,1,3,3,1,0 1430 | 4,2,1,3,3,2,0 1431 | 4,2,1,3,3,3,0 1432 | 4,2,2,1,1,1,0 1433 | 4,2,2,1,1,2,0 1434 | 4,2,2,1,1,3,0 1435 | 4,2,2,1,2,1,0 1436 | 4,2,2,1,2,2,0 1437 | 4,2,2,1,2,3,0 1438 | 4,2,2,1,3,1,0 1439 | 4,2,2,1,3,2,0 1440 | 4,2,2,1,3,3,0 1441 | 4,2,2,2,1,1,0 1442 | 4,2,2,2,1,2,0 1443 | 4,2,2,2,1,3,0 1444 | 4,2,2,2,2,1,0 1445 | 4,2,2,2,2,2,0 1446 | 4,2,2,2,2,3,0 1447 | 4,2,2,2,3,1,0 1448 | 4,2,2,2,3,2,0 1449 | 4,2,2,2,3,3,0 1450 | 4,2,2,3,1,1,0 1451 | 4,2,2,3,1,2,0 1452 | 4,2,2,3,1,3,0 1453 | 4,2,2,3,2,1,0 1454 | 4,2,2,3,2,2,0 1455 | 4,2,2,3,2,3,0 1456 | 4,2,2,3,3,1,0 1457 | 4,2,2,3,3,2,0 1458 | 4,2,2,3,3,3,0 1459 | 4,2,3,1,1,1,0 1460 | 4,2,3,1,1,2,0 1461 | 4,2,3,1,1,3,0 1462 | 4,2,3,1,2,1,0 1463 | 4,2,3,1,2,2,0 1464 | 4,2,3,1,2,3,0 1465 | 4,2,3,1,3,1,0 1466 | 4,2,3,1,3,2,0 1467 | 4,2,3,1,3,3,0 1468 | 4,2,3,2,1,1,0 1469 | 4,2,3,2,1,2,0 1470 | 4,2,3,2,1,3,0 1471 | 4,2,3,2,2,1,0 1472 | 4,2,3,2,2,2,0 1473 | 4,2,3,2,2,3,0 1474 | 4,2,3,2,3,1,0 1475 | 4,2,3,2,3,2,0 1476 | 4,2,3,2,3,3,0 1477 | 4,2,3,3,1,1,0 1478 | 4,2,3,3,1,2,0 1479 | 4,2,3,3,1,3,0 1480 | 4,2,3,3,2,1,0 1481 | 4,2,3,3,2,2,0 1482 | 4,2,3,3,2,3,0 1483 | 4,2,3,3,3,1,0 1484 | 4,2,3,3,3,2,0 1485 | 4,2,3,3,3,3,0 1486 | 4,2,4,1,1,1,0 1487 | 4,2,4,1,1,2,0 1488 | 4,2,4,1,1,3,0 1489 | 4,2,4,1,2,1,0 1490 | 4,2,4,1,2,2,0 1491 | 4,2,4,1,2,3,0 1492 | 4,2,4,1,3,1,0 1493 | 4,2,4,1,3,2,0 1494 | 4,2,4,1,3,3,0 1495 | 4,2,4,2,1,1,0 1496 | 4,2,4,2,1,2,0 1497 | 4,2,4,2,1,3,0 1498 | 4,2,4,2,2,1,0 1499 | 4,2,4,2,2,2,0 1500 | 4,2,4,2,2,3,0 1501 | 4,2,4,2,3,1,0 1502 | 4,2,4,2,3,2,0 1503 | 4,2,4,2,3,3,0 1504 | 4,2,4,3,1,1,0 1505 | 4,2,4,3,1,2,0 1506 | 4,2,4,3,1,3,0 1507 | 4,2,4,3,2,1,0 1508 | 4,2,4,3,2,2,0 1509 | 4,2,4,3,2,3,0 1510 | 4,2,4,3,3,1,0 1511 | 4,2,4,3,3,2,0 1512 | 4,2,4,3,3,3,0 1513 | 4,3,1,1,1,1,0 1514 | 4,3,1,1,1,2,0 1515 | 4,3,1,1,1,3,0 1516 | 4,3,1,1,2,1,0 1517 | 4,3,1,1,2,2,0 1518 | 4,3,1,1,2,3,0 1519 | 4,3,1,1,3,1,0 1520 | 4,3,1,1,3,2,0 1521 | 4,3,1,1,3,3,0 1522 | 4,3,1,2,1,1,0 1523 | 4,3,1,2,1,2,0 1524 | 4,3,1,2,1,3,1 1525 | 4,3,1,2,2,1,0 1526 | 4,3,1,2,2,2,0 1527 | 4,3,1,2,2,3,1 1528 | 4,3,1,2,3,1,0 1529 | 4,3,1,2,3,2,1 1530 | 4,3,1,2,3,3,0 1531 | 4,3,1,3,1,1,0 1532 | 4,3,1,3,1,2,0 1533 | 4,3,1,3,1,3,0 1534 | 4,3,1,3,2,1,0 1535 | 4,3,1,3,2,2,0 1536 | 4,3,1,3,2,3,1 1537 | 4,3,1,3,3,1,0 1538 | 4,3,1,3,3,2,1 1539 | 4,3,1,3,3,3,0 1540 | 4,3,2,1,1,1,0 1541 | 4,3,2,1,1,2,0 1542 | 4,3,2,1,1,3,0 1543 | 4,3,2,1,2,1,0 1544 | 4,3,2,1,2,2,0 1545 | 4,3,2,1,2,3,0 1546 | 4,3,2,1,3,1,0 1547 | 4,3,2,1,3,2,0 1548 | 4,3,2,1,3,3,0 1549 | 4,3,2,2,1,1,0 1550 | 4,3,2,2,1,2,0 1551 | 4,3,2,2,1,3,1 1552 | 4,3,2,2,2,1,0 1553 | 4,3,2,2,2,2,0 1554 | 4,3,2,2,2,3,1 1555 | 4,3,2,2,3,1,0 1556 | 4,3,2,2,3,2,1 1557 | 4,3,2,2,3,3,0 1558 | 4,3,2,3,1,1,0 1559 | 4,3,2,3,1,2,0 1560 | 4,3,2,3,1,3,1 1561 | 4,3,2,3,2,1,0 1562 | 4,3,2,3,2,2,1 1563 | 4,3,2,3,2,3,0 1564 | 4,3,2,3,3,1,0 1565 | 4,3,2,3,3,2,1 1566 | 4,3,2,3,3,3,0 1567 | 4,3,3,1,1,1,0 1568 | 4,3,3,1,1,2,0 1569 | 4,3,3,1,1,3,0 1570 | 4,3,3,1,2,1,0 1571 | 4,3,3,1,2,2,0 1572 | 4,3,3,1,2,3,0 1573 | 4,3,3,1,3,1,0 1574 | 4,3,3,1,3,2,0 1575 | 4,3,3,1,3,3,0 1576 | 4,3,3,2,1,1,0 1577 | 4,3,3,2,1,2,0 1578 | 4,3,3,2,1,3,1 1579 | 4,3,3,2,2,1,0 1580 | 4,3,3,2,2,2,1 1581 | 4,3,3,2,2,3,0 1582 | 4,3,3,2,3,1,0 1583 | 4,3,3,2,3,2,1 1584 | 4,3,3,2,3,3,0 1585 | 4,3,3,3,1,1,0 1586 | 4,3,3,3,1,2,0 1587 | 4,3,3,3,1,3,1 1588 | 4,3,3,3,2,1,0 1589 | 4,3,3,3,2,2,1 1590 | 4,3,3,3,2,3,0 1591 | 4,3,3,3,3,1,0 1592 | 4,3,3,3,3,2,1 1593 | 4,3,3,3,3,3,0 1594 | 4,3,4,1,1,1,0 1595 | 4,3,4,1,1,2,0 1596 | 4,3,4,1,1,3,0 1597 | 4,3,4,1,2,1,0 1598 | 4,3,4,1,2,2,0 1599 | 4,3,4,1,2,3,0 1600 | 4,3,4,1,3,1,0 1601 | 4,3,4,1,3,2,0 1602 | 4,3,4,1,3,3,0 1603 | 4,3,4,2,1,1,0 1604 | 4,3,4,2,1,2,0 1605 | 4,3,4,2,1,3,1 1606 | 4,3,4,2,2,1,0 1607 | 4,3,4,2,2,2,1 1608 | 4,3,4,2,2,3,0 1609 | 4,3,4,2,3,1,0 1610 | 4,3,4,2,3,2,1 1611 | 4,3,4,2,3,3,0 1612 | 4,3,4,3,1,1,0 1613 | 4,3,4,3,1,2,0 1614 | 4,3,4,3,1,3,1 1615 | 4,3,4,3,2,1,0 1616 | 4,3,4,3,2,2,1 1617 | 4,3,4,3,2,3,0 1618 | 4,3,4,3,3,1,0 1619 | 4,3,4,3,3,2,1 1620 | 4,3,4,3,3,3,0 1621 | 4,4,1,1,1,1,0 1622 | 4,4,1,1,1,2,0 1623 | 4,4,1,1,1,3,0 1624 | 4,4,1,1,2,1,0 1625 | 4,4,1,1,2,2,0 1626 | 4,4,1,1,2,3,0 1627 | 4,4,1,1,3,1,0 1628 | 4,4,1,1,3,2,0 1629 | 4,4,1,1,3,3,0 1630 | 4,4,1,2,1,1,0 1631 | 4,4,1,2,1,2,0 1632 | 4,4,1,2,1,3,1 1633 | 4,4,1,2,2,1,0 1634 | 4,4,1,2,2,2,0 1635 | 4,4,1,2,2,3,1 1636 | 4,4,1,2,3,1,0 1637 | 4,4,1,2,3,2,1 1638 | 4,4,1,2,3,3,0 1639 | 4,4,1,3,1,1,0 1640 | 4,4,1,3,1,2,0 1641 | 4,4,1,3,1,3,0 1642 | 4,4,1,3,2,1,0 1643 | 4,4,1,3,2,2,0 1644 | 4,4,1,3,2,3,1 1645 | 4,4,1,3,3,1,0 1646 | 4,4,1,3,3,2,1 1647 | 4,4,1,3,3,3,0 1648 | 4,4,2,1,1,1,0 1649 | 4,4,2,1,1,2,0 1650 | 4,4,2,1,1,3,0 1651 | 4,4,2,1,2,1,0 1652 | 4,4,2,1,2,2,0 1653 | 4,4,2,1,2,3,0 1654 | 4,4,2,1,3,1,0 1655 | 4,4,2,1,3,2,0 1656 | 4,4,2,1,3,3,0 1657 | 4,4,2,2,1,1,0 1658 | 4,4,2,2,1,2,0 1659 | 4,4,2,2,1,3,1 1660 | 4,4,2,2,2,1,0 1661 | 4,4,2,2,2,2,0 1662 | 4,4,2,2,2,3,1 1663 | 4,4,2,2,3,1,0 1664 | 4,4,2,2,3,2,1 1665 | 4,4,2,2,3,3,0 1666 | 4,4,2,3,1,1,0 1667 | 4,4,2,3,1,2,0 1668 | 4,4,2,3,1,3,1 1669 | 4,4,2,3,2,1,0 1670 | 4,4,2,3,2,2,1 1671 | 4,4,2,3,2,3,0 1672 | 4,4,2,3,3,1,0 1673 | 4,4,2,3,3,2,1 1674 | 4,4,2,3,3,3,0 1675 | 4,4,3,1,1,1,0 1676 | 4,4,3,1,1,2,0 1677 | 4,4,3,1,1,3,0 1678 | 4,4,3,1,2,1,0 1679 | 4,4,3,1,2,2,0 1680 | 4,4,3,1,2,3,0 1681 | 4,4,3,1,3,1,0 1682 | 4,4,3,1,3,2,0 1683 | 4,4,3,1,3,3,0 1684 | 4,4,3,2,1,1,0 1685 | 4,4,3,2,1,2,0 1686 | 4,4,3,2,1,3,1 1687 | 4,4,3,2,2,1,0 1688 | 4,4,3,2,2,2,1 1689 | 4,4,3,2,2,3,0 1690 | 4,4,3,2,3,1,0 1691 | 4,4,3,2,3,2,1 1692 | 4,4,3,2,3,3,0 1693 | 4,4,3,3,1,1,0 1694 | 4,4,3,3,1,2,0 1695 | 4,4,3,3,1,3,1 1696 | 4,4,3,3,2,1,0 1697 | 4,4,3,3,2,2,1 1698 | 4,4,3,3,2,3,0 1699 | 4,4,3,3,3,1,0 1700 | 4,4,3,3,3,2,1 1701 | 4,4,3,3,3,3,0 1702 | 4,4,4,1,1,1,0 1703 | 4,4,4,1,1,2,0 1704 | 4,4,4,1,1,3,0 1705 | 4,4,4,1,2,1,0 1706 | 4,4,4,1,2,2,0 1707 | 4,4,4,1,2,3,0 1708 | 4,4,4,1,3,1,0 1709 | 4,4,4,1,3,2,0 1710 | 4,4,4,1,3,3,0 1711 | 4,4,4,2,1,1,0 1712 | 4,4,4,2,1,2,0 1713 | 4,4,4,2,1,3,1 1714 | 4,4,4,2,2,1,0 1715 | 4,4,4,2,2,2,1 1716 | 4,4,4,2,2,3,0 1717 | 4,4,4,2,3,1,0 1718 | 4,4,4,2,3,2,1 1719 | 4,4,4,2,3,3,0 1720 | 4,4,4,3,1,1,0 1721 | 4,4,4,3,1,2,0 1722 | 4,4,4,3,1,3,1 1723 | 4,4,4,3,2,1,0 1724 | 4,4,4,3,2,2,1 1725 | 4,4,4,3,2,3,0 1726 | 4,4,4,3,3,1,0 1727 | 4,4,4,3,3,2,1 1728 | 4,4,4,3,3,3,0 1729 | -------------------------------------------------------------------------------- /RUSBoost/weka.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnandas/DataSamplingTools/c6501b4d5d4094e06f8bfb2daee42c02ee296a3c/RUSBoost/weka.jar -------------------------------------------------------------------------------- /SMOTEBoost/ARFFheader.txt: -------------------------------------------------------------------------------- 1 | @relation sample 2 | 3 | @attribute att1 {1,2,3,4} 4 | @attribute att2 {1,2,3,4} 5 | @attribute att3 {1,2,3,4} 6 | @attribute att4 {1,2,3} 7 | @attribute att5 {1,2,3} 8 | @attribute att6 {1,2,3} 9 | @attribute class {0,1} 10 | 11 | @data 12 | -------------------------------------------------------------------------------- /SMOTEBoost/CSVtoARFF.m: -------------------------------------------------------------------------------- 1 | function r = CSVtoARFF (data, relation, type) 2 | % csv to arff file converter 3 | 4 | % load the csv data 5 | [rows cols] = size(data); 6 | 7 | % open the arff file for writing 8 | farff = fopen(strcat(type,'.arff'), 'w'); 9 | 10 | % print the relation part of the header 11 | fprintf(farff, '@relation %s', relation); 12 | 13 | % Reading from the ARFF header 14 | fid = fopen('ARFFheader.txt','r'); 15 | tline = fgets(fid); 16 | while ischar(tline) 17 | tline = fgets(fid); 18 | fprintf(farff,'%s',tline); 19 | end 20 | fclose(fid); 21 | 22 | % Converting the data 23 | for i = 1 : rows 24 | % print the attribute values for the data point 25 | for j = 1 : cols - 1 26 | if data(i,j) ~= -1 % check if it is a missing value 27 | fprintf(farff, '%d,', data(i,j)); 28 | else 29 | fprintf(farff, '?,'); 30 | end 31 | end 32 | % print the label for the data point 33 | fprintf(farff, '%d\n', data(i,end)); 34 | end 35 | 36 | % close the file 37 | fclose(farff); 38 | 39 | r = 0; -------------------------------------------------------------------------------- /SMOTEBoost/ClassifierPredict.m: -------------------------------------------------------------------------------- 1 | function prediction = ClassifierPredict(data,model) 2 | % Predicting the labels of the test instances 3 | % Input: data = test data 4 | % model = the trained model 5 | % type = type of classifier 6 | % Output: prediction = prediction labels 7 | 8 | javaaddpath('weka.jar'); 9 | 10 | CSVtoARFF(data,'test','test'); 11 | test_file = 'test.arff'; 12 | reader = javaObject('java.io.FileReader', test_file); 13 | test = javaObject('weka.core.Instances', reader); 14 | test.setClassIndex(test.numAttributes() - 1); 15 | 16 | prediction = []; 17 | for i = 0 : size(data,1) - 1 18 | p = model.classifyInstance(test.instance(i)); 19 | prediction = [prediction; p]; 20 | end -------------------------------------------------------------------------------- /SMOTEBoost/ClassifierTrain.m: -------------------------------------------------------------------------------- 1 | function model = ClassifierTrain(data,type) 2 | % Training the classifier that would do the sample selection 3 | 4 | javaaddpath('weka.jar'); 5 | 6 | CSVtoARFF(data,'train','train'); 7 | train_file = 'train.arff'; 8 | reader = javaObject('java.io.FileReader', train_file); 9 | train = javaObject('weka.core.Instances', reader); 10 | train.setClassIndex(train.numAttributes() - 1); 11 | % options = javaObject('java.lang.String'); 12 | 13 | switch type 14 | case 'svm' 15 | model = javaObject('weka.classifiers.functions.SMO'); 16 | kernel = javaObject('weka.classifiers.functions.supportVector.RBFKernel'); 17 | model.setKernel(kernel); 18 | case 'tree' 19 | model = javaObject('weka.classifiers.trees.J48'); 20 | % options = weka.core.Utils.splitOptions('-C 0.2'); 21 | % model.setOptions(options); 22 | case 'knn' 23 | model = javaObject('weka.classifiers.lazy.IBk'); 24 | model.setKNN(5); 25 | case 'logistic' 26 | model = javaObject('weka.classifiers.functions.Logistic'); 27 | end 28 | 29 | model.buildClassifier(train); -------------------------------------------------------------------------------- /SMOTEBoost/README.txt: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | Author: Barnan Das 3 | Email: barnandas@wsu.edu 4 | Homepage: www.eecs.wsu.edu/~bdas1 5 | Last Updated: June 25, 2012 6 | ****************************************************************************** 7 | 8 | Description of Algorithm: 9 | This code implements SMOTEBoost. SMOTEBoost is an algorithm to handle class 10 | imbalance problem in data with discrete class labels. It uses a combination of 11 | SMOTE and the standard boosting procedure AdaBoost to better model the minority 12 | class by providing the learner not only with the minority class examples that 13 | were misclassified in the previous boosting iteration but also with broader 14 | representation of those instances (achieved by SMOTE). Since boosting 15 | algorithms give equal weight to all misclassified examples and sample from a 16 | pool of data that predominantly consists of majority class, subsequent sampling 17 | of the training set is still skewed towards the majority class. Thus, to reduce 18 | the bias inherent in the learning procedure due to class imbalance and to 19 | increase the sampling weights of minority class, SMOTE is introduced at each 20 | round of boosting. Introduction of SMOTE increases the number of minority class 21 | samples for the learner and focus on these cases in the distribution at each 22 | boosting round. In addition to maximizing the margin for the skewed class 23 | dataset, this procedure also increases the diversity among the classifiers in 24 | the ensemble because at each iteration a different set of synthetic samples are 25 | produced. 26 | 27 | For more detail on the theoretical description of the algorithm please refer to 28 | the following paper: 29 | N.V. Chawla, A.Lazarevic, L.O. Hall, K. Bowyer, "SMOTEBoost: Improving 30 | Prediction of Minority Class in Boosting, Journal of Knowledge Discovery 31 | in Databases: PKDD, 2003. 32 | 33 | Description of Implementation: 34 | The current implementation of SMOTEBoost has been independently done by the author 35 | for the purpose of research. In order to enable the users use a lot of different 36 | weak learners for boosting, an interface is created with Weka API. Currently, 37 | four Weka algortihms could be used as weak learner: J48, SMO, IBk, Logistic. 38 | 39 | Files: 40 | weka.jar -> Weka jar file that is called by several Matlab scripts in this 41 | directory. 42 | 43 | train.arff, test.arff, resampled.arff -> ARFF (Weka compatible) files generated 44 | by some of the Matlab scripts. 45 | 46 | ARFFheader.txt -> Defines the ARFF header for the data file "data.csv". Please 47 | refer to the following link to learn more about ARFF format. 48 | http://www.cs.waikato.ac.nz/ml/weka/arff.html 49 | 50 | SMOTEBoost.m -> Matlab script that implements the SMOTEBoost algorithm. Please 51 | type "help SMOTEBoost" in Matlab Console to the arguments for 52 | this function. 53 | 54 | Test.m -> Matlab script that shows a sample code to use SMOTEBoost function in 55 | Matlab. 56 | 57 | ClassifierTrain.m, ClassifierPredict.m, CSVtoARFF.m -> Matlab functions used by 58 | SMOTEBoost.m 59 | 60 | 61 | **************************************xxx************************************** -------------------------------------------------------------------------------- /SMOTEBoost/SMOTEBoost.m: -------------------------------------------------------------------------------- 1 | function prediction = SMOTEBoost (TRAIN,TEST,WeakLearn,ClassDist) 2 | % This function implements the SMOTEBoost Algorithm. For more details on the 3 | % theoretical description of the algorithm please refer to the following 4 | % paper: 5 | % N.V. Chawla, A.Lazarevic, L.O. Hall, K. Bowyer, "SMOTEBoost: Improving 6 | % Prediction of Minority Class in Boosting, Journal of Knowledge Discovery 7 | % in Databases: PKDD, 2003. 8 | % Input: TRAIN = Training data as matrix 9 | % TEST = Test data as matrix 10 | % WeakLearn = String to choose algortihm. Choices are 11 | % 'svm','tree','knn' and 'logistic'. 12 | % ClassDist = true or false. true indicates that the class 13 | % distribution is maintained while doing weighted 14 | % resampling and before SMOTE is called at each 15 | % iteration. false indicates that the class distribution 16 | % is not maintained while resampling. 17 | % Output: prediction = size(TEST,1)x 2 matrix. Col 1 is class labels for 18 | % all instances. Col 2 is probability of the instances 19 | % being classified as positive class. 20 | 21 | javaaddpath('weka.jar'); 22 | 23 | %% Training SMOTEBoost 24 | % Total number of instances in the training set 25 | m = size(TRAIN,1); 26 | POS_DATA = TRAIN(TRAIN(:,end)==1,:); 27 | NEG_DATA = TRAIN(TRAIN(:,end)==0,:); 28 | pos_size = size(POS_DATA,1); 29 | neg_size = size(NEG_DATA,1); 30 | 31 | % Reorganize TRAIN by putting all the positive and negative exampels 32 | % together, respectively. 33 | TRAIN = [POS_DATA;NEG_DATA]; 34 | 35 | % Converting training set into Weka compatible format 36 | CSVtoARFF (TRAIN, 'train', 'train'); 37 | train_reader = javaObject('java.io.FileReader', 'train.arff'); 38 | train = javaObject('weka.core.Instances', train_reader); 39 | train.setClassIndex(train.numAttributes() - 1); 40 | 41 | % Total number of iterations of the boosting method 42 | T = 10; 43 | 44 | % W stores the weights of the instances in each row for every iteration of 45 | % boosting. Weights for all the instances are initialized by 1/m for the 46 | % first iteration. 47 | W = zeros(1,m); 48 | for i = 1:m 49 | W(1,i) = 1/m; 50 | end 51 | 52 | % L stores pseudo loss values, H stores hypothesis, B stores (1/beta) 53 | % values that is used as the weight of the % hypothesis while forming the 54 | % final hypothesis. % All of the following are of length <=T and stores 55 | % values for every iteration of the boosting process. 56 | L = []; 57 | H = {}; 58 | B = []; 59 | 60 | % Loop counter 61 | t = 1; 62 | 63 | % Keeps counts of the number of times the same boosting iteration have been 64 | % repeated 65 | count = 0; 66 | 67 | % Boosting T iterations 68 | while t <= T 69 | 70 | % LOG MESSAGE 71 | disp (['Boosting iteration #' int2str(t)]); 72 | 73 | if ClassDist == true 74 | % Resampling POS_DATA with weights of positive example 75 | POS_WT = zeros(1,pos_size); 76 | sum_POS_WT = sum(W(t,1:pos_size)); 77 | for i = 1:pos_size 78 | POS_WT(i) = W(t,i)/sum_POS_WT ; 79 | end 80 | RESAM_POS = POS_DATA(randsample(1:pos_size,pos_size,true,POS_WT),:); 81 | 82 | % Resampling NEG_DATA with weights of positive example 83 | NEG_WT = zeros(1,neg_size); 84 | sum_NEG_WT = sum(W(t,pos_size+1:m)); 85 | for i = 1:neg_size 86 | NEG_WT(i) = W(t,pos_size+i)/sum_NEG_WT ; 87 | end 88 | RESAM_NEG = NEG_DATA(randsample(1:neg_size,neg_size,true,NEG_WT),:); 89 | 90 | % Resampled TRAIN is stored in RESAMPLED 91 | RESAMPLED = [RESAM_POS;RESAM_NEG]; 92 | 93 | % Calulating the percentage of boosting the positive class. 'pert' 94 | % is used as a parameter of SMOTE 95 | pert = ((neg_size-pos_size)/pos_size)*100; 96 | else 97 | % Indices of resampled train 98 | RND_IDX = randsample(1:m,m,true,W(t,:)); 99 | 100 | % Resampled TRAIN is stored in RESAMPLED 101 | RESAMPLED = TRAIN(RND_IDX,:); 102 | 103 | % Calulating the percentage of boosting the positive class. 'pert' 104 | % is used as a parameter of SMOTE 105 | pos_size = sum(RESAMPLED(:,end)==1); 106 | neg_size = sum(RESAMPLED(:,end)==0); 107 | pert = ((neg_size-pos_size)/pos_size)*100; 108 | end 109 | 110 | % Converting resample training set into Weka compatible format 111 | CSVtoARFF (RESAMPLED,'resampled','resampled'); 112 | reader = javaObject('java.io.FileReader','resampled.arff'); 113 | resampled = javaObject('weka.core.Instances',reader); 114 | resampled.setClassIndex(resampled.numAttributes()-1); 115 | 116 | % New SMOTE boosted data gets stored in S 117 | smote = javaObject('weka.filters.supervised.instance.SMOTE'); 118 | pert = ((neg_size-pos_size)/pos_size)*100; 119 | smote.setPercentage(pert); 120 | smote.setInputFormat(resampled); 121 | 122 | S = weka.filters.Filter.useFilter(resampled, smote); 123 | 124 | % Training a weak learner. 'pred' is the weak hypothesis. However, the 125 | % hypothesis function is encoded in 'model'. 126 | switch WeakLearn 127 | case 'svm' 128 | model = javaObject('weka.classifiers.functions.SMO'); 129 | case 'tree' 130 | model = javaObject('weka.classifiers.trees.J48'); 131 | case 'knn' 132 | model = javaObject('weka.classifiers.lazy.IBk'); 133 | model.setKNN(5); 134 | case 'logistic' 135 | model = javaObject('weka.classifiers.functions.Logistic'); 136 | end 137 | model.buildClassifier(S); 138 | 139 | pred = zeros(m,1); 140 | for i = 0 : m - 1 141 | pred(i+1) = model.classifyInstance(train.instance(i)); 142 | end 143 | 144 | % Computing the pseudo loss of hypothesis 'model' 145 | loss = 0; 146 | for i = 1:m 147 | if TRAIN(i,end)==pred(i) 148 | continue; 149 | else 150 | loss = loss + W(t,i); 151 | end 152 | end 153 | 154 | % If count exceeds a pre-defined threshold (5 in the current 155 | % implementation), the loop is broken and rolled back to the state 156 | % where loss > 0.5 was not encountered. 157 | if count > 5 158 | L = L(1:t-1); 159 | H = H(1:t-1); 160 | B = B(1:t-1); 161 | disp (' Too many iterations have loss > 0.5'); 162 | disp (' Aborting boosting...'); 163 | break; 164 | end 165 | 166 | % If the loss is greater than 1/2, it means that an inverted 167 | % hypothesis would perform better. In such cases, do not take that 168 | % hypothesis into consideration and repeat the same iteration. 'count' 169 | % keeps counts of the number of times the same boosting iteration have 170 | % been repeated 171 | if loss > 0.5 172 | count = count + 1; 173 | continue; 174 | else 175 | count = 1; 176 | end 177 | 178 | L(t) = loss; % Pseudo-loss at each iteration 179 | H{t} = model; % Hypothesis function 180 | beta = loss/(1-loss); % Setting weight update parameter 'beta'. 181 | B(t) = log(1/beta); % Weight of the hypothesis 182 | 183 | % At the final iteration there is no need to update the weights any 184 | % further 185 | if t==T 186 | break; 187 | end 188 | 189 | % Updating weight 190 | for i = 1:m 191 | if TRAIN(i,end)==pred(i) 192 | W(t+1,i) = W(t,i)*beta; 193 | else 194 | W(t+1,i) = W(t,i); 195 | end 196 | end 197 | 198 | % Normalizing the weight for the next iteration 199 | sum_W = sum(W(t+1,:)); 200 | for i = 1:m 201 | W(t+1,i) = W(t+1,i)/sum_W; 202 | end 203 | 204 | % Incrementing loop counter 205 | t = t + 1; 206 | end 207 | 208 | % The final hypothesis is calculated and tested on the test set 209 | % simulteneously. 210 | 211 | %% Testing SMOTEBoost 212 | n = size(TEST,1); % Total number of instances in the test set 213 | 214 | CSVtoARFF(TEST,'test','test'); 215 | test = 'test.arff'; 216 | test_reader = javaObject('java.io.FileReader', test); 217 | test = javaObject('weka.core.Instances', test_reader); 218 | test.setClassIndex(test.numAttributes() - 1); 219 | 220 | % Normalizing B 221 | sum_B = sum(B); 222 | for i = 1:size(B,2) 223 | B(i) = B(i)/sum_B; 224 | end 225 | 226 | prediction = zeros(n,2); 227 | 228 | for i = 1:n 229 | % Calculating the total weight of the class labels from all the models 230 | % produced during boosting 231 | wt_zero = 0; 232 | wt_one = 0; 233 | for j = 1:size(H,2) 234 | p = H{j}.classifyInstance(test.instance(i-1)); 235 | if p==1 236 | wt_one = wt_one + B(j); 237 | else 238 | wt_zero = wt_zero + B(j); 239 | end 240 | end 241 | 242 | if (wt_one > wt_zero) 243 | prediction(i,:) = [1 wt_one]; 244 | else 245 | prediction(i,:) = [0 wt_one]; 246 | end 247 | end -------------------------------------------------------------------------------- /SMOTEBoost/Test.m: -------------------------------------------------------------------------------- 1 | clc; 2 | clear all; 3 | close all; 4 | 5 | file = 'data.csv'; % Dataset 6 | 7 | % Reading training file 8 | data = dlmread(file); 9 | label = data(:,end); 10 | 11 | % Extracting positive data points 12 | idx = (label==1); 13 | pos_data = data(idx,:); 14 | row_pos = size(pos_data,1); 15 | 16 | % Extracting negative data points 17 | neg_data = data(~idx,:); 18 | row_neg = size(neg_data,1); 19 | 20 | % Random permuation of positive and negative data points 21 | p = randperm(row_pos); 22 | n = randperm(row_neg); 23 | 24 | % 80-20 split for training and test 25 | tstpf = p(1:round(row_pos/5)); 26 | tstnf = n(1:round(row_neg/5)); 27 | trpf = setdiff(p, tstpf); 28 | trnf = setdiff(n, tstnf); 29 | 30 | train_data = [pos_data(trpf,:);neg_data(trnf,:)]; 31 | test_data = [pos_data(tstpf,:);neg_data(tstnf,:)]; 32 | 33 | % Decision Tree 34 | prediction = SMOTEBoost(train_data,test_data,'tree',false); 35 | disp (' Label Probability'); 36 | disp ('-----------------------------'); 37 | disp (prediction); -------------------------------------------------------------------------------- /SMOTEBoost/data.csv: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,0 2 | 1,1,1,1,1,2,0 3 | 1,1,1,1,1,3,0 4 | 1,1,1,1,2,1,0 5 | 1,1,1,1,2,2,0 6 | 1,1,1,1,2,3,0 7 | 1,1,1,1,3,1,0 8 | 1,1,1,1,3,2,0 9 | 1,1,1,1,3,3,0 10 | 1,1,1,2,1,1,0 11 | 1,1,1,2,1,2,0 12 | 1,1,1,2,1,3,0 13 | 1,1,1,2,2,1,0 14 | 1,1,1,2,2,2,0 15 | 1,1,1,2,2,3,0 16 | 1,1,1,2,3,1,0 17 | 1,1,1,2,3,2,0 18 | 1,1,1,2,3,3,0 19 | 1,1,1,3,1,1,0 20 | 1,1,1,3,1,2,0 21 | 1,1,1,3,1,3,0 22 | 1,1,1,3,2,1,0 23 | 1,1,1,3,2,2,0 24 | 1,1,1,3,2,3,0 25 | 1,1,1,3,3,1,0 26 | 1,1,1,3,3,2,0 27 | 1,1,1,3,3,3,0 28 | 1,1,2,1,1,1,0 29 | 1,1,2,1,1,2,0 30 | 1,1,2,1,1,3,0 31 | 1,1,2,1,2,1,0 32 | 1,1,2,1,2,2,0 33 | 1,1,2,1,2,3,0 34 | 1,1,2,1,3,1,0 35 | 1,1,2,1,3,2,0 36 | 1,1,2,1,3,3,0 37 | 1,1,2,2,1,1,0 38 | 1,1,2,2,1,2,0 39 | 1,1,2,2,1,3,0 40 | 1,1,2,2,2,1,0 41 | 1,1,2,2,2,2,0 42 | 1,1,2,2,2,3,0 43 | 1,1,2,2,3,1,0 44 | 1,1,2,2,3,2,0 45 | 1,1,2,2,3,3,0 46 | 1,1,2,3,1,1,0 47 | 1,1,2,3,1,2,0 48 | 1,1,2,3,1,3,0 49 | 1,1,2,3,2,1,0 50 | 1,1,2,3,2,2,0 51 | 1,1,2,3,2,3,0 52 | 1,1,2,3,3,1,0 53 | 1,1,2,3,3,2,0 54 | 1,1,2,3,3,3,0 55 | 1,1,3,1,1,1,0 56 | 1,1,3,1,1,2,0 57 | 1,1,3,1,1,3,0 58 | 1,1,3,1,2,1,0 59 | 1,1,3,1,2,2,0 60 | 1,1,3,1,2,3,0 61 | 1,1,3,1,3,1,0 62 | 1,1,3,1,3,2,0 63 | 1,1,3,1,3,3,0 64 | 1,1,3,2,1,1,0 65 | 1,1,3,2,1,2,0 66 | 1,1,3,2,1,3,0 67 | 1,1,3,2,2,1,0 68 | 1,1,3,2,2,2,0 69 | 1,1,3,2,2,3,0 70 | 1,1,3,2,3,1,0 71 | 1,1,3,2,3,2,0 72 | 1,1,3,2,3,3,0 73 | 1,1,3,3,1,1,0 74 | 1,1,3,3,1,2,0 75 | 1,1,3,3,1,3,0 76 | 1,1,3,3,2,1,0 77 | 1,1,3,3,2,2,0 78 | 1,1,3,3,2,3,0 79 | 1,1,3,3,3,1,0 80 | 1,1,3,3,3,2,0 81 | 1,1,3,3,3,3,0 82 | 1,1,4,1,1,1,0 83 | 1,1,4,1,1,2,0 84 | 1,1,4,1,1,3,0 85 | 1,1,4,1,2,1,0 86 | 1,1,4,1,2,2,0 87 | 1,1,4,1,2,3,0 88 | 1,1,4,1,3,1,0 89 | 1,1,4,1,3,2,0 90 | 1,1,4,1,3,3,0 91 | 1,1,4,2,1,1,0 92 | 1,1,4,2,1,2,0 93 | 1,1,4,2,1,3,0 94 | 1,1,4,2,2,1,0 95 | 1,1,4,2,2,2,0 96 | 1,1,4,2,2,3,0 97 | 1,1,4,2,3,1,0 98 | 1,1,4,2,3,2,0 99 | 1,1,4,2,3,3,0 100 | 1,1,4,3,1,1,0 101 | 1,1,4,3,1,2,0 102 | 1,1,4,3,1,3,0 103 | 1,1,4,3,2,1,0 104 | 1,1,4,3,2,2,0 105 | 1,1,4,3,2,3,0 106 | 1,1,4,3,3,1,0 107 | 1,1,4,3,3,2,0 108 | 1,1,4,3,3,3,0 109 | 1,2,1,1,1,1,0 110 | 1,2,1,1,1,2,0 111 | 1,2,1,1,1,3,0 112 | 1,2,1,1,2,1,0 113 | 1,2,1,1,2,2,0 114 | 1,2,1,1,2,3,0 115 | 1,2,1,1,3,1,0 116 | 1,2,1,1,3,2,0 117 | 1,2,1,1,3,3,0 118 | 1,2,1,2,1,1,0 119 | 1,2,1,2,1,2,0 120 | 1,2,1,2,1,3,0 121 | 1,2,1,2,2,1,0 122 | 1,2,1,2,2,2,0 123 | 1,2,1,2,2,3,0 124 | 1,2,1,2,3,1,0 125 | 1,2,1,2,3,2,0 126 | 1,2,1,2,3,3,0 127 | 1,2,1,3,1,1,0 128 | 1,2,1,3,1,2,0 129 | 1,2,1,3,1,3,0 130 | 1,2,1,3,2,1,0 131 | 1,2,1,3,2,2,0 132 | 1,2,1,3,2,3,0 133 | 1,2,1,3,3,1,0 134 | 1,2,1,3,3,2,0 135 | 1,2,1,3,3,3,0 136 | 1,2,2,1,1,1,0 137 | 1,2,2,1,1,2,0 138 | 1,2,2,1,1,3,0 139 | 1,2,2,1,2,1,0 140 | 1,2,2,1,2,2,0 141 | 1,2,2,1,2,3,0 142 | 1,2,2,1,3,1,0 143 | 1,2,2,1,3,2,0 144 | 1,2,2,1,3,3,0 145 | 1,2,2,2,1,1,0 146 | 1,2,2,2,1,2,0 147 | 1,2,2,2,1,3,0 148 | 1,2,2,2,2,1,0 149 | 1,2,2,2,2,2,0 150 | 1,2,2,2,2,3,0 151 | 1,2,2,2,3,1,0 152 | 1,2,2,2,3,2,0 153 | 1,2,2,2,3,3,0 154 | 1,2,2,3,1,1,0 155 | 1,2,2,3,1,2,0 156 | 1,2,2,3,1,3,0 157 | 1,2,2,3,2,1,0 158 | 1,2,2,3,2,2,0 159 | 1,2,2,3,2,3,0 160 | 1,2,2,3,3,1,0 161 | 1,2,2,3,3,2,0 162 | 1,2,2,3,3,3,0 163 | 1,2,3,1,1,1,0 164 | 1,2,3,1,1,2,0 165 | 1,2,3,1,1,3,0 166 | 1,2,3,1,2,1,0 167 | 1,2,3,1,2,2,0 168 | 1,2,3,1,2,3,0 169 | 1,2,3,1,3,1,0 170 | 1,2,3,1,3,2,0 171 | 1,2,3,1,3,3,0 172 | 1,2,3,2,1,1,0 173 | 1,2,3,2,1,2,0 174 | 1,2,3,2,1,3,0 175 | 1,2,3,2,2,1,0 176 | 1,2,3,2,2,2,0 177 | 1,2,3,2,2,3,0 178 | 1,2,3,2,3,1,0 179 | 1,2,3,2,3,2,0 180 | 1,2,3,2,3,3,0 181 | 1,2,3,3,1,1,0 182 | 1,2,3,3,1,2,0 183 | 1,2,3,3,1,3,0 184 | 1,2,3,3,2,1,0 185 | 1,2,3,3,2,2,0 186 | 1,2,3,3,2,3,0 187 | 1,2,3,3,3,1,0 188 | 1,2,3,3,3,2,0 189 | 1,2,3,3,3,3,0 190 | 1,2,4,1,1,1,0 191 | 1,2,4,1,1,2,0 192 | 1,2,4,1,1,3,0 193 | 1,2,4,1,2,1,0 194 | 1,2,4,1,2,2,0 195 | 1,2,4,1,2,3,0 196 | 1,2,4,1,3,1,0 197 | 1,2,4,1,3,2,0 198 | 1,2,4,1,3,3,0 199 | 1,2,4,2,1,1,0 200 | 1,2,4,2,1,2,0 201 | 1,2,4,2,1,3,0 202 | 1,2,4,2,2,1,0 203 | 1,2,4,2,2,2,0 204 | 1,2,4,2,2,3,0 205 | 1,2,4,2,3,1,0 206 | 1,2,4,2,3,2,0 207 | 1,2,4,2,3,3,0 208 | 1,2,4,3,1,1,0 209 | 1,2,4,3,1,2,0 210 | 1,2,4,3,1,3,0 211 | 1,2,4,3,2,1,0 212 | 1,2,4,3,2,2,0 213 | 1,2,4,3,2,3,0 214 | 1,2,4,3,3,1,0 215 | 1,2,4,3,3,2,0 216 | 1,2,4,3,3,3,0 217 | 1,3,1,1,1,1,0 218 | 1,3,1,1,1,2,0 219 | 1,3,1,1,1,3,0 220 | 1,3,1,1,2,1,0 221 | 1,3,1,1,2,2,0 222 | 1,3,1,1,2,3,0 223 | 1,3,1,1,3,1,0 224 | 1,3,1,1,3,2,0 225 | 1,3,1,1,3,3,0 226 | 1,3,1,2,1,1,0 227 | 1,3,1,2,1,2,0 228 | 1,3,1,2,1,3,0 229 | 1,3,1,2,2,1,0 230 | 1,3,1,2,2,2,0 231 | 1,3,1,2,2,3,0 232 | 1,3,1,2,3,1,0 233 | 1,3,1,2,3,2,0 234 | 1,3,1,2,3,3,0 235 | 1,3,1,3,1,1,0 236 | 1,3,1,3,1,2,0 237 | 1,3,1,3,1,3,0 238 | 1,3,1,3,2,1,0 239 | 1,3,1,3,2,2,0 240 | 1,3,1,3,2,3,0 241 | 1,3,1,3,3,1,0 242 | 1,3,1,3,3,2,0 243 | 1,3,1,3,3,3,0 244 | 1,3,2,1,1,1,0 245 | 1,3,2,1,1,2,0 246 | 1,3,2,1,1,3,0 247 | 1,3,2,1,2,1,0 248 | 1,3,2,1,2,2,0 249 | 1,3,2,1,2,3,0 250 | 1,3,2,1,3,1,0 251 | 1,3,2,1,3,2,0 252 | 1,3,2,1,3,3,0 253 | 1,3,2,2,1,1,0 254 | 1,3,2,2,1,2,0 255 | 1,3,2,2,1,3,0 256 | 1,3,2,2,2,1,0 257 | 1,3,2,2,2,2,0 258 | 1,3,2,2,2,3,0 259 | 1,3,2,2,3,1,0 260 | 1,3,2,2,3,2,0 261 | 1,3,2,2,3,3,0 262 | 1,3,2,3,1,1,0 263 | 1,3,2,3,1,2,0 264 | 1,3,2,3,1,3,0 265 | 1,3,2,3,2,1,0 266 | 1,3,2,3,2,2,0 267 | 1,3,2,3,2,3,0 268 | 1,3,2,3,3,1,0 269 | 1,3,2,3,3,2,0 270 | 1,3,2,3,3,3,0 271 | 1,3,3,1,1,1,0 272 | 1,3,3,1,1,2,0 273 | 1,3,3,1,1,3,0 274 | 1,3,3,1,2,1,0 275 | 1,3,3,1,2,2,0 276 | 1,3,3,1,2,3,0 277 | 1,3,3,1,3,1,0 278 | 1,3,3,1,3,2,0 279 | 1,3,3,1,3,3,0 280 | 1,3,3,2,1,1,0 281 | 1,3,3,2,1,2,0 282 | 1,3,3,2,1,3,0 283 | 1,3,3,2,2,1,0 284 | 1,3,3,2,2,2,0 285 | 1,3,3,2,2,3,0 286 | 1,3,3,2,3,1,0 287 | 1,3,3,2,3,2,0 288 | 1,3,3,2,3,3,0 289 | 1,3,3,3,1,1,0 290 | 1,3,3,3,1,2,0 291 | 1,3,3,3,1,3,0 292 | 1,3,3,3,2,1,0 293 | 1,3,3,3,2,2,0 294 | 1,3,3,3,2,3,0 295 | 1,3,3,3,3,1,0 296 | 1,3,3,3,3,2,0 297 | 1,3,3,3,3,3,0 298 | 1,3,4,1,1,1,0 299 | 1,3,4,1,1,2,0 300 | 1,3,4,1,1,3,0 301 | 1,3,4,1,2,1,0 302 | 1,3,4,1,2,2,0 303 | 1,3,4,1,2,3,0 304 | 1,3,4,1,3,1,0 305 | 1,3,4,1,3,2,0 306 | 1,3,4,1,3,3,0 307 | 1,3,4,2,1,1,0 308 | 1,3,4,2,1,2,0 309 | 1,3,4,2,1,3,0 310 | 1,3,4,2,2,1,0 311 | 1,3,4,2,2,2,0 312 | 1,3,4,2,2,3,0 313 | 1,3,4,2,3,1,0 314 | 1,3,4,2,3,2,0 315 | 1,3,4,2,3,3,0 316 | 1,3,4,3,1,1,0 317 | 1,3,4,3,1,2,0 318 | 1,3,4,3,1,3,0 319 | 1,3,4,3,2,1,0 320 | 1,3,4,3,2,2,0 321 | 1,3,4,3,2,3,0 322 | 1,3,4,3,3,1,0 323 | 1,3,4,3,3,2,0 324 | 1,3,4,3,3,3,0 325 | 1,4,1,1,1,1,0 326 | 1,4,1,1,1,2,0 327 | 1,4,1,1,1,3,0 328 | 1,4,1,1,2,1,0 329 | 1,4,1,1,2,2,0 330 | 1,4,1,1,2,3,0 331 | 1,4,1,1,3,1,0 332 | 1,4,1,1,3,2,0 333 | 1,4,1,1,3,3,0 334 | 1,4,1,2,1,1,0 335 | 1,4,1,2,1,2,0 336 | 1,4,1,2,1,3,0 337 | 1,4,1,2,2,1,0 338 | 1,4,1,2,2,2,0 339 | 1,4,1,2,2,3,0 340 | 1,4,1,2,3,1,0 341 | 1,4,1,2,3,2,0 342 | 1,4,1,2,3,3,0 343 | 1,4,1,3,1,1,0 344 | 1,4,1,3,1,2,0 345 | 1,4,1,3,1,3,0 346 | 1,4,1,3,2,1,0 347 | 1,4,1,3,2,2,0 348 | 1,4,1,3,2,3,0 349 | 1,4,1,3,3,1,0 350 | 1,4,1,3,3,2,0 351 | 1,4,1,3,3,3,0 352 | 1,4,2,1,1,1,0 353 | 1,4,2,1,1,2,0 354 | 1,4,2,1,1,3,0 355 | 1,4,2,1,2,1,0 356 | 1,4,2,1,2,2,0 357 | 1,4,2,1,2,3,0 358 | 1,4,2,1,3,1,0 359 | 1,4,2,1,3,2,0 360 | 1,4,2,1,3,3,0 361 | 1,4,2,2,1,1,0 362 | 1,4,2,2,1,2,0 363 | 1,4,2,2,1,3,0 364 | 1,4,2,2,2,1,0 365 | 1,4,2,2,2,2,0 366 | 1,4,2,2,2,3,0 367 | 1,4,2,2,3,1,0 368 | 1,4,2,2,3,2,0 369 | 1,4,2,2,3,3,0 370 | 1,4,2,3,1,1,0 371 | 1,4,2,3,1,2,0 372 | 1,4,2,3,1,3,0 373 | 1,4,2,3,2,1,0 374 | 1,4,2,3,2,2,0 375 | 1,4,2,3,2,3,0 376 | 1,4,2,3,3,1,0 377 | 1,4,2,3,3,2,0 378 | 1,4,2,3,3,3,0 379 | 1,4,3,1,1,1,0 380 | 1,4,3,1,1,2,0 381 | 1,4,3,1,1,3,0 382 | 1,4,3,1,2,1,0 383 | 1,4,3,1,2,2,0 384 | 1,4,3,1,2,3,0 385 | 1,4,3,1,3,1,0 386 | 1,4,3,1,3,2,0 387 | 1,4,3,1,3,3,0 388 | 1,4,3,2,1,1,0 389 | 1,4,3,2,1,2,0 390 | 1,4,3,2,1,3,0 391 | 1,4,3,2,2,1,0 392 | 1,4,3,2,2,2,0 393 | 1,4,3,2,2,3,0 394 | 1,4,3,2,3,1,0 395 | 1,4,3,2,3,2,0 396 | 1,4,3,2,3,3,0 397 | 1,4,3,3,1,1,0 398 | 1,4,3,3,1,2,0 399 | 1,4,3,3,1,3,0 400 | 1,4,3,3,2,1,0 401 | 1,4,3,3,2,2,0 402 | 1,4,3,3,2,3,0 403 | 1,4,3,3,3,1,0 404 | 1,4,3,3,3,2,0 405 | 1,4,3,3,3,3,0 406 | 1,4,4,1,1,1,0 407 | 1,4,4,1,1,2,0 408 | 1,4,4,1,1,3,0 409 | 1,4,4,1,2,1,0 410 | 1,4,4,1,2,2,0 411 | 1,4,4,1,2,3,0 412 | 1,4,4,1,3,1,0 413 | 1,4,4,1,3,2,0 414 | 1,4,4,1,3,3,0 415 | 1,4,4,2,1,1,0 416 | 1,4,4,2,1,2,0 417 | 1,4,4,2,1,3,0 418 | 1,4,4,2,2,1,0 419 | 1,4,4,2,2,2,0 420 | 1,4,4,2,2,3,0 421 | 1,4,4,2,3,1,0 422 | 1,4,4,2,3,2,0 423 | 1,4,4,2,3,3,0 424 | 1,4,4,3,1,1,0 425 | 1,4,4,3,1,2,0 426 | 1,4,4,3,1,3,0 427 | 1,4,4,3,2,1,0 428 | 1,4,4,3,2,2,0 429 | 1,4,4,3,2,3,0 430 | 1,4,4,3,3,1,0 431 | 1,4,4,3,3,2,0 432 | 1,4,4,3,3,3,0 433 | 2,1,1,1,1,1,0 434 | 2,1,1,1,1,2,0 435 | 2,1,1,1,1,3,0 436 | 2,1,1,1,2,1,0 437 | 2,1,1,1,2,2,0 438 | 2,1,1,1,2,3,0 439 | 2,1,1,1,3,1,0 440 | 2,1,1,1,3,2,0 441 | 2,1,1,1,3,3,0 442 | 2,1,1,2,1,1,0 443 | 2,1,1,2,1,2,0 444 | 2,1,1,2,1,3,0 445 | 2,1,1,2,2,1,0 446 | 2,1,1,2,2,2,0 447 | 2,1,1,2,2,3,0 448 | 2,1,1,2,3,1,0 449 | 2,1,1,2,3,2,0 450 | 2,1,1,2,3,3,0 451 | 2,1,1,3,1,1,0 452 | 2,1,1,3,1,2,0 453 | 2,1,1,3,1,3,0 454 | 2,1,1,3,2,1,0 455 | 2,1,1,3,2,2,0 456 | 2,1,1,3,2,3,0 457 | 2,1,1,3,3,1,0 458 | 2,1,1,3,3,2,0 459 | 2,1,1,3,3,3,0 460 | 2,1,2,1,1,1,0 461 | 2,1,2,1,1,2,0 462 | 2,1,2,1,1,3,0 463 | 2,1,2,1,2,1,0 464 | 2,1,2,1,2,2,0 465 | 2,1,2,1,2,3,0 466 | 2,1,2,1,3,1,0 467 | 2,1,2,1,3,2,0 468 | 2,1,2,1,3,3,0 469 | 2,1,2,2,1,1,0 470 | 2,1,2,2,1,2,0 471 | 2,1,2,2,1,3,0 472 | 2,1,2,2,2,1,0 473 | 2,1,2,2,2,2,0 474 | 2,1,2,2,2,3,0 475 | 2,1,2,2,3,1,0 476 | 2,1,2,2,3,2,0 477 | 2,1,2,2,3,3,0 478 | 2,1,2,3,1,1,0 479 | 2,1,2,3,1,2,0 480 | 2,1,2,3,1,3,0 481 | 2,1,2,3,2,1,0 482 | 2,1,2,3,2,2,0 483 | 2,1,2,3,2,3,0 484 | 2,1,2,3,3,1,0 485 | 2,1,2,3,3,2,0 486 | 2,1,2,3,3,3,0 487 | 2,1,3,1,1,1,0 488 | 2,1,3,1,1,2,0 489 | 2,1,3,1,1,3,0 490 | 2,1,3,1,2,1,0 491 | 2,1,3,1,2,2,0 492 | 2,1,3,1,2,3,0 493 | 2,1,3,1,3,1,0 494 | 2,1,3,1,3,2,0 495 | 2,1,3,1,3,3,0 496 | 2,1,3,2,1,1,0 497 | 2,1,3,2,1,2,0 498 | 2,1,3,2,1,3,0 499 | 2,1,3,2,2,1,0 500 | 2,1,3,2,2,2,0 501 | 2,1,3,2,2,3,0 502 | 2,1,3,2,3,1,0 503 | 2,1,3,2,3,2,0 504 | 2,1,3,2,3,3,0 505 | 2,1,3,3,1,1,0 506 | 2,1,3,3,1,2,0 507 | 2,1,3,3,1,3,0 508 | 2,1,3,3,2,1,0 509 | 2,1,3,3,2,2,0 510 | 2,1,3,3,2,3,0 511 | 2,1,3,3,3,1,0 512 | 2,1,3,3,3,2,0 513 | 2,1,3,3,3,3,0 514 | 2,1,4,1,1,1,0 515 | 2,1,4,1,1,2,0 516 | 2,1,4,1,1,3,0 517 | 2,1,4,1,2,1,0 518 | 2,1,4,1,2,2,0 519 | 2,1,4,1,2,3,0 520 | 2,1,4,1,3,1,0 521 | 2,1,4,1,3,2,0 522 | 2,1,4,1,3,3,0 523 | 2,1,4,2,1,1,0 524 | 2,1,4,2,1,2,0 525 | 2,1,4,2,1,3,0 526 | 2,1,4,2,2,1,0 527 | 2,1,4,2,2,2,0 528 | 2,1,4,2,2,3,0 529 | 2,1,4,2,3,1,0 530 | 2,1,4,2,3,2,0 531 | 2,1,4,2,3,3,0 532 | 2,1,4,3,1,1,0 533 | 2,1,4,3,1,2,0 534 | 2,1,4,3,1,3,0 535 | 2,1,4,3,2,1,0 536 | 2,1,4,3,2,2,0 537 | 2,1,4,3,2,3,0 538 | 2,1,4,3,3,1,0 539 | 2,1,4,3,3,2,0 540 | 2,1,4,3,3,3,0 541 | 2,2,1,1,1,1,0 542 | 2,2,1,1,1,2,0 543 | 2,2,1,1,1,3,0 544 | 2,2,1,1,2,1,0 545 | 2,2,1,1,2,2,0 546 | 2,2,1,1,2,3,0 547 | 2,2,1,1,3,1,0 548 | 2,2,1,1,3,2,0 549 | 2,2,1,1,3,3,0 550 | 2,2,1,2,1,1,0 551 | 2,2,1,2,1,2,0 552 | 2,2,1,2,1,3,0 553 | 2,2,1,2,2,1,0 554 | 2,2,1,2,2,2,0 555 | 2,2,1,2,2,3,0 556 | 2,2,1,2,3,1,0 557 | 2,2,1,2,3,2,0 558 | 2,2,1,2,3,3,0 559 | 2,2,1,3,1,1,0 560 | 2,2,1,3,1,2,0 561 | 2,2,1,3,1,3,0 562 | 2,2,1,3,2,1,0 563 | 2,2,1,3,2,2,0 564 | 2,2,1,3,2,3,0 565 | 2,2,1,3,3,1,0 566 | 2,2,1,3,3,2,0 567 | 2,2,1,3,3,3,0 568 | 2,2,2,1,1,1,0 569 | 2,2,2,1,1,2,0 570 | 2,2,2,1,1,3,0 571 | 2,2,2,1,2,1,0 572 | 2,2,2,1,2,2,0 573 | 2,2,2,1,2,3,0 574 | 2,2,2,1,3,1,0 575 | 2,2,2,1,3,2,0 576 | 2,2,2,1,3,3,0 577 | 2,2,2,2,1,1,0 578 | 2,2,2,2,1,2,0 579 | 2,2,2,2,1,3,0 580 | 2,2,2,2,2,1,0 581 | 2,2,2,2,2,2,0 582 | 2,2,2,2,2,3,0 583 | 2,2,2,2,3,1,0 584 | 2,2,2,2,3,2,0 585 | 2,2,2,2,3,3,0 586 | 2,2,2,3,1,1,0 587 | 2,2,2,3,1,2,0 588 | 2,2,2,3,1,3,0 589 | 2,2,2,3,2,1,0 590 | 2,2,2,3,2,2,0 591 | 2,2,2,3,2,3,0 592 | 2,2,2,3,3,1,0 593 | 2,2,2,3,3,2,0 594 | 2,2,2,3,3,3,0 595 | 2,2,3,1,1,1,0 596 | 2,2,3,1,1,2,0 597 | 2,2,3,1,1,3,0 598 | 2,2,3,1,2,1,0 599 | 2,2,3,1,2,2,0 600 | 2,2,3,1,2,3,0 601 | 2,2,3,1,3,1,0 602 | 2,2,3,1,3,2,0 603 | 2,2,3,1,3,3,0 604 | 2,2,3,2,1,1,0 605 | 2,2,3,2,1,2,0 606 | 2,2,3,2,1,3,0 607 | 2,2,3,2,2,1,0 608 | 2,2,3,2,2,2,0 609 | 2,2,3,2,2,3,0 610 | 2,2,3,2,3,1,0 611 | 2,2,3,2,3,2,0 612 | 2,2,3,2,3,3,0 613 | 2,2,3,3,1,1,0 614 | 2,2,3,3,1,2,0 615 | 2,2,3,3,1,3,0 616 | 2,2,3,3,2,1,0 617 | 2,2,3,3,2,2,0 618 | 2,2,3,3,2,3,0 619 | 2,2,3,3,3,1,0 620 | 2,2,3,3,3,2,0 621 | 2,2,3,3,3,3,0 622 | 2,2,4,1,1,1,0 623 | 2,2,4,1,1,2,0 624 | 2,2,4,1,1,3,0 625 | 2,2,4,1,2,1,0 626 | 2,2,4,1,2,2,0 627 | 2,2,4,1,2,3,0 628 | 2,2,4,1,3,1,0 629 | 2,2,4,1,3,2,0 630 | 2,2,4,1,3,3,0 631 | 2,2,4,2,1,1,0 632 | 2,2,4,2,1,2,0 633 | 2,2,4,2,1,3,0 634 | 2,2,4,2,2,1,0 635 | 2,2,4,2,2,2,0 636 | 2,2,4,2,2,3,0 637 | 2,2,4,2,3,1,0 638 | 2,2,4,2,3,2,0 639 | 2,2,4,2,3,3,0 640 | 2,2,4,3,1,1,0 641 | 2,2,4,3,1,2,0 642 | 2,2,4,3,1,3,0 643 | 2,2,4,3,2,1,0 644 | 2,2,4,3,2,2,0 645 | 2,2,4,3,2,3,0 646 | 2,2,4,3,3,1,0 647 | 2,2,4,3,3,2,0 648 | 2,2,4,3,3,3,0 649 | 2,3,1,1,1,1,0 650 | 2,3,1,1,1,2,0 651 | 2,3,1,1,1,3,0 652 | 2,3,1,1,2,1,0 653 | 2,3,1,1,2,2,0 654 | 2,3,1,1,2,3,0 655 | 2,3,1,1,3,1,0 656 | 2,3,1,1,3,2,0 657 | 2,3,1,1,3,3,0 658 | 2,3,1,2,1,1,0 659 | 2,3,1,2,1,2,0 660 | 2,3,1,2,1,3,0 661 | 2,3,1,2,2,1,0 662 | 2,3,1,2,2,2,0 663 | 2,3,1,2,2,3,0 664 | 2,3,1,2,3,1,0 665 | 2,3,1,2,3,2,0 666 | 2,3,1,2,3,3,0 667 | 2,3,1,3,1,1,0 668 | 2,3,1,3,1,2,0 669 | 2,3,1,3,1,3,0 670 | 2,3,1,3,2,1,0 671 | 2,3,1,3,2,2,0 672 | 2,3,1,3,2,3,0 673 | 2,3,1,3,3,1,0 674 | 2,3,1,3,3,2,0 675 | 2,3,1,3,3,3,0 676 | 2,3,2,1,1,1,0 677 | 2,3,2,1,1,2,0 678 | 2,3,2,1,1,3,0 679 | 2,3,2,1,2,1,0 680 | 2,3,2,1,2,2,0 681 | 2,3,2,1,2,3,0 682 | 2,3,2,1,3,1,0 683 | 2,3,2,1,3,2,0 684 | 2,3,2,1,3,3,0 685 | 2,3,2,2,1,1,0 686 | 2,3,2,2,1,2,0 687 | 2,3,2,2,1,3,0 688 | 2,3,2,2,2,1,0 689 | 2,3,2,2,2,2,0 690 | 2,3,2,2,2,3,0 691 | 2,3,2,2,3,1,0 692 | 2,3,2,2,3,2,0 693 | 2,3,2,2,3,3,0 694 | 2,3,2,3,1,1,0 695 | 2,3,2,3,1,2,0 696 | 2,3,2,3,1,3,0 697 | 2,3,2,3,2,1,0 698 | 2,3,2,3,2,2,0 699 | 2,3,2,3,2,3,0 700 | 2,3,2,3,3,1,0 701 | 2,3,2,3,3,2,0 702 | 2,3,2,3,3,3,0 703 | 2,3,3,1,1,1,0 704 | 2,3,3,1,1,2,0 705 | 2,3,3,1,1,3,0 706 | 2,3,3,1,2,1,0 707 | 2,3,3,1,2,2,0 708 | 2,3,3,1,2,3,0 709 | 2,3,3,1,3,1,0 710 | 2,3,3,1,3,2,0 711 | 2,3,3,1,3,3,0 712 | 2,3,3,2,1,1,0 713 | 2,3,3,2,1,2,0 714 | 2,3,3,2,1,3,0 715 | 2,3,3,2,2,1,0 716 | 2,3,3,2,2,2,0 717 | 2,3,3,2,2,3,0 718 | 2,3,3,2,3,1,0 719 | 2,3,3,2,3,2,0 720 | 2,3,3,2,3,3,0 721 | 2,3,3,3,1,1,0 722 | 2,3,3,3,1,2,0 723 | 2,3,3,3,1,3,0 724 | 2,3,3,3,2,1,0 725 | 2,3,3,3,2,2,0 726 | 2,3,3,3,2,3,0 727 | 2,3,3,3,3,1,0 728 | 2,3,3,3,3,2,0 729 | 2,3,3,3,3,3,0 730 | 2,3,4,1,1,1,0 731 | 2,3,4,1,1,2,0 732 | 2,3,4,1,1,3,0 733 | 2,3,4,1,2,1,0 734 | 2,3,4,1,2,2,0 735 | 2,3,4,1,2,3,0 736 | 2,3,4,1,3,1,0 737 | 2,3,4,1,3,2,0 738 | 2,3,4,1,3,3,0 739 | 2,3,4,2,1,1,0 740 | 2,3,4,2,1,2,0 741 | 2,3,4,2,1,3,0 742 | 2,3,4,2,2,1,0 743 | 2,3,4,2,2,2,0 744 | 2,3,4,2,2,3,0 745 | 2,3,4,2,3,1,0 746 | 2,3,4,2,3,2,0 747 | 2,3,4,2,3,3,0 748 | 2,3,4,3,1,1,0 749 | 2,3,4,3,1,2,0 750 | 2,3,4,3,1,3,0 751 | 2,3,4,3,2,1,0 752 | 2,3,4,3,2,2,0 753 | 2,3,4,3,2,3,0 754 | 2,3,4,3,3,1,0 755 | 2,3,4,3,3,2,0 756 | 2,3,4,3,3,3,0 757 | 2,4,1,1,1,1,0 758 | 2,4,1,1,1,2,0 759 | 2,4,1,1,1,3,0 760 | 2,4,1,1,2,1,0 761 | 2,4,1,1,2,2,0 762 | 2,4,1,1,2,3,0 763 | 2,4,1,1,3,1,0 764 | 2,4,1,1,3,2,0 765 | 2,4,1,1,3,3,0 766 | 2,4,1,2,1,1,0 767 | 2,4,1,2,1,2,0 768 | 2,4,1,2,1,3,0 769 | 2,4,1,2,2,1,0 770 | 2,4,1,2,2,2,0 771 | 2,4,1,2,2,3,0 772 | 2,4,1,2,3,1,0 773 | 2,4,1,2,3,2,0 774 | 2,4,1,2,3,3,0 775 | 2,4,1,3,1,1,0 776 | 2,4,1,3,1,2,0 777 | 2,4,1,3,1,3,0 778 | 2,4,1,3,2,1,0 779 | 2,4,1,3,2,2,0 780 | 2,4,1,3,2,3,0 781 | 2,4,1,3,3,1,0 782 | 2,4,1,3,3,2,0 783 | 2,4,1,3,3,3,0 784 | 2,4,2,1,1,1,0 785 | 2,4,2,1,1,2,0 786 | 2,4,2,1,1,3,0 787 | 2,4,2,1,2,1,0 788 | 2,4,2,1,2,2,0 789 | 2,4,2,1,2,3,0 790 | 2,4,2,1,3,1,0 791 | 2,4,2,1,3,2,0 792 | 2,4,2,1,3,3,0 793 | 2,4,2,2,1,1,0 794 | 2,4,2,2,1,2,0 795 | 2,4,2,2,1,3,0 796 | 2,4,2,2,2,1,0 797 | 2,4,2,2,2,2,0 798 | 2,4,2,2,2,3,0 799 | 2,4,2,2,3,1,0 800 | 2,4,2,2,3,2,0 801 | 2,4,2,2,3,3,0 802 | 2,4,2,3,1,1,0 803 | 2,4,2,3,1,2,0 804 | 2,4,2,3,1,3,0 805 | 2,4,2,3,2,1,0 806 | 2,4,2,3,2,2,0 807 | 2,4,2,3,2,3,0 808 | 2,4,2,3,3,1,0 809 | 2,4,2,3,3,2,0 810 | 2,4,2,3,3,3,0 811 | 2,4,3,1,1,1,0 812 | 2,4,3,1,1,2,0 813 | 2,4,3,1,1,3,0 814 | 2,4,3,1,2,1,0 815 | 2,4,3,1,2,2,0 816 | 2,4,3,1,2,3,0 817 | 2,4,3,1,3,1,0 818 | 2,4,3,1,3,2,0 819 | 2,4,3,1,3,3,0 820 | 2,4,3,2,1,1,0 821 | 2,4,3,2,1,2,0 822 | 2,4,3,2,1,3,0 823 | 2,4,3,2,2,1,0 824 | 2,4,3,2,2,2,0 825 | 2,4,3,2,2,3,0 826 | 2,4,3,2,3,1,0 827 | 2,4,3,2,3,2,0 828 | 2,4,3,2,3,3,0 829 | 2,4,3,3,1,1,0 830 | 2,4,3,3,1,2,0 831 | 2,4,3,3,1,3,0 832 | 2,4,3,3,2,1,0 833 | 2,4,3,3,2,2,0 834 | 2,4,3,3,2,3,0 835 | 2,4,3,3,3,1,0 836 | 2,4,3,3,3,2,0 837 | 2,4,3,3,3,3,0 838 | 2,4,4,1,1,1,0 839 | 2,4,4,1,1,2,0 840 | 2,4,4,1,1,3,0 841 | 2,4,4,1,2,1,0 842 | 2,4,4,1,2,2,0 843 | 2,4,4,1,2,3,0 844 | 2,4,4,1,3,1,0 845 | 2,4,4,1,3,2,0 846 | 2,4,4,1,3,3,0 847 | 2,4,4,2,1,1,0 848 | 2,4,4,2,1,2,0 849 | 2,4,4,2,1,3,0 850 | 2,4,4,2,2,1,0 851 | 2,4,4,2,2,2,0 852 | 2,4,4,2,2,3,0 853 | 2,4,4,2,3,1,0 854 | 2,4,4,2,3,2,0 855 | 2,4,4,2,3,3,0 856 | 2,4,4,3,1,1,0 857 | 2,4,4,3,1,2,0 858 | 2,4,4,3,1,3,0 859 | 2,4,4,3,2,1,0 860 | 2,4,4,3,2,2,0 861 | 2,4,4,3,2,3,0 862 | 2,4,4,3,3,1,0 863 | 2,4,4,3,3,2,0 864 | 2,4,4,3,3,3,0 865 | 3,1,1,1,1,1,0 866 | 3,1,1,1,1,2,0 867 | 3,1,1,1,1,3,0 868 | 3,1,1,1,2,1,0 869 | 3,1,1,1,2,2,0 870 | 3,1,1,1,2,3,0 871 | 3,1,1,1,3,1,0 872 | 3,1,1,1,3,2,0 873 | 3,1,1,1,3,3,0 874 | 3,1,1,2,1,1,0 875 | 3,1,1,2,1,2,0 876 | 3,1,1,2,1,3,0 877 | 3,1,1,2,2,1,0 878 | 3,1,1,2,2,2,0 879 | 3,1,1,2,2,3,0 880 | 3,1,1,2,3,1,0 881 | 3,1,1,2,3,2,0 882 | 3,1,1,2,3,3,0 883 | 3,1,1,3,1,1,0 884 | 3,1,1,3,1,2,0 885 | 3,1,1,3,1,3,0 886 | 3,1,1,3,2,1,0 887 | 3,1,1,3,2,2,0 888 | 3,1,1,3,2,3,0 889 | 3,1,1,3,3,1,0 890 | 3,1,1,3,3,2,0 891 | 3,1,1,3,3,3,0 892 | 3,1,2,1,1,1,0 893 | 3,1,2,1,1,2,0 894 | 3,1,2,1,1,3,0 895 | 3,1,2,1,2,1,0 896 | 3,1,2,1,2,2,0 897 | 3,1,2,1,2,3,0 898 | 3,1,2,1,3,1,0 899 | 3,1,2,1,3,2,0 900 | 3,1,2,1,3,3,0 901 | 3,1,2,2,1,1,0 902 | 3,1,2,2,1,2,0 903 | 3,1,2,2,1,3,0 904 | 3,1,2,2,2,1,0 905 | 3,1,2,2,2,2,0 906 | 3,1,2,2,2,3,0 907 | 3,1,2,2,3,1,0 908 | 3,1,2,2,3,2,0 909 | 3,1,2,2,3,3,0 910 | 3,1,2,3,1,1,0 911 | 3,1,2,3,1,2,0 912 | 3,1,2,3,1,3,0 913 | 3,1,2,3,2,1,0 914 | 3,1,2,3,2,2,0 915 | 3,1,2,3,2,3,0 916 | 3,1,2,3,3,1,0 917 | 3,1,2,3,3,2,0 918 | 3,1,2,3,3,3,0 919 | 3,1,3,1,1,1,0 920 | 3,1,3,1,1,2,0 921 | 3,1,3,1,1,3,0 922 | 3,1,3,1,2,1,0 923 | 3,1,3,1,2,2,0 924 | 3,1,3,1,2,3,0 925 | 3,1,3,1,3,1,0 926 | 3,1,3,1,3,2,0 927 | 3,1,3,1,3,3,0 928 | 3,1,3,2,1,1,0 929 | 3,1,3,2,1,2,0 930 | 3,1,3,2,1,3,0 931 | 3,1,3,2,2,1,0 932 | 3,1,3,2,2,2,0 933 | 3,1,3,2,2,3,0 934 | 3,1,3,2,3,1,0 935 | 3,1,3,2,3,2,0 936 | 3,1,3,2,3,3,0 937 | 3,1,3,3,1,1,0 938 | 3,1,3,3,1,2,0 939 | 3,1,3,3,1,3,0 940 | 3,1,3,3,2,1,0 941 | 3,1,3,3,2,2,0 942 | 3,1,3,3,2,3,0 943 | 3,1,3,3,3,1,0 944 | 3,1,3,3,3,2,0 945 | 3,1,3,3,3,3,0 946 | 3,1,4,1,1,1,0 947 | 3,1,4,1,1,2,0 948 | 3,1,4,1,1,3,0 949 | 3,1,4,1,2,1,0 950 | 3,1,4,1,2,2,0 951 | 3,1,4,1,2,3,0 952 | 3,1,4,1,3,1,0 953 | 3,1,4,1,3,2,0 954 | 3,1,4,1,3,3,0 955 | 3,1,4,2,1,1,0 956 | 3,1,4,2,1,2,0 957 | 3,1,4,2,1,3,0 958 | 3,1,4,2,2,1,0 959 | 3,1,4,2,2,2,0 960 | 3,1,4,2,2,3,0 961 | 3,1,4,2,3,1,0 962 | 3,1,4,2,3,2,0 963 | 3,1,4,2,3,3,0 964 | 3,1,4,3,1,1,0 965 | 3,1,4,3,1,2,0 966 | 3,1,4,3,1,3,0 967 | 3,1,4,3,2,1,0 968 | 3,1,4,3,2,2,0 969 | 3,1,4,3,2,3,0 970 | 3,1,4,3,3,1,0 971 | 3,1,4,3,3,2,0 972 | 3,1,4,3,3,3,0 973 | 3,2,1,1,1,1,0 974 | 3,2,1,1,1,2,0 975 | 3,2,1,1,1,3,0 976 | 3,2,1,1,2,1,0 977 | 3,2,1,1,2,2,0 978 | 3,2,1,1,2,3,0 979 | 3,2,1,1,3,1,0 980 | 3,2,1,1,3,2,0 981 | 3,2,1,1,3,3,0 982 | 3,2,1,2,1,1,0 983 | 3,2,1,2,1,2,0 984 | 3,2,1,2,1,3,0 985 | 3,2,1,2,2,1,0 986 | 3,2,1,2,2,2,0 987 | 3,2,1,2,2,3,0 988 | 3,2,1,2,3,1,0 989 | 3,2,1,2,3,2,0 990 | 3,2,1,2,3,3,0 991 | 3,2,1,3,1,1,0 992 | 3,2,1,3,1,2,0 993 | 3,2,1,3,1,3,0 994 | 3,2,1,3,2,1,0 995 | 3,2,1,3,2,2,0 996 | 3,2,1,3,2,3,0 997 | 3,2,1,3,3,1,0 998 | 3,2,1,3,3,2,0 999 | 3,2,1,3,3,3,0 1000 | 3,2,2,1,1,1,0 1001 | 3,2,2,1,1,2,0 1002 | 3,2,2,1,1,3,0 1003 | 3,2,2,1,2,1,0 1004 | 3,2,2,1,2,2,0 1005 | 3,2,2,1,2,3,0 1006 | 3,2,2,1,3,1,0 1007 | 3,2,2,1,3,2,0 1008 | 3,2,2,1,3,3,0 1009 | 3,2,2,2,1,1,0 1010 | 3,2,2,2,1,2,0 1011 | 3,2,2,2,1,3,0 1012 | 3,2,2,2,2,1,0 1013 | 3,2,2,2,2,2,0 1014 | 3,2,2,2,2,3,0 1015 | 3,2,2,2,3,1,0 1016 | 3,2,2,2,3,2,0 1017 | 3,2,2,2,3,3,0 1018 | 3,2,2,3,1,1,0 1019 | 3,2,2,3,1,2,0 1020 | 3,2,2,3,1,3,0 1021 | 3,2,2,3,2,1,0 1022 | 3,2,2,3,2,2,0 1023 | 3,2,2,3,2,3,0 1024 | 3,2,2,3,3,1,0 1025 | 3,2,2,3,3,2,0 1026 | 3,2,2,3,3,3,0 1027 | 3,2,3,1,1,1,0 1028 | 3,2,3,1,1,2,0 1029 | 3,2,3,1,1,3,0 1030 | 3,2,3,1,2,1,0 1031 | 3,2,3,1,2,2,0 1032 | 3,2,3,1,2,3,0 1033 | 3,2,3,1,3,1,0 1034 | 3,2,3,1,3,2,0 1035 | 3,2,3,1,3,3,0 1036 | 3,2,3,2,1,1,0 1037 | 3,2,3,2,1,2,0 1038 | 3,2,3,2,1,3,0 1039 | 3,2,3,2,2,1,0 1040 | 3,2,3,2,2,2,0 1041 | 3,2,3,2,2,3,0 1042 | 3,2,3,2,3,1,0 1043 | 3,2,3,2,3,2,0 1044 | 3,2,3,2,3,3,0 1045 | 3,2,3,3,1,1,0 1046 | 3,2,3,3,1,2,0 1047 | 3,2,3,3,1,3,0 1048 | 3,2,3,3,2,1,0 1049 | 3,2,3,3,2,2,0 1050 | 3,2,3,3,2,3,0 1051 | 3,2,3,3,3,1,0 1052 | 3,2,3,3,3,2,0 1053 | 3,2,3,3,3,3,0 1054 | 3,2,4,1,1,1,0 1055 | 3,2,4,1,1,2,0 1056 | 3,2,4,1,1,3,0 1057 | 3,2,4,1,2,1,0 1058 | 3,2,4,1,2,2,0 1059 | 3,2,4,1,2,3,0 1060 | 3,2,4,1,3,1,0 1061 | 3,2,4,1,3,2,0 1062 | 3,2,4,1,3,3,0 1063 | 3,2,4,2,1,1,0 1064 | 3,2,4,2,1,2,0 1065 | 3,2,4,2,1,3,0 1066 | 3,2,4,2,2,1,0 1067 | 3,2,4,2,2,2,0 1068 | 3,2,4,2,2,3,0 1069 | 3,2,4,2,3,1,0 1070 | 3,2,4,2,3,2,0 1071 | 3,2,4,2,3,3,0 1072 | 3,2,4,3,1,1,0 1073 | 3,2,4,3,1,2,0 1074 | 3,2,4,3,1,3,0 1075 | 3,2,4,3,2,1,0 1076 | 3,2,4,3,2,2,0 1077 | 3,2,4,3,2,3,0 1078 | 3,2,4,3,3,1,0 1079 | 3,2,4,3,3,2,0 1080 | 3,2,4,3,3,3,0 1081 | 3,3,1,1,1,1,0 1082 | 3,3,1,1,1,2,0 1083 | 3,3,1,1,1,3,0 1084 | 3,3,1,1,2,1,0 1085 | 3,3,1,1,2,2,0 1086 | 3,3,1,1,2,3,0 1087 | 3,3,1,1,3,1,0 1088 | 3,3,1,1,3,2,0 1089 | 3,3,1,1,3,3,0 1090 | 3,3,1,2,1,1,0 1091 | 3,3,1,2,1,2,0 1092 | 3,3,1,2,1,3,0 1093 | 3,3,1,2,2,1,0 1094 | 3,3,1,2,2,2,0 1095 | 3,3,1,2,2,3,0 1096 | 3,3,1,2,3,1,0 1097 | 3,3,1,2,3,2,0 1098 | 3,3,1,2,3,3,0 1099 | 3,3,1,3,1,1,0 1100 | 3,3,1,3,1,2,0 1101 | 3,3,1,3,1,3,0 1102 | 3,3,1,3,2,1,0 1103 | 3,3,1,3,2,2,0 1104 | 3,3,1,3,2,3,0 1105 | 3,3,1,3,3,1,0 1106 | 3,3,1,3,3,2,0 1107 | 3,3,1,3,3,3,0 1108 | 3,3,2,1,1,1,0 1109 | 3,3,2,1,1,2,0 1110 | 3,3,2,1,1,3,0 1111 | 3,3,2,1,2,1,0 1112 | 3,3,2,1,2,2,0 1113 | 3,3,2,1,2,3,0 1114 | 3,3,2,1,3,1,0 1115 | 3,3,2,1,3,2,0 1116 | 3,3,2,1,3,3,0 1117 | 3,3,2,2,1,1,0 1118 | 3,3,2,2,1,2,0 1119 | 3,3,2,2,1,3,0 1120 | 3,3,2,2,2,1,0 1121 | 3,3,2,2,2,2,0 1122 | 3,3,2,2,2,3,0 1123 | 3,3,2,2,3,1,0 1124 | 3,3,2,2,3,2,0 1125 | 3,3,2,2,3,3,0 1126 | 3,3,2,3,1,1,0 1127 | 3,3,2,3,1,2,0 1128 | 3,3,2,3,1,3,0 1129 | 3,3,2,3,2,1,0 1130 | 3,3,2,3,2,2,0 1131 | 3,3,2,3,2,3,0 1132 | 3,3,2,3,3,1,0 1133 | 3,3,2,3,3,2,0 1134 | 3,3,2,3,3,3,0 1135 | 3,3,3,1,1,1,0 1136 | 3,3,3,1,1,2,0 1137 | 3,3,3,1,1,3,0 1138 | 3,3,3,1,2,1,0 1139 | 3,3,3,1,2,2,0 1140 | 3,3,3,1,2,3,0 1141 | 3,3,3,1,3,1,0 1142 | 3,3,3,1,3,2,0 1143 | 3,3,3,1,3,3,0 1144 | 3,3,3,2,1,1,0 1145 | 3,3,3,2,1,2,0 1146 | 3,3,3,2,1,3,0 1147 | 3,3,3,2,2,1,0 1148 | 3,3,3,2,2,2,0 1149 | 3,3,3,2,2,3,0 1150 | 3,3,3,2,3,1,0 1151 | 3,3,3,2,3,2,0 1152 | 3,3,3,2,3,3,0 1153 | 3,3,3,3,1,1,0 1154 | 3,3,3,3,1,2,0 1155 | 3,3,3,3,1,3,0 1156 | 3,3,3,3,2,1,0 1157 | 3,3,3,3,2,2,0 1158 | 3,3,3,3,2,3,0 1159 | 3,3,3,3,3,1,0 1160 | 3,3,3,3,3,2,0 1161 | 3,3,3,3,3,3,0 1162 | 3,3,4,1,1,1,0 1163 | 3,3,4,1,1,2,0 1164 | 3,3,4,1,1,3,0 1165 | 3,3,4,1,2,1,0 1166 | 3,3,4,1,2,2,0 1167 | 3,3,4,1,2,3,0 1168 | 3,3,4,1,3,1,0 1169 | 3,3,4,1,3,2,0 1170 | 3,3,4,1,3,3,0 1171 | 3,3,4,2,1,1,0 1172 | 3,3,4,2,1,2,0 1173 | 3,3,4,2,1,3,0 1174 | 3,3,4,2,2,1,0 1175 | 3,3,4,2,2,2,0 1176 | 3,3,4,2,2,3,0 1177 | 3,3,4,2,3,1,0 1178 | 3,3,4,2,3,2,0 1179 | 3,3,4,2,3,3,0 1180 | 3,3,4,3,1,1,0 1181 | 3,3,4,3,1,2,0 1182 | 3,3,4,3,1,3,0 1183 | 3,3,4,3,2,1,0 1184 | 3,3,4,3,2,2,0 1185 | 3,3,4,3,2,3,0 1186 | 3,3,4,3,3,1,0 1187 | 3,3,4,3,3,2,0 1188 | 3,3,4,3,3,3,0 1189 | 3,4,1,1,1,1,0 1190 | 3,4,1,1,1,2,0 1191 | 3,4,1,1,1,3,0 1192 | 3,4,1,1,2,1,0 1193 | 3,4,1,1,2,2,0 1194 | 3,4,1,1,2,3,0 1195 | 3,4,1,1,3,1,0 1196 | 3,4,1,1,3,2,0 1197 | 3,4,1,1,3,3,0 1198 | 3,4,1,2,1,1,0 1199 | 3,4,1,2,1,2,0 1200 | 3,4,1,2,1,3,1 1201 | 3,4,1,2,2,1,0 1202 | 3,4,1,2,2,2,0 1203 | 3,4,1,2,2,3,1 1204 | 3,4,1,2,3,1,0 1205 | 3,4,1,2,3,2,1 1206 | 3,4,1,2,3,3,0 1207 | 3,4,1,3,1,1,0 1208 | 3,4,1,3,1,2,0 1209 | 3,4,1,3,1,3,0 1210 | 3,4,1,3,2,1,0 1211 | 3,4,1,3,2,2,0 1212 | 3,4,1,3,2,3,1 1213 | 3,4,1,3,3,1,0 1214 | 3,4,1,3,3,2,1 1215 | 3,4,1,3,3,3,0 1216 | 3,4,2,1,1,1,0 1217 | 3,4,2,1,1,2,0 1218 | 3,4,2,1,1,3,0 1219 | 3,4,2,1,2,1,0 1220 | 3,4,2,1,2,2,0 1221 | 3,4,2,1,2,3,0 1222 | 3,4,2,1,3,1,0 1223 | 3,4,2,1,3,2,0 1224 | 3,4,2,1,3,3,0 1225 | 3,4,2,2,1,1,0 1226 | 3,4,2,2,1,2,0 1227 | 3,4,2,2,1,3,1 1228 | 3,4,2,2,2,1,0 1229 | 3,4,2,2,2,2,0 1230 | 3,4,2,2,2,3,1 1231 | 3,4,2,2,3,1,0 1232 | 3,4,2,2,3,2,1 1233 | 3,4,2,2,3,3,0 1234 | 3,4,2,3,1,1,0 1235 | 3,4,2,3,1,2,0 1236 | 3,4,2,3,1,3,1 1237 | 3,4,2,3,2,1,0 1238 | 3,4,2,3,2,2,1 1239 | 3,4,2,3,2,3,0 1240 | 3,4,2,3,3,1,0 1241 | 3,4,2,3,3,2,1 1242 | 3,4,2,3,3,3,0 1243 | 3,4,3,1,1,1,0 1244 | 3,4,3,1,1,2,0 1245 | 3,4,3,1,1,3,0 1246 | 3,4,3,1,2,1,0 1247 | 3,4,3,1,2,2,0 1248 | 3,4,3,1,2,3,0 1249 | 3,4,3,1,3,1,0 1250 | 3,4,3,1,3,2,0 1251 | 3,4,3,1,3,3,0 1252 | 3,4,3,2,1,1,0 1253 | 3,4,3,2,1,2,0 1254 | 3,4,3,2,1,3,1 1255 | 3,4,3,2,2,1,0 1256 | 3,4,3,2,2,2,1 1257 | 3,4,3,2,2,3,0 1258 | 3,4,3,2,3,1,0 1259 | 3,4,3,2,3,2,1 1260 | 3,4,3,2,3,3,0 1261 | 3,4,3,3,1,1,0 1262 | 3,4,3,3,1,2,0 1263 | 3,4,3,3,1,3,1 1264 | 3,4,3,3,2,1,0 1265 | 3,4,3,3,2,2,1 1266 | 3,4,3,3,2,3,0 1267 | 3,4,3,3,3,1,0 1268 | 3,4,3,3,3,2,1 1269 | 3,4,3,3,3,3,0 1270 | 3,4,4,1,1,1,0 1271 | 3,4,4,1,1,2,0 1272 | 3,4,4,1,1,3,0 1273 | 3,4,4,1,2,1,0 1274 | 3,4,4,1,2,2,0 1275 | 3,4,4,1,2,3,0 1276 | 3,4,4,1,3,1,0 1277 | 3,4,4,1,3,2,0 1278 | 3,4,4,1,3,3,0 1279 | 3,4,4,2,1,1,0 1280 | 3,4,4,2,1,2,0 1281 | 3,4,4,2,1,3,1 1282 | 3,4,4,2,2,1,0 1283 | 3,4,4,2,2,2,1 1284 | 3,4,4,2,2,3,0 1285 | 3,4,4,2,3,1,0 1286 | 3,4,4,2,3,2,1 1287 | 3,4,4,2,3,3,0 1288 | 3,4,4,3,1,1,0 1289 | 3,4,4,3,1,2,0 1290 | 3,4,4,3,1,3,1 1291 | 3,4,4,3,2,1,0 1292 | 3,4,4,3,2,2,1 1293 | 3,4,4,3,2,3,0 1294 | 3,4,4,3,3,1,0 1295 | 3,4,4,3,3,2,1 1296 | 3,4,4,3,3,3,0 1297 | 4,1,1,1,1,1,0 1298 | 4,1,1,1,1,2,0 1299 | 4,1,1,1,1,3,0 1300 | 4,1,1,1,2,1,0 1301 | 4,1,1,1,2,2,0 1302 | 4,1,1,1,2,3,0 1303 | 4,1,1,1,3,1,0 1304 | 4,1,1,1,3,2,0 1305 | 4,1,1,1,3,3,0 1306 | 4,1,1,2,1,1,0 1307 | 4,1,1,2,1,2,0 1308 | 4,1,1,2,1,3,0 1309 | 4,1,1,2,2,1,0 1310 | 4,1,1,2,2,2,0 1311 | 4,1,1,2,2,3,0 1312 | 4,1,1,2,3,1,0 1313 | 4,1,1,2,3,2,0 1314 | 4,1,1,2,3,3,0 1315 | 4,1,1,3,1,1,0 1316 | 4,1,1,3,1,2,0 1317 | 4,1,1,3,1,3,0 1318 | 4,1,1,3,2,1,0 1319 | 4,1,1,3,2,2,0 1320 | 4,1,1,3,2,3,0 1321 | 4,1,1,3,3,1,0 1322 | 4,1,1,3,3,2,0 1323 | 4,1,1,3,3,3,0 1324 | 4,1,2,1,1,1,0 1325 | 4,1,2,1,1,2,0 1326 | 4,1,2,1,1,3,0 1327 | 4,1,2,1,2,1,0 1328 | 4,1,2,1,2,2,0 1329 | 4,1,2,1,2,3,0 1330 | 4,1,2,1,3,1,0 1331 | 4,1,2,1,3,2,0 1332 | 4,1,2,1,3,3,0 1333 | 4,1,2,2,1,1,0 1334 | 4,1,2,2,1,2,0 1335 | 4,1,2,2,1,3,0 1336 | 4,1,2,2,2,1,0 1337 | 4,1,2,2,2,2,0 1338 | 4,1,2,2,2,3,0 1339 | 4,1,2,2,3,1,0 1340 | 4,1,2,2,3,2,0 1341 | 4,1,2,2,3,3,0 1342 | 4,1,2,3,1,1,0 1343 | 4,1,2,3,1,2,0 1344 | 4,1,2,3,1,3,0 1345 | 4,1,2,3,2,1,0 1346 | 4,1,2,3,2,2,0 1347 | 4,1,2,3,2,3,0 1348 | 4,1,2,3,3,1,0 1349 | 4,1,2,3,3,2,0 1350 | 4,1,2,3,3,3,0 1351 | 4,1,3,1,1,1,0 1352 | 4,1,3,1,1,2,0 1353 | 4,1,3,1,1,3,0 1354 | 4,1,3,1,2,1,0 1355 | 4,1,3,1,2,2,0 1356 | 4,1,3,1,2,3,0 1357 | 4,1,3,1,3,1,0 1358 | 4,1,3,1,3,2,0 1359 | 4,1,3,1,3,3,0 1360 | 4,1,3,2,1,1,0 1361 | 4,1,3,2,1,2,0 1362 | 4,1,3,2,1,3,0 1363 | 4,1,3,2,2,1,0 1364 | 4,1,3,2,2,2,0 1365 | 4,1,3,2,2,3,0 1366 | 4,1,3,2,3,1,0 1367 | 4,1,3,2,3,2,0 1368 | 4,1,3,2,3,3,0 1369 | 4,1,3,3,1,1,0 1370 | 4,1,3,3,1,2,0 1371 | 4,1,3,3,1,3,0 1372 | 4,1,3,3,2,1,0 1373 | 4,1,3,3,2,2,0 1374 | 4,1,3,3,2,3,0 1375 | 4,1,3,3,3,1,0 1376 | 4,1,3,3,3,2,0 1377 | 4,1,3,3,3,3,0 1378 | 4,1,4,1,1,1,0 1379 | 4,1,4,1,1,2,0 1380 | 4,1,4,1,1,3,0 1381 | 4,1,4,1,2,1,0 1382 | 4,1,4,1,2,2,0 1383 | 4,1,4,1,2,3,0 1384 | 4,1,4,1,3,1,0 1385 | 4,1,4,1,3,2,0 1386 | 4,1,4,1,3,3,0 1387 | 4,1,4,2,1,1,0 1388 | 4,1,4,2,1,2,0 1389 | 4,1,4,2,1,3,0 1390 | 4,1,4,2,2,1,0 1391 | 4,1,4,2,2,2,0 1392 | 4,1,4,2,2,3,0 1393 | 4,1,4,2,3,1,0 1394 | 4,1,4,2,3,2,0 1395 | 4,1,4,2,3,3,0 1396 | 4,1,4,3,1,1,0 1397 | 4,1,4,3,1,2,0 1398 | 4,1,4,3,1,3,0 1399 | 4,1,4,3,2,1,0 1400 | 4,1,4,3,2,2,0 1401 | 4,1,4,3,2,3,0 1402 | 4,1,4,3,3,1,0 1403 | 4,1,4,3,3,2,0 1404 | 4,1,4,3,3,3,0 1405 | 4,2,1,1,1,1,0 1406 | 4,2,1,1,1,2,0 1407 | 4,2,1,1,1,3,0 1408 | 4,2,1,1,2,1,0 1409 | 4,2,1,1,2,2,0 1410 | 4,2,1,1,2,3,0 1411 | 4,2,1,1,3,1,0 1412 | 4,2,1,1,3,2,0 1413 | 4,2,1,1,3,3,0 1414 | 4,2,1,2,1,1,0 1415 | 4,2,1,2,1,2,0 1416 | 4,2,1,2,1,3,0 1417 | 4,2,1,2,2,1,0 1418 | 4,2,1,2,2,2,0 1419 | 4,2,1,2,2,3,0 1420 | 4,2,1,2,3,1,0 1421 | 4,2,1,2,3,2,0 1422 | 4,2,1,2,3,3,0 1423 | 4,2,1,3,1,1,0 1424 | 4,2,1,3,1,2,0 1425 | 4,2,1,3,1,3,0 1426 | 4,2,1,3,2,1,0 1427 | 4,2,1,3,2,2,0 1428 | 4,2,1,3,2,3,0 1429 | 4,2,1,3,3,1,0 1430 | 4,2,1,3,3,2,0 1431 | 4,2,1,3,3,3,0 1432 | 4,2,2,1,1,1,0 1433 | 4,2,2,1,1,2,0 1434 | 4,2,2,1,1,3,0 1435 | 4,2,2,1,2,1,0 1436 | 4,2,2,1,2,2,0 1437 | 4,2,2,1,2,3,0 1438 | 4,2,2,1,3,1,0 1439 | 4,2,2,1,3,2,0 1440 | 4,2,2,1,3,3,0 1441 | 4,2,2,2,1,1,0 1442 | 4,2,2,2,1,2,0 1443 | 4,2,2,2,1,3,0 1444 | 4,2,2,2,2,1,0 1445 | 4,2,2,2,2,2,0 1446 | 4,2,2,2,2,3,0 1447 | 4,2,2,2,3,1,0 1448 | 4,2,2,2,3,2,0 1449 | 4,2,2,2,3,3,0 1450 | 4,2,2,3,1,1,0 1451 | 4,2,2,3,1,2,0 1452 | 4,2,2,3,1,3,0 1453 | 4,2,2,3,2,1,0 1454 | 4,2,2,3,2,2,0 1455 | 4,2,2,3,2,3,0 1456 | 4,2,2,3,3,1,0 1457 | 4,2,2,3,3,2,0 1458 | 4,2,2,3,3,3,0 1459 | 4,2,3,1,1,1,0 1460 | 4,2,3,1,1,2,0 1461 | 4,2,3,1,1,3,0 1462 | 4,2,3,1,2,1,0 1463 | 4,2,3,1,2,2,0 1464 | 4,2,3,1,2,3,0 1465 | 4,2,3,1,3,1,0 1466 | 4,2,3,1,3,2,0 1467 | 4,2,3,1,3,3,0 1468 | 4,2,3,2,1,1,0 1469 | 4,2,3,2,1,2,0 1470 | 4,2,3,2,1,3,0 1471 | 4,2,3,2,2,1,0 1472 | 4,2,3,2,2,2,0 1473 | 4,2,3,2,2,3,0 1474 | 4,2,3,2,3,1,0 1475 | 4,2,3,2,3,2,0 1476 | 4,2,3,2,3,3,0 1477 | 4,2,3,3,1,1,0 1478 | 4,2,3,3,1,2,0 1479 | 4,2,3,3,1,3,0 1480 | 4,2,3,3,2,1,0 1481 | 4,2,3,3,2,2,0 1482 | 4,2,3,3,2,3,0 1483 | 4,2,3,3,3,1,0 1484 | 4,2,3,3,3,2,0 1485 | 4,2,3,3,3,3,0 1486 | 4,2,4,1,1,1,0 1487 | 4,2,4,1,1,2,0 1488 | 4,2,4,1,1,3,0 1489 | 4,2,4,1,2,1,0 1490 | 4,2,4,1,2,2,0 1491 | 4,2,4,1,2,3,0 1492 | 4,2,4,1,3,1,0 1493 | 4,2,4,1,3,2,0 1494 | 4,2,4,1,3,3,0 1495 | 4,2,4,2,1,1,0 1496 | 4,2,4,2,1,2,0 1497 | 4,2,4,2,1,3,0 1498 | 4,2,4,2,2,1,0 1499 | 4,2,4,2,2,2,0 1500 | 4,2,4,2,2,3,0 1501 | 4,2,4,2,3,1,0 1502 | 4,2,4,2,3,2,0 1503 | 4,2,4,2,3,3,0 1504 | 4,2,4,3,1,1,0 1505 | 4,2,4,3,1,2,0 1506 | 4,2,4,3,1,3,0 1507 | 4,2,4,3,2,1,0 1508 | 4,2,4,3,2,2,0 1509 | 4,2,4,3,2,3,0 1510 | 4,2,4,3,3,1,0 1511 | 4,2,4,3,3,2,0 1512 | 4,2,4,3,3,3,0 1513 | 4,3,1,1,1,1,0 1514 | 4,3,1,1,1,2,0 1515 | 4,3,1,1,1,3,0 1516 | 4,3,1,1,2,1,0 1517 | 4,3,1,1,2,2,0 1518 | 4,3,1,1,2,3,0 1519 | 4,3,1,1,3,1,0 1520 | 4,3,1,1,3,2,0 1521 | 4,3,1,1,3,3,0 1522 | 4,3,1,2,1,1,0 1523 | 4,3,1,2,1,2,0 1524 | 4,3,1,2,1,3,1 1525 | 4,3,1,2,2,1,0 1526 | 4,3,1,2,2,2,0 1527 | 4,3,1,2,2,3,1 1528 | 4,3,1,2,3,1,0 1529 | 4,3,1,2,3,2,1 1530 | 4,3,1,2,3,3,0 1531 | 4,3,1,3,1,1,0 1532 | 4,3,1,3,1,2,0 1533 | 4,3,1,3,1,3,0 1534 | 4,3,1,3,2,1,0 1535 | 4,3,1,3,2,2,0 1536 | 4,3,1,3,2,3,1 1537 | 4,3,1,3,3,1,0 1538 | 4,3,1,3,3,2,1 1539 | 4,3,1,3,3,3,0 1540 | 4,3,2,1,1,1,0 1541 | 4,3,2,1,1,2,0 1542 | 4,3,2,1,1,3,0 1543 | 4,3,2,1,2,1,0 1544 | 4,3,2,1,2,2,0 1545 | 4,3,2,1,2,3,0 1546 | 4,3,2,1,3,1,0 1547 | 4,3,2,1,3,2,0 1548 | 4,3,2,1,3,3,0 1549 | 4,3,2,2,1,1,0 1550 | 4,3,2,2,1,2,0 1551 | 4,3,2,2,1,3,1 1552 | 4,3,2,2,2,1,0 1553 | 4,3,2,2,2,2,0 1554 | 4,3,2,2,2,3,1 1555 | 4,3,2,2,3,1,0 1556 | 4,3,2,2,3,2,1 1557 | 4,3,2,2,3,3,0 1558 | 4,3,2,3,1,1,0 1559 | 4,3,2,3,1,2,0 1560 | 4,3,2,3,1,3,1 1561 | 4,3,2,3,2,1,0 1562 | 4,3,2,3,2,2,1 1563 | 4,3,2,3,2,3,0 1564 | 4,3,2,3,3,1,0 1565 | 4,3,2,3,3,2,1 1566 | 4,3,2,3,3,3,0 1567 | 4,3,3,1,1,1,0 1568 | 4,3,3,1,1,2,0 1569 | 4,3,3,1,1,3,0 1570 | 4,3,3,1,2,1,0 1571 | 4,3,3,1,2,2,0 1572 | 4,3,3,1,2,3,0 1573 | 4,3,3,1,3,1,0 1574 | 4,3,3,1,3,2,0 1575 | 4,3,3,1,3,3,0 1576 | 4,3,3,2,1,1,0 1577 | 4,3,3,2,1,2,0 1578 | 4,3,3,2,1,3,1 1579 | 4,3,3,2,2,1,0 1580 | 4,3,3,2,2,2,1 1581 | 4,3,3,2,2,3,0 1582 | 4,3,3,2,3,1,0 1583 | 4,3,3,2,3,2,1 1584 | 4,3,3,2,3,3,0 1585 | 4,3,3,3,1,1,0 1586 | 4,3,3,3,1,2,0 1587 | 4,3,3,3,1,3,1 1588 | 4,3,3,3,2,1,0 1589 | 4,3,3,3,2,2,1 1590 | 4,3,3,3,2,3,0 1591 | 4,3,3,3,3,1,0 1592 | 4,3,3,3,3,2,1 1593 | 4,3,3,3,3,3,0 1594 | 4,3,4,1,1,1,0 1595 | 4,3,4,1,1,2,0 1596 | 4,3,4,1,1,3,0 1597 | 4,3,4,1,2,1,0 1598 | 4,3,4,1,2,2,0 1599 | 4,3,4,1,2,3,0 1600 | 4,3,4,1,3,1,0 1601 | 4,3,4,1,3,2,0 1602 | 4,3,4,1,3,3,0 1603 | 4,3,4,2,1,1,0 1604 | 4,3,4,2,1,2,0 1605 | 4,3,4,2,1,3,1 1606 | 4,3,4,2,2,1,0 1607 | 4,3,4,2,2,2,1 1608 | 4,3,4,2,2,3,0 1609 | 4,3,4,2,3,1,0 1610 | 4,3,4,2,3,2,1 1611 | 4,3,4,2,3,3,0 1612 | 4,3,4,3,1,1,0 1613 | 4,3,4,3,1,2,0 1614 | 4,3,4,3,1,3,1 1615 | 4,3,4,3,2,1,0 1616 | 4,3,4,3,2,2,1 1617 | 4,3,4,3,2,3,0 1618 | 4,3,4,3,3,1,0 1619 | 4,3,4,3,3,2,1 1620 | 4,3,4,3,3,3,0 1621 | 4,4,1,1,1,1,0 1622 | 4,4,1,1,1,2,0 1623 | 4,4,1,1,1,3,0 1624 | 4,4,1,1,2,1,0 1625 | 4,4,1,1,2,2,0 1626 | 4,4,1,1,2,3,0 1627 | 4,4,1,1,3,1,0 1628 | 4,4,1,1,3,2,0 1629 | 4,4,1,1,3,3,0 1630 | 4,4,1,2,1,1,0 1631 | 4,4,1,2,1,2,0 1632 | 4,4,1,2,1,3,1 1633 | 4,4,1,2,2,1,0 1634 | 4,4,1,2,2,2,0 1635 | 4,4,1,2,2,3,1 1636 | 4,4,1,2,3,1,0 1637 | 4,4,1,2,3,2,1 1638 | 4,4,1,2,3,3,0 1639 | 4,4,1,3,1,1,0 1640 | 4,4,1,3,1,2,0 1641 | 4,4,1,3,1,3,0 1642 | 4,4,1,3,2,1,0 1643 | 4,4,1,3,2,2,0 1644 | 4,4,1,3,2,3,1 1645 | 4,4,1,3,3,1,0 1646 | 4,4,1,3,3,2,1 1647 | 4,4,1,3,3,3,0 1648 | 4,4,2,1,1,1,0 1649 | 4,4,2,1,1,2,0 1650 | 4,4,2,1,1,3,0 1651 | 4,4,2,1,2,1,0 1652 | 4,4,2,1,2,2,0 1653 | 4,4,2,1,2,3,0 1654 | 4,4,2,1,3,1,0 1655 | 4,4,2,1,3,2,0 1656 | 4,4,2,1,3,3,0 1657 | 4,4,2,2,1,1,0 1658 | 4,4,2,2,1,2,0 1659 | 4,4,2,2,1,3,1 1660 | 4,4,2,2,2,1,0 1661 | 4,4,2,2,2,2,0 1662 | 4,4,2,2,2,3,1 1663 | 4,4,2,2,3,1,0 1664 | 4,4,2,2,3,2,1 1665 | 4,4,2,2,3,3,0 1666 | 4,4,2,3,1,1,0 1667 | 4,4,2,3,1,2,0 1668 | 4,4,2,3,1,3,1 1669 | 4,4,2,3,2,1,0 1670 | 4,4,2,3,2,2,1 1671 | 4,4,2,3,2,3,0 1672 | 4,4,2,3,3,1,0 1673 | 4,4,2,3,3,2,1 1674 | 4,4,2,3,3,3,0 1675 | 4,4,3,1,1,1,0 1676 | 4,4,3,1,1,2,0 1677 | 4,4,3,1,1,3,0 1678 | 4,4,3,1,2,1,0 1679 | 4,4,3,1,2,2,0 1680 | 4,4,3,1,2,3,0 1681 | 4,4,3,1,3,1,0 1682 | 4,4,3,1,3,2,0 1683 | 4,4,3,1,3,3,0 1684 | 4,4,3,2,1,1,0 1685 | 4,4,3,2,1,2,0 1686 | 4,4,3,2,1,3,1 1687 | 4,4,3,2,2,1,0 1688 | 4,4,3,2,2,2,1 1689 | 4,4,3,2,2,3,0 1690 | 4,4,3,2,3,1,0 1691 | 4,4,3,2,3,2,1 1692 | 4,4,3,2,3,3,0 1693 | 4,4,3,3,1,1,0 1694 | 4,4,3,3,1,2,0 1695 | 4,4,3,3,1,3,1 1696 | 4,4,3,3,2,1,0 1697 | 4,4,3,3,2,2,1 1698 | 4,4,3,3,2,3,0 1699 | 4,4,3,3,3,1,0 1700 | 4,4,3,3,3,2,1 1701 | 4,4,3,3,3,3,0 1702 | 4,4,4,1,1,1,0 1703 | 4,4,4,1,1,2,0 1704 | 4,4,4,1,1,3,0 1705 | 4,4,4,1,2,1,0 1706 | 4,4,4,1,2,2,0 1707 | 4,4,4,1,2,3,0 1708 | 4,4,4,1,3,1,0 1709 | 4,4,4,1,3,2,0 1710 | 4,4,4,1,3,3,0 1711 | 4,4,4,2,1,1,0 1712 | 4,4,4,2,1,2,0 1713 | 4,4,4,2,1,3,1 1714 | 4,4,4,2,2,1,0 1715 | 4,4,4,2,2,2,1 1716 | 4,4,4,2,2,3,0 1717 | 4,4,4,2,3,1,0 1718 | 4,4,4,2,3,2,1 1719 | 4,4,4,2,3,3,0 1720 | 4,4,4,3,1,1,0 1721 | 4,4,4,3,1,2,0 1722 | 4,4,4,3,1,3,1 1723 | 4,4,4,3,2,1,0 1724 | 4,4,4,3,2,2,1 1725 | 4,4,4,3,2,3,0 1726 | 4,4,4,3,3,1,0 1727 | 4,4,4,3,3,2,1 1728 | 4,4,4,3,3,3,0 1729 | -------------------------------------------------------------------------------- /SMOTEBoost/weka.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnandas/DataSamplingTools/c6501b4d5d4094e06f8bfb2daee42c02ee296a3c/SMOTEBoost/weka.jar --------------------------------------------------------------------------------