382471c62800d7c80673ef22552b6460124ccc2d,lightning/impl/primal_cd.py,CDClassifier,fit,#CDClassifier#,223
Before Change
elif self.penalty in ("l1", "l2", "nn"):
penalty = self._get_penalty()
for k in xrange(n_vectors):
n_pos = np.sum(Y[:, k] == 1)
n_neg = n_samples - n_pos
tol = self.tol * max(min(n_pos, n_neg), 1) / n_samples
vinit = self.violation_init_.get(k, 0) * self.C / self.C_init
viol = _primal_cd(self, self.coef_, self.errors_,
ds, y, Y, k, False,
indices, penalty, self._get_loss(),
self.selection, self.permute,
self.termination,
self.C, self.alpha, 1e12,
self.max_iter, max_steps,
self.shrinking, vinit,
rs, tol, self.callback, self.n_calls,
self.verbose)
if self.warm_start and not k in self.violation_init_:
self.violation_init_[k] = viol
if self.debiasing:
nz = self.coef_ != 0
if not self.warm_debiasing:
After Change
vinit = np.asarray([self.violation_init_.get(k, 0)
for k in xrange(n_vectors)]) * self.C / self.C_init
jobs = (delayed(_primal_cd)(self, self.coef_, self.errors_,
ds, y, Y, k, False,
indices, penalty, self._get_loss(),
self.selection, self.permute,
self.termination,
self.C, self.alpha, 1e12,
self.max_iter, max_steps,
self.shrinking, vinit[k],
rs, tol[k], self.callback, self.n_calls,
self.verbose)
for k in xrange(n_vectors))
viol = Parallel(n_jobs=self.n_jobs, verbose=self.verbose)(jobs)
for k in range(n_vectors):
if self.warm_start and not k in self.violation_init_:
self.violation_init_[k] = viol[k]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: scikit-learn-contrib/lightning
Commit Name: 382471c62800d7c80673ef22552b6460124ccc2d
Time: 2014-10-06
Author: manojkumarsivaraj334@gmail.com
File Name: lightning/impl/primal_cd.py
Class Name: CDClassifier
Method Name: fit
Project Name: alexandrebarachant/pyRiemann
Commit Name: b45f35862afbca09ff1c70be1cc4d1d6ca6c9617
Time: 2015-07-03
Author: alexandre.barachant@gmail.com
File Name: pyriemann/classification.py
Class Name: MDM
Method Name: _predict_distances
Project Name: scikit-learn-contrib/lightning
Commit Name: 36952ae77bf2f2842abaa0deb8545c4c57eaad74
Time: 2014-10-06
Author: manojkumarsivaraj334@gmail.com
File Name: lightning/impl/primal_cd.py
Class Name: CDRegressor
Method Name: fit