【问题标题】:create Attribute from other Attribute names从其他属性名称创建属性
【发布时间】:2015-12-05 11:55:54
【问题描述】:

我使用读取 CSV 来获取数据。 数据采用这种格式

Country   2013   2014   2015
USA       4      5      8
UK        2      6      3
France    3      7      5

我想把它转换成

Country   Year   New Attribute
USA       2013   4
USA       2014   5
USA       2015   8
UK        2013   2
UK        2014   6
UK        2015   3
France    2013   3
France    2014   7
France    2015   5

请详细告诉我如何在 Rapid Miner 中执行此操作,因为我对此知之甚少。

【问题讨论】:

    标签: database pivot rapidminer


    【解决方案1】:

    为此需要De-Pivot 运算符。假设您有这些名称的常规属性。

    Country, 2013, 2014, 2015
    

    De-Pivot 运算符连接到您的示例数据并按如下方式进行配置。

    De-Pivot 运算符的attribute name 参数对话框中,将attribute name 设置为

    New attribute
    

    并将attribute nameattributes 设置为

    ([0-9]+)
    

    同样在De-Pivot 运算符中,将index 属性设置为

    Year
    

    最后将create nominal index复选框设置为true。

    【讨论】:

    • 有人对此投了反对票 - 也许他们可以提供一些反馈?
    【解决方案2】:

    查找元数据信息。如果第一行是属性名称,则在 read_csv 方法中使用参数“first_row_as_names”。

    在此处查看文档: http://docs.rapidminer.com/studio/operators/import/data/read_csv.html

    【讨论】:

    • 这没有回答原来的问题。
    猜你喜欢
    • 2021-08-31
    • 2015-08-28
    • 1970-01-01
    • 1970-01-01
    • 2013-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-13
    相关资源
    最近更新 更多