The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.

Display rapidminer process result in jtable

tapankhistetapankhiste Member Posts: 4 Contributor I
edited November 2018 in Help
i tried to run one process of rapiminer in eclipse and it successfully run and result is print in console.after i make one applet form and tried to display result in applet form so how to display the particular result set in applet give a solution my code shown below....

import com.rapidminer.RapidMiner;
import com.rapidminer.Process;
import com.rapidminer.example.Attribute;
import com.rapidminer.example.Example;
import com.rapidminer.example.ExampleSet;
import com.rapidminer.operator.IOContainer;
import com.rapidminer.operator.IOObject;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorException;

import java.util.Iterator;

import org.freehep.graphicsio.swf.DefineBits;

import com.rapidminer.repository.IOObjectEntry;
import com.rapidminer.repository.ProcessEntry;
import com.rapidminer.repository.RepositoryLocation;

public class replacemiss {

    public static void main(String args[]) throws Exception {
    // this initializes RapidMiner with your repositories available
    // loads the process from the repository
    Process location = new Process(new File("D:\\rm\\replacemiss.rmp"));
    //Entry entry = location.locateEntry();
    //if (entry instanceof ProcessEntry) {
        //Process process = new RepositoryProcessLocation(location).load(null);
  Operator op = location.getOperator("Read Excel");
  op.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "D:\\rm\\data1.xlsx");
  Operator op1=location.getOperator("Replace Missing Values");
  op1.setParameter("default", "average");
  //op1.setParameter("replenishment Value","Y");
    Operator outp = location.getOperator("Write Excel");
  outp.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "D:\\rm\\data2.xlsx");
  // RapidMiner.init();
  // Process location1 = new Process(new File("D:\\rm\\replacemiss.rmp"));
  // Operator opa = location.getOperator("Read Excel");
  //opa.setParameter(ExcelExampleSource.PARAMETER_EXCEL_FILE, "D:\\rm\\data2.xlsx");
  // Operator opa1=location.getOperator("Replace Missing Values");
  // opa1.setParameter("attribute","");
  // opa1.setParameter("default", "average");
    IOContainer ioResult =;
        IOObject result = ioResult.getElementAt(0);
    // use the result(s) as needed, for example if your process just returns one ExampleSet, use this:
    if (ioResult.getElementAt(0) instanceof ExampleSet) {
        ExampleSet resultSet = (ExampleSet)ioResult.getElementAt(0);
        int i=0;
        for (Example example : resultSet) {
            Iterator<Attribute> allAtts = example.getAttributes().allAttributes();

            while(allAtts.hasNext()) {
                Attribute a =;
                System.out.print(a.getName()+ "  ");
    for (Example example : resultSet) {
        Iterator<Attribute> allAtts = example.getAttributes().allAttributes();
        while(allAtts.hasNext()) {
            Attribute a =;
                    if (a.isNumerical()) {
                            double value = example.getValue(a);
                            System.out.print(value+ " " );

                    } else {
                            String value = example.getValueAsString(a);
                            System.out.print(value+ " ");



  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering

    you have the values available which should go into each cell. I don't understand the problem? If you don't know how to use a JTable, please have a look at some Swing tutorials on the Internet.
    As stated in the FAQ, this forum is for help with RapidMiner Studio code questions, not a general Java help forum. You won't have much luck doing your first steps in Java here.

Sign In or Register to comment.