Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Error reading a classifier saved in default (xml compressed) or binary formats

szabelszabel Member Posts: 3 Contributor I
edited August 2019 in Help
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

Answers

  • homburghomburg Employee, Member Posts: 114 RM Data Scientist
    Hello szabel,

    is
     '<omitted>/RapidMinerData/Test/classifier.mod'
    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
  • szabelszabel Member Posts: 3 Contributor I
    No,  <omitted> is not actually there. I had to obfuscate some of the example... There is an actual valid path there and valid permissions; the only change is that I am taking the default (Zipped XML) and not specifying plain vanilla XML.

    Thank you,
    Stephen
  • homburghomburg Employee, Member Posts: 114 RM Data Scientist
    Looks like your model file is broken. Have you tried to recreate it?
    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
  • szabelszabel Member Posts: 3 Contributor I
    Yeah, I can try that... I was hoping that since it works when specifying XML that I was just missing a parameter that I was not seeing in the documentation.
Sign In or Register to comment.