data type conversion
Hi,
I understand that data type of fields can be altered while creating the data link.
But is there a function available to convert the data types of the derived variables in the workbook(I couldn't find any in the list).
Specifically I want to convert int to binary since I use the flag column(int) in the decision tree target variable, but it only accepts only binary or string format .
Regards,
Naveen
-
Official comment
I assume that by "binary" above, you are referring to a boolean type in Datameer as described in the documentation here: https://documentation.datameer.com/documentation/display/DAS50/Data+Field+Types+in+Datameer
This is because you mention that it is one of the accepted types for a Decision Tree target.
To convert an Integer to a Boolean, you could use the IF function. For example, suppose there is a column "A" of type integer. The following function would map "A" to a boolean: IF(#A==1;true;false)
Comment actions -
Thanks Stewart!
I was able to convert the field into binary and use it in decision tree variable.
Are there functions to change the data type from int to string, long etc. and vice versa without having to go back to the data link to make the changes?
Also, it would be of help if you could provide any material on leveraging the decision tree feature in Datameer.
Thanks!
Enaven
-
Yes, here are some examples:
To String: https://documentation.datameer.com/documentation/display/DAS50/T
To BigDecimal: https://documentation.datameer.com/documentation/display/DAS50/BIGDECIMAL
To BigInteger: https://documentation.datameer.com/documentation/display/DAS50/BIGINTEGER
The Decision Tree is documented in detail here: https://documentation.datameer.com/documentation/display/DAS50/Decision+Tree
Please sign in to leave a comment.
Comments
3 comments