(self, learner, id)
Set the input learner for channel id.
Set the input learner for channel id.
Set the input learner for channel id .
def set_learner(self, learner, id):
        """Set the input learner for channel id."""
        if id in self.learners:
            if learner is None:
                # remove a learner and corresponding results
                del self.learners[id]
                del self.results[id]
                del self.curves[id]
            else:
                # update/replace a learner on a previously connected link
                self.learners[id] = learner
                # invalidate the cross-validation results and curve scores
                # (will be computed/updated in `_update`)
                self.results[id] = None
                self.curves[id] = None
        else:
            if learner is not None:
                self.learners[id] = learner
                # initialize the cross-validation results and curve scores
                # (will be computed/updated in `_update`)
                self.results[id] = None
                self.curves[id] = None

        if len(self.learners):
            self.infob.setText("%d learners on input." % len(self.learners))
        else:
            self.infob.setText("No learners.")

        self.commitBtn.setEnabled(len(self.learners))
def set_learner ( self , learner , id ) : if id in self . learners : if learner is None : # remove a learner and corresponding results del self . learners [ id ] del self . results [ id ] del self . curves [ id ] else : # update/replace a learner on a previously connected link self . learners [ id ] = learner # invalidate the cross-validation results and curve scores # (will be computed/updated in `_update`) self . results [ id ] = None self . curves [ id ] = None else : if learner is not None : self . learners [ id ] = learner # initialize the cross-validation results and curve scores # (will be computed/updated in `_update`) self . results [ id ] = None self . curves [ id ] = None if len ( self . learners ) : self . infob . setText ( "%d learners on input." % len ( self . learners ) ) else : self . infob . setText ( "No learners." ) self . commitBtn . setEnabled ( len ( self . learners ) )