The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 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
Trouble in reading integer
Rapidminerpartner
Member Posts: 35 Contributor II
in Help
Hello, everyone
In my project, I have to read integer such as "2148312002" or "2148312010"
Then if I read data like "2148312002" using Import Data
and I chose integer type for this value
Then the value changes to
2147483647 |
after reading this data. I guess any integer value greater than 2148312002 will change to 2147483647 But, if I read this data and change the type to polynominal, it is OK. However, I want to read stuff like "2148312002" as integer. So please find the reason why this happen for me Thank you and have a nice day |
0
Best Answers
-
yyhuang Administrator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 364 RM Data ScientistHi @Rapidminerpartner,
2147483647 is the maximum positive value for a 32-bit signed binary integer in computing.
As a workaround for now you can also use a Numerical To Real operator. They won't see the difference without going to the statistics.
If this huge integer is a unique identifier (ID), it is better to be converted to polynominal.
Best,<?xml version="1.0" encoding="UTF-8"?><process version="9.4.000-BETA"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="9.4.000-BETA" expanded="true" name="Process"> <parameter key="logverbosity" value="init"/> <parameter key="random_seed" value="2001"/> <parameter key="send_mail" value="never"/> <parameter key="notification_email" value=""/> <parameter key="process_duration_for_mail" value="30"/> <parameter key="encoding" value="SYSTEM"/> <process expanded="true"> <operator activated="true" class="generate_sales_data" compatibility="9.4.000-BETA" expanded="true" height="68" name="Generate Sales Data" width="90" x="45" y="34"> <parameter key="number_examples" value="100"/> <parameter key="use_local_random_seed" value="false"/> <parameter key="local_random_seed" value="1992"/> </operator> <operator activated="true" class="date_to_numerical" compatibility="9.0.001" expanded="true" height="82" name="Date to Numerical" width="90" x="179" y="34"> <parameter key="attribute_name" value="date"/> <parameter key="time_unit" value="millisecond"/> <parameter key="millisecond_relative_to" value="epoch"/> <parameter key="second_relative_to" value="minute"/> <parameter key="minute_relative_to" value="hour"/> <parameter key="hour_relative_to" value="day"/> <parameter key="day_relative_to" value="month"/> <parameter key="week_relative_to" value="year"/> <parameter key="month_relative_to" value="year"/> <parameter key="quarter_relative_to" value="year"/> <parameter key="half_year_relative_to" value="year"/> <parameter key="year_relative_to" value="era"/> <parameter key="keep_old_attribute" value="true"/> </operator> <operator activated="true" class="numerical_to_real" compatibility="9.4.000-BETA" expanded="true" height="82" name="Numerical to Real" width="90" x="313" y="34"> <parameter key="attribute_filter_type" value="single"/> <parameter key="attribute" value="date_millisecond"/> <parameter key="attributes" value=""/> <parameter key="use_except_expression" value="false"/> <parameter key="value_type" value="numeric"/> <parameter key="use_value_type_exception" value="false"/> <parameter key="except_value_type" value="real"/> <parameter key="block_type" value="value_series"/> <parameter key="use_block_type_exception" value="false"/> <parameter key="except_block_type" value="value_series_end"/> <parameter key="invert_selection" value="false"/> <parameter key="include_special_attributes" value="false"/> </operator> <operator activated="true" class="store" compatibility="9.4.000-BETA" expanded="true" height="68" name="Store" width="90" x="447" y="34"> <parameter key="repository_entry" value="//demo/date to num milliseconds"/> </operator> <connect from_op="Generate Sales Data" from_port="output" to_op="Date to Numerical" to_port="example set input"/> <connect from_op="Date to Numerical" from_port="example set output" to_op="Numerical to Real" to_port="example set input"/> <connect from_op="Numerical to Real" from_port="example set output" to_op="Store" to_port="input"/> <connect from_op="Store" from_port="through" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator> </process>
7 -
Marco_Boeck Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM EngineeringHi,
You cannot read it as an integer, as Integer is limited to 2^31 = 2,147,483,647 in Java.
You can read it as a real, then it will be fine.
Regards,
Marco6
Answers
I attached captured image of the result window
Hello, yyhuang and Marco_Boeck
Oh, I understand.
I forgot that number is about 2^31
Thank you very much for your help and have a nice day!