cf3abcef7140efa9f195b11e63543e08b2c3580f,Orange/widgets/evaluate/owtestlearners.py,OWTestLearners,_update_results,#OWTestLearners#,352

Before Change



        if self.resampling == OWTestLearners.TestOnTest:
            if self.test_data is None:
                self.warning(2, "Missing separate test data input")
                return
            elif self.test_data.domain.class_var != class_var:
                self.error(2, ("Inconsistent class variable between test " +
                               "and train data sets"))
                return

        // items in need of an update
        items = [(key, slot) for key, slot in self.learners.items()
                 if slot.results is None]
        learners = [slot.learner for _, slot in items]
        if len(items) == 0:
            return

        if self.test_data is not None and \
                self.resampling != OWTestLearners.TestOnTest:
            self.warning(1, "Test data is present but unused. "
                            "Select "Test on test data" to use it.")

        rstate = 42
        def update_progress(finished):
            self.progressBarSet(100 * finished)
        common_args = dict(
            store_data=True,
            preprocessor=self.preprocessor,
            callback=update_progress,
            n_jobs=-1,
        )
        self.setStatusMessage("Running")

        with self.progressBar():
            try:
                folds = self.NFolds[self.n_folds]
                if self.resampling == OWTestLearners.KFold:
                    if len(self.data) < folds:
                        self.error(4, "Number of folds exceeds the data size")
                        return
                    warnings = []
                    results = Orange.evaluation.CrossValidation(
                        self.data, learners, k=folds,

After Change


        Run/evaluate the learners.
        
        self.Warning.test_data_unused.clear()
        self.Warning.test_data_missing.clear()
        self.Warning.general.clear()
        self.Error.class_inconsistent.clear()
        self.Error.too_many_folds.clear()
        self.Error.general.clear()
        if self.data is None:
            return

        class_var = self.data.domain.class_var

        if self.resampling == OWTestLearners.TestOnTest:
            if self.test_data is None:
                self.Warning.test_data_missing()
                return
            elif self.test_data.domain.class_var != class_var:
                self.Error.class_inconsistent()
                return

        // items in need of an update
        items = [(key, slot) for key, slot in self.learners.items()
                 if slot.results is None]
        learners = [slot.learner for _, slot in items]
        if len(items) == 0:
            return

        if self.test_data is not None and \
                self.resampling != OWTestLearners.TestOnTest:
            self.Warning.test_data_unused()

        rstate = 42
        def update_progress(finished):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: biolab/orange3
Commit Name: cf3abcef7140efa9f195b11e63543e08b2c3580f
Time: 2016-07-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/evaluate/owtestlearners.py
Class Name: OWTestLearners
Method Name: _update_results


Project Name: biolab/orange3
Commit Name: cf3abcef7140efa9f195b11e63543e08b2c3580f
Time: 2016-07-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/evaluate/owtestlearners.py
Class Name: OWTestLearners
Method Name: _update_results


Project Name: biolab/orange3
Commit Name: cf3abcef7140efa9f195b11e63543e08b2c3580f
Time: 2016-07-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/evaluate/owtestlearners.py
Class Name: OWTestLearners
Method Name: set_test_data


Project Name: biolab/orange3
Commit Name: cf3abcef7140efa9f195b11e63543e08b2c3580f
Time: 2016-07-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/evaluate/owtestlearners.py
Class Name: OWTestLearners
Method Name: set_train_data