# Path: columns_contain.py
# def columns_contain(s, df):
#     'print columns names in df that contain string s'
#     'for interactive debugging'
#     result = [column_name for column_name in df.columns if s.lower() in column_name.lower()]
#     print result
#     return result


import pdb
import AVM
import layout_transactions
import sweep_types
from columns_contain import columns_contain
                            )
                            pdb.set_trace()
                            result[result_key] = fit_and_run(avm)
                            if just_test:
                                return result
        pdb.set_trace()
        return result

    def search_rf(n_months_back, test_period, grid):
        'search over RandomForestRegressor HPs, appending to result'
        result = {}
        for n_estimators in grid.n_estimators_seq:
            for max_features in grid.max_features_seq:
                for max_depth in grid.max_depth_seq:
                    vprint(
                        '%6d %3s %1d %4d %4s %3d' %
                        (test_period, 'rfr', n_months_back,
                         n_estimators, max_features_s(max_features), max_depth)
                    )
                    avm = AVM.AVM(
                        model_name='RandomForestRegressor',
                        forecast_time_period=test_period,
                        random_state=random_state,
                        n_months_back=n_months_back,
                        n_estimators=n_estimators,  # number of boosting stages
                        max_depth=max_depth,  # max depth of any tree
                        max_features=max_features,  # how many features to test when splitting
                    )
                    result_key = sweep_types.ResultKeyRfr(
                        n_months_back,

# Path: columns_contain.py
# def columns_contain(s, df):
#     'print columns names in df that contain string s'
#     'for interactive debugging'
#     result = [column_name for column_name in df.columns if s.lower() in column_name.lower()]
#     print result
#     return result


# Path: sweep_avm_hps.py
import pdb
import AVM
import layout_transactions
import sweep_types
from columns_contain import columns_contain

                            )
                            pdb.set_trace()
                            result[result_key] = fit_and_run(avm)
                            if just_test:
                                return result
        pdb.set_trace()
        return result

    def search_rf(n_months_back, test_period, grid):
        'search over RandomForestRegressor HPs, appending to result'
        result = {}
        for n_estimators in grid.n_estimators_seq:
            for max_features in grid.max_features_seq:
                for max_depth in grid.max_depth_seq:
                    vprint(
                        '%6d %3s %1d %4d %4s %3d' %
                        (test_period, 'rfr', n_months_back,
                         n_estimators, max_features_s(max_features), max_depth)
                    )
                    avm = AVM.AVM(
                        model_name='RandomForestRegressor',
                        forecast_time_period=test_period,
                        random_state=random_state,
                        n_months_back=n_months_back,
                        n_estimators=n_estimators,  # number of boosting stages
                        max_depth=max_depth,  # max depth of any tree
                        max_features=max_features,  # how many features to test when splitting
                    )
                    result_key = sweep_types.ResultKeyRfr(
                        n_months_back,

                        n_estimators,