"Parameter macro process_path"

fjcuberosfjcuberos MemberPosts:18Maven
edited May 2019 inHelp
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












Tagged:

Answers

  • steffensteffen MemberPosts:347Maven
    Hello

    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
  • fjcuberosfjcuberos MemberPosts:18Maven
    我´d已经把两个快捷键you comment.

    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
  • steffensteffen MemberPosts:347Maven
    Hello

    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
    %{process name} becomes the name of the process file (without path and extension).
    %{process file} becomes the name of the process file (with extension).
    %{process path} becomes the path of the process file.
    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
  • BartNBartN MemberPosts:18Maven
    Under Windows7 the %{process_path} seems to behave differently. It returns the string \\LocalRepository\.... which is obviously not a valid path.

    Anyone found a solution how to get a valid path under W7?
  • MariusHelfMariusHelf RapidMiner Certified Expert, MemberPosts:1,869Unicorn
    Hi Bart,

    \\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
  • BartNBartN MemberPosts:18Maven
    HI 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
  • MariusHelfMariusHelf RapidMiner Certified Expert, MemberPosts:1,869Unicorn
    Hi,

    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
  • BartNBartN MemberPosts:18Maven
    Hi Markus,

    我试图读取一个文件设置中使用宏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






















  • MariusHelfMariusHelf RapidMiner Certified Expert, MemberPosts:1,869Unicorn
    Hi,

    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



































Sign InorRegisterto comment.