The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here.

"Error: NumberFormatException Caught"

ShubhaShubha Member Posts: 139 Maven
edited May 2019 in Help

I run the below code,
<operator name="Root" class="Process" expanded="yes">
    <operator name="ExampleSetGenerator (3)" class="ExampleSetGenerator">
        <parameter key="target_function" value="spiral cluster"/>
        <parameter key="number_of_attributes" value="2"/>
    <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
        <parameter key="target_function" value="random"/>
        <parameter key="number_examples" value="1"/>
        <parameter key="number_of_attributes" value="1"/>
    <operator name="Real2Integer" class="Real2Integer">
        <parameter key="round" value="true"/>
    <operator name="AttributeConstruction" class="AttributeConstruction">
        <list key="function_descriptions">
          <parameter key="store" value="abs(att1)"/>
    <operator name="DataMacroDefinition" class="DataMacroDefinition">
        <parameter key="macro" value="k_val"/>
        <parameter key="macro_type" value="data_value"/>
        <parameter key="attribute_name" value="store"/>
        <parameter key="example_index" value="1"/>
    <operator name="IOSelector" class="IOSelector">
        <parameter key="io_object" value="ExampleSet"/>
        <parameter key="select_which" value="2"/>
    <operator name="LOFOutlierDetection (2)" class="LOFOutlierDetection">
        <parameter key="minimal_points_lower_bound" value="%{k_val}"/>
        <parameter key="minimal_points_upper_bound" value="%{k_val}"/>
And get the error,

[quote]Process Failed:
NumberFormatException caught: For input string: "4.0"[/

Why is this error? The data read is an integer. But still the error comes.... Any ideas?

Thanks, Shubha


  • Options
    ShubhaShubha Member Posts: 139 Maven

    I got rid of the error by introducing a "MacroConstruction" operator between "DataMacroDefinition" and "IOSelector".

        <operator name="MacroConstruction" class="MacroConstruction" breakpoints="before">
            <list key="function_descriptions">
              <parameter key="v" value="abs(%{k_val})"/>

    But, does DataMarcoDefinition takes the values given to it as strings?
  • Options
    haddockhaddock Member Posts: 849 Maven
    Define macros for the current process. Macros will be replaced in the value strings of parameters by the macro values defined as a parameter of this operator
  • Options
    ShubhaShubha Member Posts: 139 Maven

Sign In or Register to comment.