switching model is not working
Hi,
I am new to Rapidminer. Recently, I am doing a project that needs to switch from naivebayes to svm to get the probability scores. The naivebayes mod and aml are the local files (...src/main/resources) after downloading the whole project from github. The naivebayes model seems working (probability score is generated) but with following info:
G Oct 18, 2016 4:06:50 PM: Trying rapidminer.rcfile. Property not specified...skipped
G Oct 18, 2016 4:06:50 PM: Loading operators from 'operators.xml'.
G Oct 18, 2016 4:06:50 PM: [Error] Cannot register 'ExcelExampleSetWriter': java.lang.NoClassDefFoundError: jxl/format/CellFormat
G Oct 18, 2016 4:06:50 PM: [Error] Cannot register 'NeuralNet': java.lang.NoClassDefFoundError: org/joone/engine/NeuralNetListener
G Oct 18, 2016 4:06:51 PM: Loading JDBC driver information from 'resources:jdbc_properties.xml'.
G Oct 18, 2016 4:06:51 PM: [Error] Cannot initialize XML serialization. Probably the libraries 'xstream.jar' and 'xpp.jar' were not provided. XML serialization will not work!
G Oct 18, 2016 4:06:51 PM: [Warning] Cannot register renderer: java.lang.NoClassDefFoundError: org/joone/engine/OutputPatternListener
Prediction:0.0 0.20877754407872653 0.7912224559212735
Then I downloaded the svm mod and aml files from their ftp(svm and nb models are developed by same team). Here is what I did:
1. I put svm the mod and aml files to the same folder as the nb - ...src/main/resources;
2. In Java code, I modified the codes both on mod and aml part by commenting out the nb part:
// modelLoader.setParameter(ModelLoader.PARAMETER_MODEL_FILE, "src/main/resources/metadata1K_nb_train1.mod");
modelLoader.setParameter(ModelLoader.PARAMETER_MODEL_FILE, "src/main/resources/metaent_svm_train.mod");
//org.jdom.Document doc = builder.build(new FileInputStream("src/main/resources/metadata1K_train.aml"));
org.jdom.Document doc = builder.build(new FileInputStream("src/main/resources/metaent_train.aml"));
Then ran the program, here is what I got:
G Oct 18, 2016 3:48:42 PM: Loading operators from 'operators.xml'.
G Oct 18, 2016 3:48:42 PM: [Error] Cannot register 'ExcelExampleSetWriter': java.lang.NoClassDefFoundError: jxl/format/CellFormat
G Oct 18, 2016 3:48:42 PM: [Error] Cannot register 'NeuralNet': java.lang.NoClassDefFoundError: org/joone/engine/NeuralNetListener
G Oct 18, 2016 3:48:43 PM: Loading JDBC driver information from 'resources:jdbc_properties.xml'.
G Oct 18, 2016 3:48:43 PM: [Error] Cannot initialize XML serialization. Probably the libraries 'xstream.jar' and 'xpp.jar' were not provided. XML serialization will not work!
G Oct 18, 2016 3:48:43 PM: [Warning] Cannot register renderer: java.lang.NoClassDefFoundError: org/joone/engine/OutputPatternListener
G Oct 18, 2016 3:48:43 PM: [Error] Cannot read object from XML serialization. Probably the libraries 'xstream.jar' and 'xpp.jar' were not provided...
com.rapidminer.operator.UserError: Could not read file 'src\main\resources\metaent_svm_train.mod': Cannot read object from XML serialization..
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:97)
at com.rapidminer.operator.Operator.apply(Operator.java:664)
at edu.mayo.ScientificRigor_JB.Test_JB.process(Test_JB.java:85)
Does anyone know what is going on? Did I miss something?
Thanks a lot!
Answers
just want to add more information to the error log:
G Oct 19, 2016 10:25:20 AM: [Error] Cannot read object from XML serialization. Probably the libraries 'xstream.jar' and 'xpp.jar' were not provided...
com.rapidminer.operator.UserError: Could not read file 'src\main\resources\bowmeta_nb_train.mod': Cannot read object from XML serialization..
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:97)
at com.rapidminer.operator.Operator.apply(Operator.java:664)
at edu.mayo.ScientificRigor_JB.Test_JB.process(Test_JB.java:85)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.runML(UpdateMetadataCitation_JB.java:83)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.start(UpdateMetadataCitation_JB.java:99)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.main(UpdateMetadataCitation_JB.java:125)
Caused by: java.io.StreamCorruptedException: invalid stream header: 1F8B0800
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:808)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
at com.rapidminer.operator.io.ModelLoader.apply(ModelLoader.java:76)
... 5 more
java.lang.NullPointerException
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.updateMetadata(UpdateMetadataCitation_JB.java:48)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.runML(UpdateMetadataCitation_JB.java:86)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.start(UpdateMetadataCitation_JB.java:99)
at edu.mayo.ScientificRigor_JB.UpdateMetadataCitation_JB.main(UpdateMetadataCitation_JB.java:125)
Asked a software engineer to take a look, it looks that there is a corruption in the svm mod file. The model was developed by 7 years ago. Is there any other way to read this old version model besides the one I used?
Thanks a lot!