2017-10-05 18 views
0

나는이 같은 '스크립트를 실행합니다'는 RapidMiner의 ExampleSet에서 속성을 추출하기 위해 노력하고 있습니다.Rapidminer 스크립트의 Attribute 대신 SimpleAttribute?</p> <pre><code>ExampleSet exSet = input[0]; Attributes attrs = exSet.getAttributes(); Attribute attr = attrs.getAttribute("h_area"); </code></pre> <p>을하지만 그때 나는 오류가 발생하며 attrs에이 속성하지만 SimpleAttributes의 대상이 아닌 것을 말한다

이 작동 :

Attribute[] attrs2 = exSet.createRegularAttributeArray(); 
Attribute attr2 = attrs2.getAt(1); 

ExampleSet에서 속성을 얻을 수있는 올바른 방법은 무엇입니까? getAttributes() 전화가 SimpleAttributesAttributes 추상 클래스를 구현하는 객체를 반환합니다 같은 these docs에서

답변

2

, 그것은 보인다, 그래서이 단계에서 꽤 공정한 보인다. 그러나 getAttribute() 메서드는 두 개체 중 하나에 정의 된 것처럼 보이지 않습니다. 여기에서 지금은 테스트 할 수 없지만 다음을 시도해 보았습니다.

ExampleSet exSet = input[0]; 
Attributes attrs = exSet.getAttributes(); 
Attribute attr = attrs.get("h_area"); 
+0

예, .get ("AttributeName")은 트릭을 수행해야합니다. 또한 RapidMiner 커뮤니티 포럼 (http://community.rapidminer.com/)에서 질문하거나, 다시 게시 할 수 있습니다. – David

+0

예, 작동합니다! 비슷한 이름을 가진 많은 수업과 혼동을 느낍니다. – Johan