The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Error reading a classifier saved in default (xml compressed) or binary formats
Version: Rapid Miner 4.4 (Yes I know that its an old version)
Error:
com.rapidminer.operator.UserError: Could not read file '<omitted>/RapidMinerData/Test/cl
assifier.mod': Cannot read from XML stream, wrong format: : only whitespace content allowed before start tag and not
? (position: START_DOCUMENT seen ?... @1:1) .
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:97)
at com.rapidminer.operator.Operator.apply(Operator.java:666)
at com.rapidminer.operator.OperatorChain.apply(OperatorChain.java:416)
at com.rapidminer.operator.Operator.apply(Operator.java:666)
at com.rapidminer.Process.run(Process.java:695)
at com.rapidminer.Process.run(Process.java:665)
at com.rapidminer.Process.run(Process.java:655)
at machine_learning_service.RapidMinerTester.test(RapidMinerTester.java:139)
at machine_learning_service.Candidate.act(Candidate.java:352)
at machine_learning_service.RapidMinerService.main(RapidMinerService.java:307)
Caused by: java.io.StreamCorruptedException: invalid stream header: 3F080000
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:781)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:278)
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:76)
... 9 more
This happens when I change the process config xml
<?xml version="1.0" encoding="UTF-8"?>
<operator name="Root" class="Process" expanded="yes">
<parameter key="logverbosity" value="off"/>
<operator name="Input" class="ExampleSource">
<parameter key="attributes" value="<omitted>/RapidMinerData/Train/AttributeDescriptors/test.aml"/>
</operator>
<operator name="NaiveBayes" class="NaiveBayes">
</operator>
<operator name="ModelWriter" class="ModelWriter">
<parameter key="model_file" value="<omitted>/RapidMinerData/Train/classifier_return.mod"/>
<parameter key="output_type" value="XML"/>
</operator>
</operator>
and am reading in using
<?xml version="1.0" encoding="UTF-8"?>
<operator name = "Root" class="Process" expanded="yes">
<parameter key="logverbosity" value="off"/>
<operator name="Input" class="ExampleSource">
<parameter key="attributes" value="<omitted>/RapidMinerData/Test/AttributeDescriptors/test.aml"/>
</operator>
<operator name="ModelLoader" class="ModelLoader">
<parameter key="model_file" value="<omitted>/RapidMinerData/Test/classifier.mod"/>
</operator>
<operator name="Applier" class="ModelApplier">
<list key="application_parameters">
</list>
</operator>
<operator name="BinominalClassificationPerformance" class="BinominalClassificationPerformance">
<parameter key="false_negative" value="true"/>
<parameter key="false_positive" value="true"/>
<parameter key="sensitivity" value="true"/>
<parameter key="specificity" value="true"/>
<parameter key="true_negative" value="true"/>
<parameter key="true_positive" value="true"/>
</operator>
<operator name="ProcessLog" class="ProcessLog">
<parameter key="filename" value="<omitted>/RapidMinerData/Test/statistics.per"/>
<list key="log">
<parameter key="false_positive" value="operator.BinominalClassificationPerformance.value.false_positive"/>
<parameter key="false_negative" value="operator.BinominalClassificationPerformance.value.false_negative"/>
<parameter key="true_positive" value="operator.BinominalClassificationPerformance.value.true_positive"/>
<parameter key="true_negative" value="operator.BinominalClassificationPerformance.value.true_negative"/>
<!--<parameter key="AUC" value="operator.BinominalClassificationPerformance.value.AUC"/>-->
<parameter key="sensitivity" value="operator.BinominalClassificationPerformance.value.sensitivity"/>
<parameter key="specificity" value="operator.BinominalClassificationPerformance.value.specificity"/>
</list>
<parameter key="persistent" value="true"/>
</operator>
</operator>
Any help will be greatly appreciated
Error:
com.rapidminer.operator.UserError: Could not read file '<omitted>/RapidMinerData/Test/cl
assifier.mod': Cannot read from XML stream, wrong format: : only whitespace content allowed before start tag and not
? (position: START_DOCUMENT seen ?... @1:1) .
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:97)
at com.rapidminer.operator.Operator.apply(Operator.java:666)
at com.rapidminer.operator.OperatorChain.apply(OperatorChain.java:416)
at com.rapidminer.operator.Operator.apply(Operator.java:666)
at com.rapidminer.Process.run(Process.java:695)
at com.rapidminer.Process.run(Process.java:665)
at com.rapidminer.Process.run(Process.java:655)
at machine_learning_service.RapidMinerTester.test(RapidMinerTester.java:139)
at machine_learning_service.Candidate.act(Candidate.java:352)
at machine_learning_service.RapidMinerService.main(RapidMinerService.java:307)
Caused by: java.io.StreamCorruptedException: invalid stream header: 3F080000
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:781)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:278)
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:76)
... 9 more
This happens when I change the process config xml
<?xml version="1.0" encoding="UTF-8"?>
<operator name="Root" class="Process" expanded="yes">
<parameter key="logverbosity" value="off"/>
<operator name="Input" class="ExampleSource">
<parameter key="attributes" value="<omitted>/RapidMinerData/Train/AttributeDescriptors/test.aml"/>
</operator>
<operator name="NaiveBayes" class="NaiveBayes">
</operator>
<operator name="ModelWriter" class="ModelWriter">
<parameter key="model_file" value="<omitted>/RapidMinerData/Train/classifier_return.mod"/>
<parameter key="output_type" value="XML"/>
</operator>
</operator>
and am reading in using
<?xml version="1.0" encoding="UTF-8"?>
<operator name = "Root" class="Process" expanded="yes">
<parameter key="logverbosity" value="off"/>
<operator name="Input" class="ExampleSource">
<parameter key="attributes" value="<omitted>/RapidMinerData/Test/AttributeDescriptors/test.aml"/>
</operator>
<operator name="ModelLoader" class="ModelLoader">
<parameter key="model_file" value="<omitted>/RapidMinerData/Test/classifier.mod"/>
</operator>
<operator name="Applier" class="ModelApplier">
<list key="application_parameters">
</list>
</operator>
<operator name="BinominalClassificationPerformance" class="BinominalClassificationPerformance">
<parameter key="false_negative" value="true"/>
<parameter key="false_positive" value="true"/>
<parameter key="sensitivity" value="true"/>
<parameter key="specificity" value="true"/>
<parameter key="true_negative" value="true"/>
<parameter key="true_positive" value="true"/>
</operator>
<operator name="ProcessLog" class="ProcessLog">
<parameter key="filename" value="<omitted>/RapidMinerData/Test/statistics.per"/>
<list key="log">
<parameter key="false_positive" value="operator.BinominalClassificationPerformance.value.false_positive"/>
<parameter key="false_negative" value="operator.BinominalClassificationPerformance.value.false_negative"/>
<parameter key="true_positive" value="operator.BinominalClassificationPerformance.value.true_positive"/>
<parameter key="true_negative" value="operator.BinominalClassificationPerformance.value.true_negative"/>
<!--<parameter key="AUC" value="operator.BinominalClassificationPerformance.value.AUC"/>-->
<parameter key="sensitivity" value="operator.BinominalClassificationPerformance.value.sensitivity"/>
<parameter key="specificity" value="operator.BinominalClassificationPerformance.value.specificity"/>
</list>
<parameter key="persistent" value="true"/>
</operator>
</operator>
Any help will be greatly appreciated
Tagged:
0
Answers
is really your file system input path? This might be problematic due to the "<" ">" characters in the xml file. Please try a full qualified path insted.
Cheers,
Helge
Thank you,
Stephen
Another option might be that there has been a bug in the model writer those days. I'd highly recommend to upgrade to a more recent version. RapidMiner 5.3 is open source and freely available without any restrictions: http://sourceforge.net/projects/rapidminer/
Cheers,
Helge