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



        elif self.penalty in ("l1", "l2", "nn"):
            penalty = self._get_penalty()
            n_pos = np.asarray([np.sum(Y[:, k] == 1) for k in xrange(n_vectors)])
            n_neg = n_samples - n_pos
            tol = self.tol * np.maximum(np.minimum(n_pos, n_neg), 1) / n_samples
            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]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: 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


Project Name: scikit-optimize/scikit-optimize
Commit Name: 4af750bec058da0cf5d4a3245a443549b9d7fd33
Time: 2016-04-05
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/dummy_opt.py
Class Name:
Method Name: dummy_minimize