   (use-connection
     (if @ids-inst
       (let [train (count (:train (:train-test @ids-inst)))
-            test (count (:test (:train-test @ids-inst)))]
+            test (count (:test (:train-test @ids-inst)))
+            total (+ train test)]
         {:train train
          :test test
-         :split (double (/ train (+ train test)))}))))
+         :split (if (= 0 total)
+                  0.0
+                  (double (/ train total)))}))))
 
 (defn- id-info []
   {:train (ids :set-type :train)

  ([id instance class-label set-type]
   (log/infof "loading instance (%s): %s => <%s>"
               id class-label
               (let [s (pr-str instance)]
                 (subs s 0 (min 80 (count s)))))
   (log/debugf "instance: %s" instance)
   (use-connection
     (with-context [instance-context]
       (let [doc (merge {:dataset {:class-label class-label
                                   :instance instance}}
                        (if set-type {:set-type set-type}))
             res (if id
                   (es/put-document id doc)

                     (merge {:train-test (compute-folds data)})
                     (persist-id-state))))))
    (stats)))

(defn divide-by-preset
  "Divide the data into test and training *buckets*.  The respective train/test
