Permalink
Browse files

bigml.sample => bigml.sampling

  • Loading branch information...
1 parent 9703e92 commit eb1f4bcf320a252485ad525acd4b6ff02a44d4df @ashenfad ashenfad committed Jan 2, 2013
View
6 project.clj
@@ -1,9 +1,9 @@
-(defproject sample "2.1.0"
+(defproject sampling "2.1.0"
:description "Random Sampling in Clojure"
- :url "https://github.com/bigmlcom/sample"
+ :url "https://github.com/bigmlcom/sampling"
:license {:name "Apache License, Version 2.0"
:url "http://www.apache.org/licenses/LICENSE-2.0"}
:dependencies [[org.clojure/clojure "1.4.0"]
[incanter/parallelcolt "0.9.4"]
[org.clojure/data.finger-tree "0.0.1"]]
- :aot [bigml.sample.reservoir.mergeable])
+ :aot [bigml.sampling.reservoir.mergeable])
View
4 src/bigml/sample/occurrence.clj → src/bigml/sampling/occurrence.clj
@@ -2,12 +2,12 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.occurrence
+(ns bigml.sampling.occurrence
"Provides functions for computing the number of occurrences to be
expected for an item in a population when sampled with
replacement."
(:import (cern.jet.math.tdouble DoubleArithmetic))
- (:require (bigml.sample [random :as random])))
+ (:require (bigml.sampling [random :as random])))
(def default-probability-cutoff
"The cumulative-probabilities fn will stop calculating occurrence
View
2 src/bigml/sample/random.clj → src/bigml/sampling/random.clj
@@ -2,7 +2,7 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.random
+(ns bigml.sampling.random
"Functions for creating and using a random number generator."
(:import (cern.jet.random.tdouble.engine MersenneTwister64)
(java.util Random)))
View
8 src/bigml/sample/reservoir.clj → src/bigml/sampling/reservoir.clj
@@ -2,13 +2,13 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.reservoir
+(ns bigml.sampling.reservoir
"Provides random sampling using reservoirs. This is useful when the
original population can't be kept in memory but the sample set
can."
- (:require (bigml.sample.reservoir [efraimidis :as efraimidis]
- [insertion :as insertion]))
- (:import (bigml.sample.reservoir.mergeable MergeableReservoir))
+ (:require (bigml.sampling.reservoir [efraimidis :as efraimidis]
+ [insertion :as insertion]))
+ (:import (bigml.sampling.reservoir.mergeable MergeableReservoir))
(:refer-clojure :exclude [merge]))
(def ^:private implementations
View
8 src/bigml/sample/reservoir/efraimidis.clj → src/bigml/sampling/reservoir/efraimidis.clj
@@ -2,14 +2,14 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.reservoir.efraimidis
+(ns bigml.sampling.reservoir.efraimidis
"Provides weighted random sampling using reservoirs as described by
Efraimidis and Spirakis.
http://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf"
- (:require (bigml.sample [random :as random]
- [util :as util])
+ (:require (bigml.sampling [random :as random]
+ [util :as util])
(clojure.data [finger-tree :as tree]))
- (:import (bigml.sample.reservoir.mergeable MergeableReservoir)))
+ (:import (bigml.sampling.reservoir.mergeable MergeableReservoir)))
(def ^:private compare-k
#(compare (:k %1) (:k %2)))
View
10 src/bigml/sample/reservoir/insertion.clj → src/bigml/sampling/reservoir/insertion.clj
@@ -2,15 +2,15 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.reservoir.insertion
+(ns bigml.sampling.reservoir.insertion
"Provides random sampling using reservoirs. Uses an insertion
method that might originally be from Chao's 'A general purpose
unequal probability sampling plan'. It's behind a paywall,
however, so that remains a mystery to me."
- (:require (bigml.sample [simple :as simple]
- [random :as random]
- [occurrence :as occurrence]))
- (:import (bigml.sample.reservoir.mergeable MergeableReservoir)))
+ (:require (bigml.sampling [simple :as simple]
+ [random :as random]
+ [occurrence :as occurrence]))
+ (:import (bigml.sampling.reservoir.mergeable MergeableReservoir)))
(defmulti ^:private insert
(fn [reservoir _]
View
2 src/bigml/sample/reservoir/mergeable.clj → src/bigml/sampling/reservoir/mergeable.clj
@@ -2,7 +2,7 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.reservoir.mergeable
+(ns bigml.sampling.reservoir.mergeable
"Provides the definition for mergeable reservoirs.")
(defprotocol MergeableReservoir
View
6 src/bigml/sample/simple.clj → src/bigml/sampling/simple.clj
@@ -2,12 +2,12 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.simple
+(ns bigml.sampling.simple
"Provides simple random sampling. The original population is kept in
memory but the resulting sample set is produced as a lazy
sequence."
- (:require (bigml.sample [random :as random]
- [util :as util])))
+ (:require (bigml.sampling [random :as random]
+ [util :as util])))
(defn- with-replacement [coll rnd]
(when-not (empty? coll)
View
6 src/bigml/sample/stream.clj → src/bigml/sampling/stream.clj
@@ -2,12 +2,12 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.stream
+(ns bigml.sampling.stream
"Provides streaming sampling. Neither the input population or the
resulting sample are kept in memory. The order of the sample is
not randomized, but will be in the order of the input population."
- (:require (bigml.sample [random :as random]
- [occurrence :as occurrence])))
+ (:require (bigml.sampling [random :as random]
+ [occurrence :as occurrence])))
(defn- rate-distribution [sample-size pop-size]
(apply sorted-map
View
2 src/bigml/sample/util.clj → src/bigml/sampling/util.clj
@@ -2,7 +2,7 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.util
+(ns bigml.sampling.util
"Provides utility functions.")
(defn validated-weigh
View
4 test/bigml/sample/test/occurrence.clj → test/bigml/sampling/test/occurrence.clj
@@ -2,9 +2,9 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.test.occurrence
+(ns bigml.sampling.test.occurrence
(:use clojure.test)
- (:require (bigml.sample [occurrence :as occurrence])))
+ (:require (bigml.sampling [occurrence :as occurrence])))
(def big-result
1498231660179642550080525374062985229379154060073454416056804436265250417504978421344703666672011193783194306251922106632531575096104465752579970958417306283423558722428981480592122380206679550814874547016793880384420005011964284022150602938812288536154567998961655336231440060094535026560416077739589623596000N)
View
6 test/bigml/sample/test/reservoir.clj → test/bigml/sampling/test/reservoir.clj
@@ -2,10 +2,10 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.test.reservoir
+(ns bigml.sampling.test.reservoir
(:use clojure.test
- bigml.sample.test.util)
- (:require (bigml.sample [reservoir :as reservoir])))
+ bigml.sampling.test.util)
+ (:require (bigml.sampling [reservoir :as reservoir])))
(deftest sample
(is (about-eq (reduce + (reservoir/sample (range 1000) 500))
View
8 test/bigml/sample/test/simple.clj → test/bigml/sampling/test/simple.clj
@@ -2,11 +2,11 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.test.simple
+(ns bigml.sampling.test.simple
(:use clojure.test
- bigml.sample.test.util)
- (:require (bigml.sample [simple :as simple]
- [random :as random])))
+ bigml.sampling.test.util)
+ (:require (bigml.sampling [simple :as simple]
+ [random :as random])))
(deftest sample
(is (about-eq (reduce + (take 500 (simple/sample (range 1000))))
View
6 test/bigml/sample/test/stream.clj → test/bigml/sampling/test/stream.clj
@@ -2,10 +2,10 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.test.stream
+(ns bigml.sampling.test.stream
(:use clojure.test
- bigml.sample.test.util)
- (:require (bigml.sample [stream :as stream])))
+ bigml.sampling.test.util)
+ (:require (bigml.sampling [stream :as stream])))
(deftest sample
(is (about-eq (reduce + (stream/sample (range 1000) 500 1000))
View
2 test/bigml/sample/test/util.clj → test/bigml/sampling/test/util.clj
@@ -2,7 +2,7 @@
;; Licensed under the Apache License, Version 2.0
;; http://www.apache.org/licenses/LICENSE-2.0
-(ns bigml.sample.test.util)
+(ns bigml.sampling.test.util)
(defn about-eq
"Returns true if the absolute value of the difference

0 comments on commit eb1f4bc

Please sign in to comment.