Skip to content

float precision #559

Description

@joaquinvanschoren

When a dataset is loaded (from an arff file), the values are converted to floats:

datasets.py:348: target_dtype = int if target_categorical[0] else float

That's fine in itself, but when doing regression experiments, we need to upload both the predicted and actual (truth) value. However, when exporting the actual value back to strings (in the arff file), precision is lost.

For instance, here are the first values of the training set of task 738 (test server):

6.1, 6.3, 5.8, 6.1, 6.0, 5.9

This is what is exported to the predictions arff file:

6.0999999 6.30000019 5.80000019 6.0999999 6.19999981 6. 5.9000001

What would be the best way to fix this? Load the data as Decimals instead of floats? Round the data before writing to arff?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions