本文介绍了Rapidminer 数据转置等效于 R 中的熔解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从 Web API 读取的 Rapidminer 进程,使用 Read XML 来处理响应和 XPATH 来捕获 XML 中的元素之一.元素可以是任意数量,结果属性是 element/text() 的连接字符串.

I have a Rapidminer process which reads from a web API, uses Read XML to process the response and XPATH to capture one of the elements in the XML. The elements can be of any number and the resulting attribute is a concatenated string of the element/text().

作为连接字符串的结果,我必须将字符串拆分为多列,如下所示:

As a result of the concatenated string, I have to split the string into multiple columns like this:

ID  Col1  Col2 Col3 Col4 Col5 Col6
A   1     5    7    8
B   2
C   4
D   3     9    10   11   12   13

我的最终目标是将其转换为以下格式:

My final goal is to transpose it into the following format:

ID  NewCol
A   1
A   5
A   7
A   8
B   2
C   4
D   3
D   9
D   10
D   11
D   12
D   13

两个问题:
1. Read XML 操作符是否可以配置为将数据读入多行而不是长连接字符串?
2. 如果对 1 的回答是否定的,是否有任何算子可以执行上述转置"任务(类似于 R 中的熔体函数)?

Two questions:
1. Can the Read XML operator be configured to read data into multiple rows instead of a long concatenated string?
2. If answer to 1 is negative, is there any operator which can perform the "transpose" task as described above(similar to melt function in R)?

推荐答案

您可以在 Rapid miner 中使用 de-pivot 运算符.只需查看其文档

You may use de-pivot operator in rapid miner. Just go through its documentation

这篇关于Rapidminer 数据转置等效于 R 中的熔解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 04:28