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
"Parameter macro process_path"
I can´t get the path of a process with the %{process_path}.
If I modify the 01_DecisionTree.xml with a reference in the log file I get an error
Cannot create log file: java.io.FileNotFoundException: C:\rmws\Sample\02_Learner\01_DecisionTree.xml\kk.log
The name and extension of the experiment is included. The same is obtained using process_name macro.
Can be used the macros in the root node?
Is there any other macro for the path?
Thanks in advance.
F.J. Cuberos
If I modify the 01_DecisionTree.xml with a reference in the log file I get an error
Cannot create log file: java.io.FileNotFoundException: C:\rmws\Sample\02_Learner\01_DecisionTree.xml\kk.log
The name and extension of the experiment is included. The same is obtained using process_name macro.
Can be used the macros in the root node?
Is there any other macro for the path?
Thanks in advance.
F.J. Cuberos
<operator name="Root" class="Process" expanded="yes">
<description text="#ylt#table#ygt##ylt#tr#ygt##ylt#td#ygt##ylt#p#ygt#This experiment starts with loading the data.
...
RuleLearner.#ylt#/i#ygt##ylt#/td#ygt##ylt#/tr#ygt##ylt#/table#ygt##ylt#/li#ygt##ylt#/ul#ygt#"/>
<parameter key="logfile" value="%{process_path}\kk.log"/>
<parameter key="logverbosity" value="all"/>
<operator name="Input" class="ExampleSource">
<parameter key="attributes" value="../data/golf.aml"/>
</operator>
<operator name="DecisionTree" class="DecisionTree">
</operator>
</operator>
0
Answers
The macro is working correctly:
%{process_path} = C:\rmws\Sample\02_Learner\01_DecisionTree.xml
The problem is that there is no folder named "01_DecisionTree.xml"
Here are a few hints regarding this problem:
- If you save your process before you run it and path parameters are specified without folders (e.g. like "kk.log") the files will automatically be saved to the folder where your process.xml is located
- If you want to save files to a subfolder of your process-folder, use something like "/testfolder/kk.log". Note that the mentioned subfolder has to be created MANUALLY
hope this was helpful,Steffen
I don´t understand that the process_path return the path and the name of the process.
If the name is obtained with process_name and process_file is logical to think process_path (and 4.0 tutorial states "%{process_path} becomes the path of the process file.") only return the path, because in that case the path+name can be obtained with %{process_path}\%{process_file}.
Thanks again.
F.J. Cuberos
Yes, there is some kind of redundancy. But if %{process_path} would behave as you wish it were completely redundant, since RapidMiner resolves the path of the process-file automatically. I guess that the three different kinds of process-macros are part of RapidMiner due to historical reasons...
beside: I do not know any usecase for %{process path} for its current or your desired behaviour.
greetings,
Steffen
Anyone found a solution how to get a valid path under W7?
\\LocalRepository\... actually is a valid path; however not a file system path, but a repository path: it's the location of the process in the repository structure.
Best,
Marius
How can this \\LocalRepository\ repository path be converted to a valid system path in a WriteFile operator for example?
The two options to use relative paths (you suggested on October 07, 2008, 09:27:49 AM) do not write the file in the location of the process file but in my home directory. (Is this typical W7?)
Kind regards,
Bart
I think that's not easily possible. But may I ask what you want to do? Maybe there is a better way of doing it than finding the process location.
Anyway, it is a bad idea to write anything manually into the directory containing the process, because it is located in the repository folder, which has a special format which should be maintained exclusively by RapidMiner (similar to a database or something).
Best,
Marius
I try to read a file settings to be used in macros in different projects. So i would like to put that file, say current.csv, in the folder within the local repository. The result is a file not found exception on \\LocalRepository\MyProjects\MySettings\current.csv
The only alternative is to define the full path to this file, but that is not the purpose of the default macros, right?
Kind regards,
Bart
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<process expanded="true" height="721" width="1201">
<operator activated="true" class="read_csv" compatibility="5.2.008" expanded="true" height="60" name="Read CSV" width="90" x="112" y="30">
<parameter key="csv_file" value="%{process_path}/current.csv"/>
<list key="annotations"/>
<list key="data_set_meta_data_information"/>
</operator>
<connect from_op="Read CSV" from_port="output" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
why not import the csv file into the repository and use Extract Macro to read the macro values from the example set? The attached process provides an example on how to do that.
Best, Marius