From ef7b0311351fb1b44943ed62a102dea937fb1dc8 Mon Sep 17 00:00:00 2001 From: Kevin Normoyle Date: Thu, 25 Jul 2013 22:19:40 -0700 Subject: [PATCH] reorder a constant/missing comparison --- py/h2o_glm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/py/h2o_glm.py b/py/h2o_glm.py index 0955406fcd..9808d1db10 100644 --- a/py/h2o_glm.py +++ b/py/h2o_glm.py @@ -326,12 +326,7 @@ def goodXFromColumnInfo(y, x.remove(k) ignore_x.append(k) - elif k in constantValuesDict: - value = constantValuesDict[k] - print "Removing %d with name: %s because it has constant value: %s " % (k, name, str(value)) - x.remove(k) - ignore_x.append(k) - + # missing values reports as constant also. so do missing first. # remove all cols with missing values # could change it against num_rows for a ratio elif k in missingValuesDict: @@ -340,6 +335,12 @@ def goodXFromColumnInfo(y, x.remove(k) ignore_x.append(k) + elif k in constantValuesDict: + value = constantValuesDict[k] + print "Removing %d with name: %s because it has constant value: %s " % (k, name, str(value)) + x.remove(k) + ignore_x.append(k) + # this is extra pruning.. # remove all cols with enums, if not already removed elif k in enumSizeDict: