Beispiel #1
0
def test_transformation_dictionary(input_fields, derived_fields, output_fields,
                                   expected_data_dictionary,
                                   expected_transformation_dictionary):
    converter = EstimatorConverter(DecisionTreeClassifier(),
                                   context=TransformationContext(
                                       input=input_fields,
                                       derived=derived_fields,
                                       model=input_fields + derived_fields,
                                       output=output_fields),
                                   mode=EstimatorConverter.MODE_CLASSIFICATION)

    assert converter.data_dictionary().toxml(
    ) == expected_data_dictionary, 'Error in data dictionary generation'
    assert converter.transformation_dictionary().toxml() == expected_transformation_dictionary,\
        'Error in transformation dictionary generation'
Beispiel #2
0
def test_transformation_dictionary(input_fields, derived_fields, output_fields, expected_data_dictionary, expected_transformation_dictionary):
    converter = EstimatorConverter(
        DecisionTreeClassifier(),
        context=TransformationContext({
            Schema.INPUT: input_fields,
            Schema.DERIVED: derived_fields,
            Schema.MODEL: input_fields + derived_fields,
            Schema.OUTPUT: output_fields
        }),
        mode=ModelMode.CLASSIFICATION
    )

    assert converter.data_dictionary().toxml() == expected_data_dictionary, 'Error in data dictionary generation'
    assert converter.transformation_dictionary().toxml() == expected_transformation_dictionary,\
        'Error in transformation dictionary generation'
def test_transformation_dictionary(
    input_fields, derived_fields, output_fields, expected_data_dictionary, expected_transformation_dictionary
):
    converter = EstimatorConverter(
        DecisionTreeClassifier(),
        context=TransformationContext(
            input=input_fields, derived=derived_fields, model=input_fields + derived_fields, output=output_fields
        ),
        mode=EstimatorConverter.MODE_CLASSIFICATION,
    )

    assert converter.data_dictionary().toxml() == expected_data_dictionary, "Error in data dictionary generation"
    assert (
        converter.transformation_dictionary().toxml() == expected_transformation_dictionary
    ), "Error in transformation dictionary generation"