【问题标题】:Build Correlation Matrix to use two different cells of two Csv files in Rapid miner构建相关矩阵以在 Rapid miner 中使用两个 Csv 文件的两个不同单元格
【发布时间】:2026-02-22 16:20:07
【问题描述】:

我想用两个不同 csv 文件的两个不同单元格构建相关矩阵。任何人都可以帮助我告诉我如何从一个文件中指定一列并与其他文件相同?

【问题讨论】:

    标签: csv correlation rapidminer


    【解决方案1】:

    您必须通过使用Join 运算符将两列连接在一起来创建一个新的示例集,然后您才能计算相关矩阵。加入时请确保两个示例集具有相同的 ID 属性。 下面的代码块显示了如何选择和连接两个属性的示例过程。

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.4.000">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="7.0.000-SNAPSHOT" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="retrieve" compatibility="7.0.000-SNAPSHOT" expanded="true" height="60" name="Retrieve Iris" width="90" x="45" y="75">
            <parameter key="repository_entry" value="//Samples/data/Iris"/>
          </operator>
          <operator activated="true" class="select_attributes" compatibility="7.0.000-SNAPSHOT" expanded="true" height="76" name="Select Attributes" width="90" x="179" y="75">
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="a1"/>
          </operator>
          <operator activated="true" class="retrieve" compatibility="7.0.000-SNAPSHOT" expanded="true" height="60" name="Retrieve Iris (2)" width="90" x="45" y="255">
            <parameter key="repository_entry" value="//Samples/data/Iris"/>
          </operator>
          <operator activated="true" class="select_attributes" compatibility="7.0.000-SNAPSHOT" expanded="true" height="76" name="Select Attributes (2)" width="90" x="179" y="255">
            <parameter key="attribute_filter_type" value="single"/>
            <parameter key="attribute" value="a2"/>
          </operator>
          <operator activated="true" class="join" compatibility="7.0.000-SNAPSHOT" expanded="true" height="76" name="Join" width="90" x="380" y="165">
            <list key="key_attributes"/>
          </operator>
          <operator activated="true" class="correlation_matrix" compatibility="7.0.000-SNAPSHOT" expanded="true" height="94" name="Correlation Matrix" width="90" x="581" y="165"/>
          <connect from_op="Retrieve Iris" from_port="output" to_op="Select Attributes" to_port="example set input"/>
          <connect from_op="Select Attributes" from_port="example set output" to_op="Join" to_port="left"/>
          <connect from_op="Retrieve Iris (2)" from_port="output" to_op="Select Attributes (2)" to_port="example set input"/>
          <connect from_op="Select Attributes (2)" from_port="example set output" to_op="Join" to_port="right"/>
          <connect from_op="Join" from_port="join" to_op="Correlation Matrix" to_port="example set"/>
          <connect from_op="Correlation Matrix" from_port="matrix" 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>
    

    【讨论】:

    • @DavidAmu What if ,从一个文件中选择两列并将它们关联起来。是否可以关联一个文件的两列?
    • 当然,您可以关联一个文件中的列。如果使用Correlation Matrix 运算符,它将计算示例集输入的所有属性之间的相关性。如果此示例集是单个文件导入或多个文件连接的结果(如上例所示),则无关紧要。
    • [IMG]i57.tinypic.com/wulzzd.png[/IMG] [IMG]i61.tinypic.com/4r2cdt.png[/IMG] 这里有两张图片,一张是样本集,第二张是相关矩阵。在我的示例中,一个文件的两列之间的相关性,但它不相关的值。 @DavidAmu