Пример #1
0
    def predict(self, inputs, normalized=True):
        polynomial_inputs = polynomial_features(inputs, degree=self.degree)

        if normalized:
            polynomial_inputs = normalize(polynomial_inputs)

        return super(PolynomialRegression, self).predict(polynomial_inputs)
Пример #2
0
 def fit(self, inputs, targets, verbose=False, normalized=True):
     polynomial_inputs = PolynomialFeatures(
         degree=self.degree).fit_transform(inputs)
     if normalized:
         polynomial_inputs = normalize(polynomial_inputs)
     fit_stats = super(ElasticNetRegression,
                       self).fit(polynomial_inputs, targets, verbose)
     return fit_stats
Пример #3
0
    def predict(self, inputs, normalized=True):
        polynomial_inputs = PolynomialFeatures(
            degree=self.degree).fit_transform(inputs)

        if normalized:
            polynomial_inputs = normalize(polynomial_inputs)

        return super(ElasticNetRegression, self).predict(polynomial_inputs)
Пример #4
0
    def fit(self, inputs, targets, verbose=False, normalized=True):
        polynomial_inputs = polynomial_features(inputs, degree=self.degree)

        if normalized:
            polynomial_inputs = normalize(polynomial_inputs)

        fit_stats = super(PolynomialRegression,
                          self).fit(polynomial_inputs, targets, verbose)

        return fit_stats