                         (take 7
                           (sort-by (comp - second) user-vote-counts)))
                       in-conv)))
-                         })
+  ; End of base conv update
+  })
+
+
+(defn max-k-fn
+  [data max-max-k]
+  (min max-max-k
+    (max 2
+      (int (/ (count (rownames data)) 3)))))
 
 
 (def small-conv-update-graph

                          :pca-iters 10
                          :base-iters 10
                          :base-k 50
                          :group-iters 10}
                    opts))


                      pca          ((partial-pca mat pca rand-indices) pca)]
                  (if (= iter 0)
                    (recur pca (dec iter))
                    pca))))))}))


(def small-conv-update (graph/eager-compile small-conv-update-graph))
