1

QuotedPremium column is a string feature so I need to convert it to numeric value in order to use algorithm.

enter image description here

So, for that I am using Edit Metadata module, where I specify data type to be converted is Floating Point.

After I run it - I got an error:

Could not convert type System.String to type System.Double, inner exception message: Input string was not in a correct format.

enter image description here

What am I missing here?

Serdia
  • 4,242
  • 22
  • 86
  • 159
  • If your source dataset has numbers handled as text, you must change them to a numeric data type before using math operations. I assume that there is not all numeric data type of your source data ,such as the first value : NULL. But I'm not sure. – Wayne Yang Jan 04 '18 at 02:04
  • There couldn't be NULL values in your column. First clear the missing data and perform edit metadata step. – Haritha Thilakarathne Jan 04 '18 at 04:30
  • Thanks. So I supposed to be able to substitute NULL's in my data using ML studio? Which module should I use for that? – Serdia Jan 04 '18 at 17:12

1 Answers1

1

As mentioned in comments, you must change column where numbers are handled as text to numeric type data and it shouldn't have any null values. Now answering the question of how to substitute NULL's in data using ML studio and converting to numeric type.

Substitute NULL's in data

Use Execute R Script module for that, and add this code in it.

dataset1 <- maml.mapInputPort(1); # class: data.frame
dataset1[dataset1 == "NULL"] = 0; # Wherever cell's value is "NULL", replace it with 0
maml.mapOutputPort("dataset1"); # return the modified data.frame

Image for same: enter image description here

Convert to numeric data

As you have added in your answer, this can be done using the Edit Metadata module.

akashperfect
  • 301
  • 3
  • 5
  • I get the error: ``` character string is not in a standard unambiguous format ``` (Using the R Script) What would you suggest here? – kierandes Nov 08 '20 at 11:52
  • Hi @kierandes not sure if its something related to the R script component. As according to this https://stackoverflow.com/questions/30105369/character-string-is-not-in-a-standard-unambiguous-format it maybe the case that if there is datetime value in string format in dataset and the conversion to datetime object is failing because its not able to figure out the format. Will you be able to share part of the script and dataset of what you are trying to do? – akashperfect Nov 09 '20 at 13:29