Example #1
0
def run_error_analyzer_on_models(X_train,
                                 y_train,
                                 X_test,
                                 y_test,
                                 feature_names,
                                 model_task,
                                 filters=None,
                                 composite_filters=None,
                                 matrix_features=None,
                                 quantile_binning=False,
                                 num_bins=BIN_THRESHOLD,
                                 metric=None):
    if model_task == ModelTask.CLASSIFICATION:
        models = create_models_classification(X_train, y_train)
    else:
        models = create_models_regression(X_train, y_train)

    for model in models:
        categorical_features = []
        run_error_analyzer(model,
                           X_test,
                           y_test,
                           feature_names,
                           categorical_features,
                           model_task=model_task,
                           filters=filters,
                           composite_filters=composite_filters,
                           matrix_features=matrix_features,
                           quantile_binning=quantile_binning,
                           num_bins=num_bins,
                           metric=metric)
Example #2
0
def run_error_analyzer_on_models(X_train,
                                 y_train,
                                 X_test,
                                 y_test,
                                 feature_names,
                                 model_task,
                                 filters=None,
                                 composite_filters=None,
                                 matrix_features=None):
    if model_task == ModelTask.CLASSIFICATION:
        models = create_models_classification(X_train, y_train)
    else:
        models = create_models_regression(X_train, y_train)

    for model in models:
        categorical_features = []
        run_error_analyzer(model,
                           X_test,
                           y_test,
                           feature_names,
                           categorical_features,
                           model_task=model_task,
                           filters=filters,
                           composite_filters=composite_filters,
                           matrix_features=matrix_features)
Example #3
0
    def test_error_report_housing(self):
        X_train, X_test, y_train, y_test, feature_names = \
            create_housing_data()
        models = create_models_regression(X_train, y_train)

        for model in models:
            categorical_features = []
            run_error_analyzer(model, X_test, y_test, feature_names,
                               categorical_features)
    def test_importances_boston(self):
        X_train, X_test, y_train, y_test, feature_names = \
            create_boston_data()
        models = create_models_regression(X_train, y_train)

        for model in models:
            categorical_features = []
            run_error_analyzer(model, X_test, y_test, feature_names,
                               categorical_features)
    def test_modelanalysis_boston(self, manager_type):
        x_train, x_test, y_train, y_test, feature_names = \
            create_boston_data()
        x_train = pd.DataFrame(x_train, columns=feature_names)
        x_test = pd.DataFrame(x_test, columns=feature_names)
        models = create_models_regression(x_train, y_train)
        x_train[LABELS] = y_train
        x_test[LABELS] = y_test
        manager_args = {DESIRED_RANGE: [10, 20]}

        for model in models:
            run_model_analysis(model, x_train, x_test, LABELS, ['RM'],
                               manager_type, manager_args)
Example #6
0
    def test_error_report_housing_pandas(self, filter_features):
        X_train, X_test, y_train, y_test, feature_names = \
            create_housing_data()
        X_train = create_dataframe(X_train, feature_names)
        X_test = create_dataframe(X_test, feature_names)
        models = create_models_regression(X_train, y_train)

        for model in models:
            categorical_features = []
            run_error_analyzer(model,
                               X_test,
                               y_test,
                               feature_names,
                               categorical_features,
                               filter_features=filter_features)