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
How to use a trained classification model of RapidMIner in my Java application?
Hi all,
I would like to know some opinions or hints how to solve an implementation problem. I want to use a text classification model to classify the test data in my java application, so that I would just give the path for test file and the application would give the classified test data as an output. Any idea?
Thanks!
I would like to know some opinions or hints how to solve an implementation problem. I want to use a text classification model to classify the test data in my java application, so that I would just give the path for test file and the application would give the classified test data as an output. Any idea?
Thanks!
Tagged:
0
Answers
you can build the process in RapidMiner so that it classifies your data as you want, and then use said process via java as described here.
You can alter the parameter pointing to the file easily before each process execution, see question 6) in the link I provided above.
Regards,
Marco
thanks for the reply!
I've downloaded the RapidMIner_Unuk through SVN, but I have 28 errors. Compiler Compliance Level is 1.6. Is this the reason?
The part of errors are the following:
Description Resource Path Location Type
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 150 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 154 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 159 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 212 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 215 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 242 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 243 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 246 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 249 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 135 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 136 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 141 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 146 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 196 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 232 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 341 Java Problem
tableList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 342 Java Problem
The method getParentLogger() is undefined for the type Driver DriverAdapter.java /RapidMiner_Unuk/src/com/rapidminer/tools/jdbc line 111 Java Problem
The method getParentLogger() of type DriverAdapter must override or implement a supertype method DriverAdapter.java /RapidMiner_Unuk/src/com/rapidminer/tools/jdbc line 110 Java Problem
The method setShape(Shape) is undefined for the type BubbleWindow BubbleWindow.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/components line 380 Java Problem
The method setShape(Shape) is undefined for the type new ComponentAdapter(){} BubbleWindow.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/components line 229 Java Problem
The type DefaultListModel is not generic; it cannot be parameterized with arguments <ColumnIdentifier> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 76 Java Problem
The type DefaultListModel is not generic; it cannot be parameterized with arguments <TableName> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 73 Java Problem
The type JList is not generic; it cannot be parameterized with arguments <ColumnIdentifier> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 76 Java Problem
The type JList is not generic; it cannot be parameterized with arguments <ColumnIdentifier> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 76 Java Problem
The type JList is not generic; it cannot be parameterized with arguments <TableName> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 73 Java Problem
The type JList is not generic; it cannot be parameterized with arguments <TableName> SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 73 Java Problem
attributeList cannot be resolved SQLQueryBuilder.java /RapidMiner_Unuk/src/com/rapidminer/gui/tools/dialogs line 248 Java Problem
ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized Tested.java /Group/src line 23 Java Problem
HashSet is a raw type. References to generic type HashSet<E> should be parameterized Tested.java /Group/src line 79 Java Problem
Null comparison always yields false: The variable colorValues cannot be null at this location StackedBarChartPlotter.java /RapidMiner_Unuk/src/com/rapidminer/gui/plotter/charts line 510 Java Problem
Null comparison always yields false: The variable currentStateXML cannot be null at this location MainFrame.java /RapidMiner_Unuk/src/com/rapidminer/gui line 1229 Java Problem
Null comparison always yields false: The variable dataTable cannot be null at this location ColorSchemeDialog.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/gui line 1082 Java Problem
Null comparison always yields false: The variable inputStream cannot be null at this location RemoteRepository.java /RapidMiner_Unuk/src/com/rapidminer/repository/remote line 463 Java Problem
Null comparison always yields false: The variable titleText cannot be null at this location GlobalConfigurationPanel.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/gui line 130 Java Problem
Potential null pointer access: The variable allWeights may be null at this location MedianAggregator.java /RapidMiner_Unuk/src/com/rapidminer/operator/preprocessing/transformation/aggregation line 150 Java Problem
Potential null pointer access: The variable allWeights may be null at this location MedianAggregator.java /RapidMiner_Unuk/src/com/rapidminer/operator/preprocessing/transformation/aggregation line 153 Java Problem
Potential null pointer access: The variable allWeights may be null at this location MedianAggregator.java /RapidMiner_Unuk/src/com/rapidminer/operator/preprocessing/transformation/aggregation line 155 Java Problem
Potential null pointer access: The variable allWeights may be null at this location MedianAggregator.java /RapidMiner_Unuk/src/com/rapidminer/operator/preprocessing/transformation/aggregation line 184 Java Problem
Potential null pointer access: The variable b64os may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 733 Java Problem
Potential null pointer access: The variable b64os may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1006 Java Problem
Potential null pointer access: The variable bais may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1369 Java Problem
Potential null pointer access: The variable bais may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1464 Java Problem
Potential null pointer access: The variable baos may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 737 Java Problem
Potential null pointer access: The variable baos may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1010 Java Problem
Potential null pointer access: The variable baos may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1361 Java Problem
Potential null pointer access: The variable bestAssignmentKernel may be null at this location GreedyKernelDistribution.java /RapidMiner_Unuk/src/com/rapidminer/tools/math/distribution/kernel line 97 Java Problem
Potential null pointer access: The variable bestAssignments may be null at this location FastKMeans.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 296 Java Problem
Potential null pointer access: The variable bestAssignments may be null at this location KMeans.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 208 Java Problem
Potential null pointer access: The variable bestAssignments may be null at this location KMedoids.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 215 Java Problem
Potential null pointer access: The variable bestEver may be null at this location EvolutionaryFeatureAggregation.java /RapidMiner_Unuk/src/com/rapidminer/operator/features/aggregation line 240 Java Problem
Potential null pointer access: The variable bestMergeKernel1 may be null at this location GreedyKernelDistribution.java /RapidMiner_Unuk/src/com/rapidminer/tools/math/distribution/kernel line 99 Java Problem
Potential null pointer access: The variable bestModel may be null at this location FastKMeans.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 288 Java Problem
Potential null pointer access: The variable bestModel may be null at this location KMeans.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 192 Java Problem
Potential null pointer access: The variable bestModel may be null at this location KMedoids.java /RapidMiner_Unuk/src/com/rapidminer/operator/clustering/clusterer line 207 Java Problem
Potential null pointer access: The variable bestNode may be null at this location BallTree.java /RapidMiner_Unuk/src/com/rapidminer/tools/math/container line 126 Java Problem
Potential null pointer access: The variable bestNode may be null at this location BallTree.java /RapidMiner_Unuk/src/com/rapidminer/tools/math/container line 129 Java Problem
Potential null pointer access: The variable bestPerformance may be null at this location RandomOptimizationChain.java /RapidMiner_Unuk/src/com/rapidminer/operator/meta line 122 Java Problem
Potential null pointer access: The variable bis may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1608 Java Problem
Potential null pointer access: The variable bis may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1676 Java Problem
Potential null pointer access: The variable bos may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1512 Java Problem
Potential null pointer access: The variable bos may be null at this location Base64.java /RapidMiner_Unuk/src/com/rapidminer/io line 1549 Java Problem
Potential null pointer access: The variable c1 may be null at this location AbstractTableModelTableRenderer.java /RapidMiner_Unuk/src/com/rapidminer/gui/renderer line 167 Java Problem
Potential null pointer access: The variable c2 may be null at this location AbstractTableModelTableRenderer.java /RapidMiner_Unuk/src/com/rapidminer/gui/renderer line 169 Java Problem
Potential null pointer access: The variable changeDimensionConfig may be null at this location PlotData.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/data line 348 Java Problem
Potential null pointer access: The variable changeDimensionConfig may be null at this location PlotData.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/data line 356 Java Problem
Potential null pointer access: The variable changeRangeAxis may be null at this location PlotData.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/data line 377 Java Problem
Potential null pointer access: The variable changeValueSource may be null at this location PlotData.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/data line 445 Java Problem
Potential null pointer access: The variable changeValueSource may be null at this location PlotData.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/data line 465 Java Problem
Potential null pointer access: The variable cluster may be null at this location GaussianMixtureFunction.java /RapidMiner_Unuk/src/com/rapidminer/operator/generator line 101 Java Problem
Potential null pointer access: The variable cluster may be null at this location TwoGaussiansClassificationFunction.java /RapidMiner_Unuk/src/com/rapidminer/operator/generator line 98 Java Problem
Potential null pointer access: The variable confidenceAttributes may be null at this location LibSVMModel.java /RapidMiner_Unuk/src/com/rapidminer/operator/learner/functions/kernel line 231 Java Problem
Potential null pointer access: The variable creator may be null at this location ParameterTypeConfiguration.java /RapidMiner_Unuk/src/com/rapidminer/parameter line 111 Java Problem
Potential null pointer access: The variable current may be null at this location AbstractValueGrouping.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/configuration line 179 Java Problem
Potential null pointer access: The variable current may be null at this location AbstractValueGrouping.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/configuration line 198 Java Problem
Potential null pointer access: The variable current may be null at this location DistinctValueGrouping.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/configuration line 96 Java Problem
Potential null pointer access: The variable current may be null at this location DistinctValueGrouping.java /RapidMiner_Unuk/src/com/rapidminer/gui/new_plotter/configuration line 111 Java Problem
Potential null pointer access: The variable currentBestPerformance may be null at this location BackwardAttributeEliminationOperator.java
no but you do need to use Java 7 JDK for Eclipse.
Regards,
Marco
I get the ExampleSet object, but I can't print the values. I used one of your example codes in the forum.
There is nullPointerException in my code. Could you please have a look?
Thanks! And this is the error:
first of all, let me suggest to never include the XML of a process into your code, it makes it a) hard to read and b) hard to find the problem because I can't just copy&paste the XML into RapidMiner. I suggest to either use new Process(new File(/*pathToFile*/)) or Tools.readTextFile(new File(/*pathToFile*/)) in case you do not want to use the Repository.
Having said that, the only possible way for your NPE is when your RapidMiner process simply returns nothing or it is not an ExampleSet because the for-loop is not included in the previous IF block.
Make sure your RM process returns the desired result when executed in RapidMiner.
Regards,
Marco
Thanks, now it works.
My idea is to give the input file for test from my application and as an output have only 'Prediction' column saved in a *.xls file. Could you please give some hints which methods shal I use for this purpose?
Thanks!
Best regards
Armen
create a RapidMiner process that does exactly that (have a look at Select Attributes and Write Excel operators), then use said process, edit the parameter for the input file (and maybe the output file) and execute it.
Regards,
Marco
Thanks!
Best regards
Armen
I posted that in my first answer
http://rapid-i.com/rapidforum/index.php/topic,6476.msg22727.html#msg22727
Regards,
Marco
I just tried to give the path from the code, but again NPE. As I understood, I have to remove the file name from ReadExcel operator in RapidMiner and give the path as a parameter in my code, am I right? So, this part looks like this: Thanks for your support!
Best regards
Armen
I'm giving the parameters for the ReadExcel operator, but stil getting an error: This is the corresponding part of the code:
Best regards
Armen
works fine for me. Make sure you are
a) using the import "com.rapidminer.operator.nio.ExcelExampleSource" and not the other ExcelExampleSource from the deprecated operator.io package and
b) setting the parameter on the correct operator Regards,
Marco
Works fine, the name of my operator was "Read Excel (2)", because I had another one, but deactivated.
If we have a trained model and we need to classify a new unseen text document,
What is the operator to be used in Rapid-miner GUI?
the "Process Documents from Files" operator should help you with that. It can read all text files from a foalder and create documents out of them.
Regards,
Marco
Hi,
Unfortunately, the link is broken, and I could not open the page you referred to.
Thanks,
hi @Pirehelokan - this is an old thread. Which link are you referring to?
Scott