Source code for autoflow.pipeline.components.regression.sgd

from sklearn.preprocessing import StandardScaler

from autoflow.pipeline.components.regression_base import AutoFlowRegressionAlgorithm


[docs]class SGD( AutoFlowRegressionAlgorithm, ): module__ = "sklearn.linear_model.stochastic_gradient" class__ = "SGDRegressor"
[docs] def before_fit_y(self, y): if y is None: return None self.scaler = StandardScaler(copy=True) return self.scaler.fit(y.reshape((-1, 1))).ravel()
[docs] def after_pred_y(self, y): return self.scaler.inverse_transform(y)