function [pred, prob] = classf_lr_fw_te(model,Xtest)
% use the MODEL returned by classf_lr_fw_tr to classify XTEST
%	PRED : predicted labels
%	PROB : the confidence of PRED returned by libsvm

% Please refer to Ke Yan et al., Improving the transfer ability of 
% prediction models for electronic noses, Sensors and Actuators	B: Chemical, 2015
%	Copyright 2015 YAN Ke, Tsinghua Univ. http://yanke23.tk, xjed09@gmail.com

Xtest = [ones(size(Xtest,1),1),Xtest];
prob = sigmoid(Xtest*model.thetas);
if size(model.thetas,2) == 1
	pred = prob >= .5;
	pred = 2-pred;
	prob = [prob,1-prob];
else
	[maxProb,pred] = max(prob,[],2);
end

end