I have input features of a hierarchical structure. Each feature consists of a header element and 0 to n subfeatures of the same structure. Also, there is no upper limit for n and n can be different from feature to feature. It should also be possible to establish relationships between features with a different number of subfeatures.

How can I format this data so that it can be used to train different (machine) learning algorithms?

Example of one input feature with 2 subfeatures:

<header code="21268_2" date_begin="2018-07-07T00:00:00" date_end="2018-07-07T00:00:00" reason=“2”>
     <d code="I6"/>
    <record amount="69.02" code=“439.0010" date_begin="2018-07-07T00:00:00" date_end="2018-07-07T00:00:00" quantity="1" record_id="2" tariff_type="001" unit_factor="0.82"/>
    <record amount="46.32" code=“93.1950" date_begin="2018-07-07T12:00:00" date_end="2018-07-07T12:00:00" quantity="1" record_id="5" tariff_type="001" unit_factor="0.82"/>
  • $\begingroup$ Can you give some example? A few rows of features and sub-features would help. $\endgroup$
    – serali
    Sep 28 at 10:13
  • $\begingroup$ you should add this to your original question instead. $\endgroup$
    – serali
    Sep 29 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.