def sets(self, x, y):
        lm = linear_model.LinearRegression(normalize=True)
        remaining = x.columns
        curr = []
        logging.debug("stepwise forward")
        for i in range(self.n):
            if i % 10 == 0:
                logging.debug("{i} features".format(i=i))
            coefs = []
            for col in remaining:
                cols = curr + [col]
                fcf = 1e12
                for train, test in cross_validation.KFold(n=len(y), k=4):
                    # computes fits over folds, uses lowest computed
                    # coefficient as value for comparison
                    lm.fit(x[cols].values[train], y.values[train])
                    cf = lm.coef_[-1]
                    if np.isnan(x[col].std()) or x[col].std() < 1e-7:
                        cf = 0
                    cf = abs(cf)
                    fcf = min(cf, fcf)
                coefs.append(fcf)
            coef, col = max(zip(coefs, remaining))
            logging.debug("adding column: {col}".format(col=col))
            curr.append(col)
            remaining = remaining.drop([col])
            yield list(curr)
dataset/ETHPy150Open kvh/ramp/ramp/selectors.py/StepwiseForwardSelector.sets/original