コード例 #1
0
def test_features_raw_data_no_target(data_classification_balanced, feature_descriptor):
    """Testing if raw_dataframe() drops Target column when drop_target=True."""
    X, y = data_classification_balanced
    f = Features(X, y, feature_descriptor)

    expected_df = X.drop(["Date"], axis=1)
    cols = expected_df.columns

    actual_df = f.raw_data(drop_target=True)[cols]

    assert actual_df.equals(expected_df)
コード例 #2
0
def test_features_raw_data_excluded_transformed(data_classification_balanced, feature_descriptor, transformed_columns):
    """Testing if raw_data returns correct dataframe without transformed columns when excluded_transformed
    is set to True."""
    X, y = data_classification_balanced
    f = Features(X, y, feature_descriptor, transformed_columns)

    expected_df = X.drop(["Date"], axis=1)
    if transformed_columns:
        expected_df = expected_df.drop(transformed_columns, axis=1)

    cols = expected_df.columns

    actual_df = f.raw_data(exclude_transformed=True)[cols]

    assert actual_df.equals(expected_df)