[SOLVED] How to get distribution table model of naive bayes?

anonimoperanonimoper Member Posts: 10 Contributor I
edited November 2018 in Help
Hi, i want to get distribution table model of naive bayes. I use eclipse but i don't get distribution table model. I get performance vector.

This is code:

package fdf;

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 com.rapidminer.operator.Model;




import java.io.File;
import java.io.IOException;
import java.util.Iterator;

import com.rapidminer.operator.io.ExcelExampleSource;
import com.rapidminer.operator.learner.bayes.DistributionModel;
import com.rapidminer.repository.IOObjectEntry;
import com.rapidminer.repository.ProcessEntry;
import com.rapidminer.repository.RepositoryLocation;
import com.rapidminer.tools.XMLException;

public class Prueba {

public static void main(String args[]) throws OperatorException, IOException, XMLException {

   RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
   System.setProperty("rapidminer.home", "C:\\Users\\lDanny\\workspace\\rapidminer-5.3.013\\rapidminer");
   RapidMiner.init();
   
   Process location = new Process(new File("C:\\Users\\lDanny\\.RapidMiner5\\repositories\\Local Repository\\PrimeraVez.rmp"));
   IOContainer resultExample = location.run();
   
   System.out.println(resultExample.toString());
System.out.println("am here");
}
}

this is result:

IOContainer (3 objects):
SimpleExampleSet:
32 examples,
1778 regular attributes,
special attributes = {
   label = #0: categoria (nominal/single_value)/values=[H.1.2, H.3.3]
}
(created by Set Role)
Distribution model for label attribute categoria


Class H.1.2 (0.875)
1778 distributions

Class H.3.3 (0.125)
1778 distributions

(created by Naive Bayes)

PerformanceVector [
-----accuracy: 100.00% +/- 0.00% (mikro: 100.00%)
ConfusionMatrix:
True: H.1.2 H.3.3
H.1.2: 28 0
H.3.3: 0 4
-----precision: 100.00% (positive class: H.3.3)
ConfusionMatrix:
True: H.1.2 H.3.3
H.1.2: 28 0
H.3.3: 0 4
-----recall: 100.00% (positive class: H.3.3)
ConfusionMatrix:
True: H.1.2 H.3.3
H.1.2: 28 0
H.3.3: 0 4
-----AUC (optimistic): 0.900 +/- 0.200 (mikro: 0.900) (positive class: H.3.3)
-----AUC: 0.500 +/- 0.000 (mikro: 0.500) (positive class: H.3.3)
-----AUC (pessimistic): 0.900 +/- 0.200 (mikro: 0.900) (positive class: H.3.3)
]
(created by Performance (2))

i want to get this:http://www.subirimagenes.net/i/140502022203717274.png

Tagged:

Answers

  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Moderator, Employee, Member, University Professor Posts: 1,806   RM Engineering
    Hi,

    you want your second result, the DistributionModel. You can then pass that to the  DistributionTableModel(DistributionModel model) constructor which is an AbstractTableModel. You then have the table model you want.

    Regards,
    Marco
  • anonimoperanonimoper Member Posts: 10 Contributor I
    Thanks, but i how get DistributionTableModel?

    IOContainer resultExample = location.run();

    resultExample haven't DistributionTableModel, or i must not to use IOContainer?.
    Thanks.

  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Moderator, Employee, Member, University Professor Posts: 1,806   RM Engineering
    Hi,

    no you have to create the DistributionTableModel yourself. The result only contains the DistributionModel.

    Regards,
    Marco
  • anonimoperanonimoper Member Posts: 10 Contributor I
    Him thanks very much, I create DistributionTableModelRender and it's ok.
    Thanks.
Sign In or Register to comment.