use of structures._SparseFeature in project IR_Base by Linda-sunshine.
the class MTCLinAdaptWithHDP method logit.
// Logit function is different from the father class.
@Override
protected double logit(_SparseFeature[] fvs, _Review r) {
int k, n;
double[] Au = r.getHDPThetaStar().getModel();
// Bias term: w_s0*a0+b0.
double sum = Au[0] * getSupWeights(0) + Au[m_dim];
for (_SparseFeature fv : fvs) {
n = fv.getIndex() + 1;
k = m_featureGroupMap[n];
sum += (Au[k] * getSupWeights(n) + Au[m_dim + k]) * fv.getValue();
}
return Utils.logistic(sum);
}
Aggregations