Ejemplo n.º 1
0
    def __init__(self, wrapped, max_plotted_predictions=None):
        if max_plotted_predictions is None:
            max_plotted_predictions = 10

        FeatureUnion.__init__(self, [Identity(), wrapped],
                              joiner=PlotPredictionsJoiner(
                                  plot_predictions, max_plotted_predictions),
                              n_jobs=1)
Ejemplo n.º 2
0
    def __init__(self, steps, hyperparams=None):
        FeatureUnion.__init__(self, steps)

        self._make_all_steps_optional()

        if hyperparams is None:
            self.set_hyperparams(HyperparameterSamples({
                CHOICE_HYPERPARAM: list(self.keys())[0]
            }))
Ejemplo n.º 3
0
    def __init__(self, steps, hyperparams=None):
        FeatureUnion.__init__(self, steps)

        if hyperparams is None:
            self.set_hyperparams(HyperparameterSamples({}))
        else:
            self.set_hyperparams(hyperparams)

        self._make_all_steps_optional()
Ejemplo n.º 4
0
    def __init__(self, steps, hyperparams=None):
        FeatureUnion.__init__(self, steps, joiner=SelectNonEmptyDataInputs())

        self._make_all_steps_optional()

        if hyperparams is None:
            choices = list(self.keys())[:-1]
            self.set_hyperparams({CHOICE_HYPERPARAM: choices[0]})
            self.set_hyperparams_space({CHOICE_HYPERPARAM: Choice(choices)})
Ejemplo n.º 5
0
    def __init__(self, column_chooser_steps_as_tuple: ColumnChooserTupleList, n_dimension: int = 3):
        # Make unique names from the indices in case we have many steps for transforming the same column(s).
        self.string_indices = [
            str(name) + "_" + str(step.__class__.__name__)
            for name, step in column_chooser_steps_as_tuple
        ]

        FeatureUnion.__init__(self, [
            (string_indices, Pipeline([
                ColumnsSelectorND(indices, n_dimension=n_dimension),
                step
            ]))
            for string_indices, (indices, step) in zip(self.string_indices, column_chooser_steps_as_tuple)
        ])
Ejemplo n.º 6
0
    def __init__(self, steps, hyperparams=None):
        FeatureUnion.__init__(self, steps, joiner=SelectNonEmptyDataInputs())

        self._make_all_steps_optional()

        choices = list(self.keys())[:-1]

        if hyperparams is None:
            self.update_hyperparams(
                {ChooseOneStepOf.CHOICE_HYPERPARAM: choices[0]})
        else:
            self.update_hyperparams(
                {ChooseOneStepOf.CHOICE_HYPERPARAM: hyperparams})
        self.update_hyperparams_space(
            {ChooseOneStepOf.CHOICE_HYPERPARAM: Choice(choices)})
Ejemplo n.º 7
0
 def __init__(self, steps, joiner: NonFittableMixin = None):
     if joiner is None:
         joiner = NumpyConcatenateOnCustomAxisIfNotEmpty(axis=-1)
     FeatureUnion.__init__(self, steps_as_tuple=steps, joiner=joiner)
     self.set_hyperparams(HyperparameterSamples({}))
     self._make_all_steps_optional()
Ejemplo n.º 8
0
 def __init__(self, steps):
     FeatureUnion.__init__(self, steps_as_tuple=steps, joiner=NumpyConcatenateOnCustomAxisIfNotEmpty(axis=-1))
     self.set_hyperparams(HyperparameterSamples({}))
     self._make_all_steps_optional()
Ejemplo n.º 9
0
 def __init__(self, steps):
     FeatureUnion.__init__(self, steps)
     self.set_hyperparams(HyperparameterSamples({}))
     self._make_all_steps_optional()