Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got an exception while loading pmml with jpmml-evaluator #112

Closed
BurrowsWang opened this issue Apr 28, 2021 · 2 comments
Closed

Got an exception while loading pmml with jpmml-evaluator #112

BurrowsWang opened this issue Apr 28, 2021 · 2 comments

Comments

@BurrowsWang
Copy link

Environment:

java=1.8.0
spark=2.4.7
jpmml-sparkml=1.5.12
jpmml-evaluator=1.4.x, 1.5.x

Here is the PMML file I generated with jpmml-sparkml-1.5.12:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PMML xmlns="http://www.dmg.org/PMML-4_4" xmlns:data="http://jpmml.org/jpmml-model/InlineTable" version="4.4">
    <Header>
        <Application name="JPMML-SparkML" version="1.5.12"/>
        <Timestamp>2021-04-27T12:37:19Z</Timestamp>
    </Header>
    <DataDictionary>
        <DataField name="x0" optype="continuous" dataType="double"/>
    </DataDictionary>
    <TransformationDictionary>
        <DerivedField name="bin_x0" optype="categorical" dataType="integer">
            <Discretize field="x0" dataType="integer">
                <DiscretizeBin binValue="0">
                    <Interval closure="closedOpen" rightMargin="-0.616452"/>
                </DiscretizeBin>
                <DiscretizeBin binValue="1">
                    <Interval closure="closedOpen" leftMargin="-0.616452" rightMargin="0.253137"/>
                </DiscretizeBin>
                <DiscretizeBin binValue="2">
                    <Interval closure="closedClosed" leftMargin="0.253137"/>
                </DiscretizeBin>
            </Discretize>
        </DerivedField>
    </TransformationDictionary>
</PMML>

yet when I load this PMML file with jpmml-evaluator, the following Exception raised:

org.jpmml.evaluator.MissingElementException: Required element PMML/<Model>@isScorable=true is not defined
@vruusmann
Copy link
Member

Required element PMML/@isScorable=true is not defined

The exception message says it all - you're trying to create a model evaluator using a PMML document that does not contain a model element.

Please re-run your Apache Spark experiment so that the pipeline would contain a model-type estimator.

@killua-zyk
Copy link

Yes, it seems the problem of incompatible scala version, when I changed the scala verison from 2.1 to 2.3, it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants