From 4f26aa50878104ecb97dda04294ef212be937357 Mon Sep 17 00:00:00 2001 From: Shashir Reddy Date: Sun, 23 Mar 2014 23:02:34 -0700 Subject: [PATCH] Gets rounded values for discrete features. shared.Instance#getDiscrete(int i) should not flatten double-valued features. Rounding is more appropriate. --- .gitignore | 1 + src/shared/Instance.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b95ddf71..4c17f0a1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ ABAGAIL.jar *.war *.ear manifest.mf +/bin diff --git a/src/shared/Instance.java b/src/shared/Instance.java index 1380a967..839cf7ef 100644 --- a/src/shared/Instance.java +++ b/src/shared/Instance.java @@ -151,7 +151,7 @@ public double getContinuous(int i) { * @return the value */ public int getDiscrete(int i) { - return (int) data.get(i); + return (int) Math.round(data.get(i)); } /**