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
"Display Decision Tree from rapidminer"
Hi
I have generated xml from java
then i passed xml to process and run the process
after that how can i get the tree img from rapidminer?
Process process = new Process(readFileAsString(x));
IOContainer ioResult = process.run();
TreeModelGraphRenderer gr = new TreeModelGraphRenderer();
Component visualizationComponent = gr.getVisualizationComponent(model, ioResult);
GraphCreator<String, String> graphCreator = gr.getGraphCreator(model, ioResult);
edu.uci.ics.jung.graph.Graph createGraph = graphCreator.createGraph();
As per Class TreeModelGraphCreator
Author IngoMierswa
An adaptor for the graph creator interface. Subclasses might want to override some of the implemented methods and have to define the GraphCreator.createGraph() method.
do we need to override createGraph() method. if so can u give some clue how can i do it to get the graph?
Tagged:
0
Answers
you should be able to do this by using this general approach: Regards,
Marco
I'm wondering if you could provide me any suggestions why I’m getting truncated decision tree graph… ? I’m using general approach that you provided above but I have added one line: to write image into OutputStream out which I’m using to display image on my web page.
Unfortunately I’m getting truncated decision tree graph for only 300px width (it’s not changing when I set 500px) few DT nodes are not displayed at all.
I updated the example a bit:
Process XML:
Complete code of a test class which visualizes the image quick&dirty:
You will just need to update the repository location to match your repository structure.
Regards,
Marco
thank You very much for example once again but my problem was related to clipRect of VectorGraphics / Graphics2D object. When scaling with Graphics2D#scale method, clipRect was the same size so I’ve looked inside yours Renderable#render method and try few values for “preferredWidth and Height” - which are in fact used inside setSize – and after a while I got optimal values ;-)