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 read the output?
Hei..
I`ve try the APi, but i still dont know how to see the output on my process..
here the console says:
I`ve try the APi, but i still dont know how to see the output on my process..
here the console says:
and here is the code
Jan 17, 2012 9:53:17 AM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Jan 17, 2012 9:53:17 AM com.rapidminer.Process run
INFO: Process starts
Jan 17, 2012 9:53:18 AM com.rapidminer.Process run
INFO: Process finished successfully after 0 s
Jan 17, 2012 9:53:18 AM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Jan 17, 2012 9:53:18 AM com.rapidminer.Process run
INFO: Process starts
Jan 17, 2012 9:53:18 AM com.rapidminer.Process run
INFO: Process finished successfully after 0 s
so what should i do next, if i want to see the output?
import com.rapidminer.repository.RepositoryLocation;
import com.rapidminer.repository.RepositoryManager;
import com.rapidminer.tools.OperatorService;
import com.rapidminer.Process;
import com.rapidminer.*;
import com.rapidminer.RapidMiner.ExecutionMode;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.Example;
import com.rapidminer.operator.IOContainer;
import com.rapidminer.operator.IOObject;
//import com.rapidminer.operator.ExecutionUnit;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.ExecutionMode.*;
import com.rapidminer.example.ExampleSet;
import com.rapidminer.gui.*;
import java.io.*;
//import com.rapidminer.operator.OperatorException;
//import com.rapidminer.operator.IOContainer;
//import java.io.IOException;
import java.io.File;
import java.util.Iterator;
public class Main {
static String line;
static String x="C:\\Documents and Settings\\user\\My Documents\\RapidMiner\\model1.rmp";
private static String readFileAsString(String filePath)
throws java.io.IOException{
StringBuffer fileData = new StringBuffer(1000);
BufferedReader reader = new BufferedReader(
new FileReader(filePath));
char[] buf = new char[1024];
int numRead=0;
while((numRead=reader.read(buf)) != -1){
String readData = String.valueOf(buf, 0, numRead);
fileData.append(readData);
buf = new char[1024];
}
reader.close();
return fileData.toString();
}
public static void main(String[] argv) throws Exception {
// MUST BE INVOKED BEFORE ANYTHING ELSE !!!
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
Process process=new Process(readFileAsString(x));
IOContainer ioResult = process.run();
if (ioResult.getElementAt(0) instanceof ExampleSet) {
ExampleSet resultSet = (ExampleSet)ioResult.getElementAt(0);
RepositoryLocation resloc = new RepositoryLocation("//MyRepository/contohg");
RepositoryManager.getInstance(null).store(resultSet, resloc, null);
}
process.run();
}
}
Tagged:
0
Answers
you can just use: Best,
Vaclav
thx for your reply..
I`ve add the code, but its appeared error
Exception in thread "main" com.rapidminer.operator.MissingIOObjectException: The operator needs some input of type com.rapidminer.example.ExampleSet which is not provided.
so how i can provided the input??
I want to use data source from excel type...
Best,
Vaclav
if your process requires some kind of input data, you can check this post to see how it can be done: click
A way to get the output example set has been provided by Vaclav
Regards,
Marco
here is my code: and the output i get is: its juts the value of my attribute, and now i want to output the name of my attribute..
there is no method getAttributeName() in rapidminer,rite? haha...
so what should i do?
Did you look at the Api for the Attribute class?
To get the name of an attribute, you can simply call Regards,
Marco