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

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

anonimoperanonimoper Member Posts: 10 Contributor II
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 Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 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 II
    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 Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

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

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