예제 #1
0
    def _fit_data_container(self, data_container: DataContainer, context: ExecutionContext) -> BaseStep:
        assert self.wrapped is not None

        step = StepClonerForEachDataInput(self.wrapped)
        step = step.handle_fit(data_container, context)

        return step
예제 #2
0
    def _fit_data_container(self, data_container: DataContainer, context: ExecutionContext) -> BaseStep:
        assert self.wrapped is not None

        if self.split_data_container_during_fit:
            train_data_container, validation_data_container = self.split_data_container(data_container)
        else:
            train_data_container = data_container

        step = StepClonerForEachDataInput(self.wrapped)
        step = step.handle_fit(train_data_container, context)

        if self.predict_after_fit:
            results = step.handle_predict(validation_data_container, context)
            self.calculate_score(results)

        return self
예제 #3
0
    def _fit_data_container(self, data_container: DataContainer,
                            context: ExecutionContext) -> BaseStep:
        assert self.wrapped is not None

        train_data_container, validation_data_container = self.split_data_container(
            data_container)

        step = StepClonerForEachDataInput(self.wrapped)
        step = step.handle_fit(train_data_container, context)

        results = step.handle_transform(validation_data_container, context)
        self.scores = [
            self.scoring_function(a, b)
            for a, b in zip(results.data_inputs, results.expected_outputs)
        ]
        self.scores_mean = np.mean(self.scores)
        self.scores_std = np.std(self.scores)

        return self
예제 #4
0
    def train(self, train_data_container: DataContainer,
              context: ExecutionContext):
        step = StepClonerForEachDataInput(self.wrapped)
        step = step.handle_fit(train_data_container, context)

        return step