2016-04-04 7 views
0

各行は、単一のトランザクションで購入されたアイテムを示す場合、私は品目フォーマット関連ルールのRapidMinerでトランザクション(バスケット)データを読み込む方法は?

citrus fruit,semi-finished,bread,margarine 
tropical fruit,yogurt,coffee,milk 
yogurt,cream,cheese,meat spreads 
etc 

で分離トランザクション(バスケット)データカンマました。 Read.CSV演算子を使って、このファイルをRapidMinerにロードしました。 FP成長と関連ルールマイニングのためにこのデータを変換する演算子を見つけることができませんでした。

関連ルールマイニングのためにRapidMinerでこのようなタイプのファイルを読み取る方法はありますか?

答えて

0

私はついにあなたが意味するものを理解しました - ごめんなさい、遅いです。これは、Text Processing Extensionの演算子を使用して行うことができます。これはRapidMinerリポジトリからインストールする必要があります。いったんこのプロセスを試すことができます。

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<process version="7.0.000"> 
    <context> 
    <input/> 
    <output/> 
    <macros/> 
    </context> 
    <operator activated="true" class="process" compatibility="7.0.000" expanded="true" name="Process"> 
    <process expanded="true"> 
     <operator activated="true" class="read_csv" compatibility="7.0.000" expanded="true" height="68" name="Read CSV" width="90" x="246" y="85"> 
     <parameter key="csv_file" value="C:\Temp\is.txt"/> 
     <parameter key="column_separators" value="\r\n"/> 
     <parameter key="first_row_as_names" value="false"/> 
     <list key="annotations"/> 
     <parameter key="encoding" value="windows-1252"/> 
     <list key="data_set_meta_data_information"> 
      <parameter key="0" value="att1.true.polynominal.attribute"/> 
     </list> 
     </operator> 
     <operator activated="true" class="nominal_to_text" compatibility="7.0.000" expanded="true" height="82" name="Nominal to Text" width="90" x="380" y="85"/> 
     <operator activated="true" class="text:process_document_from_data" compatibility="7.0.000" expanded="true" height="82" name="Process Documents from Data" width="90" x="514" y="85"> 
     <parameter key="vector_creation" value="Term Occurrences"/> 
     <list key="specify_weights"/> 
     <process expanded="true"> 
      <operator activated="true" class="text:tokenize" compatibility="7.0.000" expanded="true" height="68" name="Tokenize" width="90" x="45" y="34"> 
      <parameter key="mode" value="specify characters"/> 
      <parameter key="characters" value=","/> 
      </operator> 
      <connect from_port="document" to_op="Tokenize" to_port="document"/> 
      <connect from_op="Tokenize" from_port="document" to_port="document 1"/> 
      <portSpacing port="source_document" spacing="0"/> 
      <portSpacing port="sink_document 1" spacing="0"/> 
      <portSpacing port="sink_document 2" spacing="0"/> 
     </process> 
     </operator> 
     <connect from_op="Read CSV" from_port="output" to_op="Nominal to Text" to_port="example set input"/> 
     <connect from_op="Nominal to Text" from_port="example set output" to_op="Process Documents from Data" to_port="example set"/> 
     <connect from_op="Process Documents from Data" from_port="example set" 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> 

トリックで元のファイルを読み取るが、区切り文字として行の終わりを使用するRead CSVを使用することです。これは多項式の属性として行全体を読み込みます。そこから、これをテキストに変換して、テキスト処理オペレータが作業を行えるようにする必要があります。 Process Documents from Data演算子を使用して、最後のサンプルセットを作成します。重要な点は、Tokenize演算子を使用して、行をコンマで区切られた単語に分割することです。

関連する問題