2010-12-15 89 views
1

我一直在使用Rapidminer並創建了一系列預製一組標準任務的進程。現在,我希望允許用戶在開始時動態設置進程的參數。Rapidminer的運行時間模塊

例如,在編寫CSV時,我想提示用戶輸入一個字符串,其中包含應該通過某種提示保存的位置(在腳本的開始處或處理過程中的其他階段。

通過Rapidminer這一點,或者我應該創建一些腳本生成和侏儒,他在飛行過程?

回答

1

要改變你想傳遞給你的程序的參數,我相信,你必須編輯.xml文件的過程。例如,

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<process version="5.0"> 
    <context> 
    <input/> 
    <output/> 
    <macros/> 
    </context> 
    <operator activated="true" class="process" compatibility="5.0.10" expanded="true" name="Process"> 
    <process expanded="true" height="145" width="212"> 
     <operator activated="true" class="generate_data" compatibility="5.0.10" expanded="true" height="60" name="Generate Data" width="90" x="112" y="30"> 
     <parameter key="number_examples" value="10"/> 
     </operator> 
     <operator activated="true" class="write_csv" compatibility="5.0.10" expanded="true" height="60" name="Write CSV" width="90" x="271" y="39"> 
     <parameter key="csv_file" value="C:\Users\wessel\Desktop\gendata.csv"/> 
     </operator> 
     <connect from_op="Generate Data" from_port="output" to_op="Write CSV" to_port="input"/> 
     <connect from_op="Write CSV" from_port="through" 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> 

您可以看到,對於write_csv運算符,該值包含要寫入的文件的路徑。如您所描述的那樣更改參數將涉及編寫腳本以獲取用戶的值,將.xml文件中的相應值編輯爲這些所需的值,然後在RapidMiner中引發該過程。

+0

希望可能有更快的方法 - 但我想這是唯一的解決方案。 – eamo 2010-12-17 10:21:22

0

可以創建一個Groovy腳本,允許用戶在運行時輸入提示。這避免了每次都必須編輯該過程。

這是一個example根據來自RapidMiner論壇的原創。