%This is an examplar file on how the iMLCU program could be used (The main function is "iMLCU.m")
%
%Type 'help iMLCU' under Matlab prompt for more detailed information
%
%N.B.: Please ensure that libsvm package [1] (as attached) is put under the matlab path before envoking the iMLCU function.
%
%[1] C.-C. Chang and C.-J. Lin. LIBSVM: a library for support vector machines, Technical Report, 
%2001. [http://www.csie.ntu.edu.tw/~cjlin/libsvm]

clc,clear;
% Set the parameters used by iMLCU
C1 = 20; C2 = 0.01;

% Loading the file containing the necessary inputs for calling the iMLCU function
file_name = 'sample_data.mat';
load (file_name);

% test set(i.e. 'test_data' and 'test_target') is selected from unlabel set(i.e. 'unlabel_train_data' and 'unlabel_train_target'). Vector 'test_index' records the test data index
% delete test_data from unlabel_train_data(inductive setting)
unlabel_train_data(test_index == 1,:) = [];
clear test_index unlabel_train_target;

% call the main function iMLCU
[ RankingLoss,OneError,Coverage,Average_Precision,Macro_AUC,trained_w,trained_b ] = iMLCU( label_train_data,label_train_target,unlabel_train_data,test_data,test_target,C1,C2 );
