"ModelWriter: XML file"
nicugeorgian
New Altair Community Member
Hi,
Within the training chain of a cross validation process, I have inserted a ModelWriter operator after a learner operator (in my case, W-M5P). The corresponding part of the code looks as follows:
My question is: why I don't get also 10 XML zipped files correspoding to the 10 models? I think that the default value of the parameter output_type of the operator ModelWriter is XML Zipped, right? How can I get the models in the XML (or XML zipped) format?
Thanks,
Geo
Within the training chain of a cross validation process, I have inserted a ModelWriter operator after a learner operator (in my case, W-M5P). The corresponding part of the code looks as follows:
As the cross validation has 10 number_of_validations, the final output consists of 10 file models: model_i.mod, where i = 1,10.
<operator name="XValidation" class="XValidation" expanded="yes">
<operator name="TrainingChain" class="OperatorChain" expanded="yes">
<operator name="W-M5P" class="W-M5P">
<parameter key="M" value="10.0"/>
<parameter key="R" value="true"/>
<parameter key="keep_example_set" value="true"/>
</operator>
<operator name="ModelWriter" class="ModelWriter">
<parameter key="model_file" value="model_%{a}.mod"/>
</operator>
</operator>
My question is: why I don't get also 10 XML zipped files correspoding to the 10 models? I think that the default value of the parameter output_type of the operator ModelWriter is XML Zipped, right? How can I get the models in the XML (or XML zipped) format?
Thanks,
Geo
0
Answers
-
Hi,
ahem, I am not sure if I get your point. The created models "model_i.mod" actually are zipped XML files. Just rename them to model_i.zip and you will be able to unzip them.
Cheers,
Ingo0 -
Hi Ingo,
many thanks for the answer.
I have renamed the mod files to zip files, but I was not able to unzip them. Anyway, I ran again the process, this time asking the ModelWriter to yield xml files as opposed to zipped xml files. And yes, I was I able to open them as xml files.
They, however, do not looas as I expected In my case, the learner, W-M5P, yields a regression tree. I was expecting to see only the regression tree in the file returned by ModelWriter. There is, however, a plenty of other information in this model file
Is there a way to get an xml file with the detail of the regression tree only?
Thanks,
Geo0 -
Hi again,
the reason why it did not work with the zip files probably is that the files are actually zipped using gzip, so renaming them to "gz" and using a unzipper which is able to unzip them should work.
Try a ResultWriter:
Is there a way to get an xml file with the detail of the regression tree only?
This will produce files with exactly the same output as the text view.
<operator name="Root" class="Process" expanded="yes">
<operator name="ExampleSetGenerator" class="ExampleSetGenerator">
<parameter key="target_function" value="sum"/>
</operator>
<operator name="BinDiscretization" class="BinDiscretization">
<parameter key="number_of_bins" value="3"/>
</operator>
<operator name="XValidation" class="XValidation" expanded="yes">
<operator name="OperatorChain (2)" class="OperatorChain" expanded="yes">
<operator name="W-M5P" class="W-M5P">
<parameter key="N" value="true"/>
</operator>
<operator name="ResultWriter" class="ResultWriter">
<parameter key="result_file" value="model_%{a}.txt"/>
</operator>
</operator>
<operator name="OperatorChain" class="OperatorChain" expanded="yes">
<operator name="ModelApplier" class="ModelApplier">
<list key="application_parameters">
</list>
</operator>
<operator name="Performance" class="Performance">
</operator>
</operator>
</operator>
</operator>
Cheers,
Ingo0 -
Yes, it worked Thank you!mierswa wrote:
This will produce files with exactly the same output as the text view.
I now have to find a way to parse such a file / or to convert it to an XML file.
Cheers,
Geo0