Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am clyce on github.
  • I am clyce (https://keybase.io/clyce) on keybase.
  • I have a public key ASAK0kz8GOOLQjHRsWXCBqgfJyLi69VjK_JKV2xBcn1abwo

To claim this, I am signing this object:

# Edited based on Scikit-learn
"""Affinity Propagation clustering algorithm."""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
(require '[clojure.core.matrix :refer :all])
(set-current-implementation :vectorz)
(defn euclidien-sqr [x y]
(-
(apply +
(map #(* % %)
(sub! (array x) (array y))))))
(def test-vec
[{:age 14 :gender :female}
{:age 15 :gender :male}
{:age 17 :gender :female}
{:age 13 :gender :male}])
(def test-vec-2
[{:age 12 :gender :female}
{:age 18 :gender :male}
{:age 23 :gender :female}
@clyce
clyce / temp modify
Last active August 29, 2015 14:04
temp
(ns mora.main (:gen-class)
(require [org.httpkit.client :as http]
[monger.core :as mg]
[monger.collection :as mc]
[monger.query :as mq]
[monger.operators :refer :all]
[net.cgrand.enlive-html :as html]
[digest]
[clojure.pprint])
(:import org.bson.types.ObjectId
@clyce
clyce / rectangle
Last active December 21, 2015 05:18
(def ^:dynamic *current-canvas* nil)
(def key-pressed-count (atom 0))
(defn tick-and-bloom
[interval
[init-bloom-value f-on-bloom-in-every-tick]
[reset-pred & t-args]]
(fn [f]
(loop [to-bloom init-value]
@clyce
clyce / temp
Last active December 20, 2015 15:39
(declare S U V Q)
(defn S [x] ;Start Status
(case x :a U :b V))
(defn U [x]
(case x :a Q :b V))
(defn V [x]
(case x :a U :b Q))