def greedy_feature_selection(model, features, j):
    selected_features = set()
    score_hist = []
    ycv = exp(y_cv) - 1
    while len(selected_features) < len(features):
        scores = []
        for i in range(len(features)):
            if i not in selected_features:
                feats = list(selected_features) + [i]
                if len(feats) == 1:
                    ttfs = features[i]
                else:
                    ttfs = data_transforms.drop_disjoint(sparse.hstack((
                            features[feats])).tocsr(), targets)
                X_train_pre = ttfs[:n_train]
                X_train = X_train_pre[:int(n_train*0.8)]
                X_cv = X_train_pre[int(n_train*0.8):]
                model.fit(X_train[-keep:], y_train[-keep:])
                cv = exp(ridge.predict(X_cv)) - 1
                scores.append((rmsle(postprocess_pred(cv)[:,j], ycv[:,j]), feats, i))
                print scores[-1]
        selected_features.add(min(scores)[2])
        score_hist.append(min(scores))
    return score_hist
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/utils.py/greedy_feature_selection/original