function model = slvcrf_initialize(X, Y, pars)

gamma = pars.gamma;
lambda = pars.lambda;
num_bases = pars.numBases;
Xp = X(:,Y==1);
pcaOpts.PCARatio = 0.95;
[eigvector, eigvalue, sampleMean] = PCA(Xp,pcaOpts);
Xp = eigvector'*(Xp-repmat(sampleMean,1,size(Xp,2)));
[A,C] = kmeans(Xp', num_bases);
D = C';
D = eigvector*D+repmat(sampleMean,1,num_bases);
D = D ./ repmat(sum(D.^2).^.5,size(D,1),1);
model.D = D;

S = L1QP_FeatureSign_Set(X, D, gamma, lambda);
svmmodel = train( Y, sparse(S), '-s 1', 'col' );
w1 = svmmodel.Label(1)*svmmodel.w';
w2 = 1;
w3 = 0;
model.s = [length(w1),1,1];
model.w = [w1;w2;w3];
