Skip to content

Commit eb1f4bc

Browse files
committed
bigml.sample => bigml.sampling
1 parent 9703e92 commit eb1f4bc

15 files changed

+40
-40
lines changed

project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
(defproject sample "2.1.0"
1+
(defproject sampling "2.1.0"
22
:description "Random Sampling in Clojure"
3-
:url "https://github.com/bigmlcom/sample"
3+
:url "https://github.com/bigmlcom/sampling"
44
:license {:name "Apache License, Version 2.0"
55
:url "http://www.apache.org/licenses/LICENSE-2.0"}
66
:dependencies [[org.clojure/clojure "1.4.0"]
77
[incanter/parallelcolt "0.9.4"]
88
[org.clojure/data.finger-tree "0.0.1"]]
9-
:aot [bigml.sample.reservoir.mergeable])
9+
:aot [bigml.sampling.reservoir.mergeable])

src/bigml/sample/occurrence.clj renamed to src/bigml/sampling/occurrence.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.occurrence
5+
(ns bigml.sampling.occurrence
66
"Provides functions for computing the number of occurrences to be
77
expected for an item in a population when sampled with
88
replacement."
99
(:import (cern.jet.math.tdouble DoubleArithmetic))
10-
(:require (bigml.sample [random :as random])))
10+
(:require (bigml.sampling [random :as random])))
1111

1212
(def default-probability-cutoff
1313
"The cumulative-probabilities fn will stop calculating occurrence

src/bigml/sample/random.clj renamed to src/bigml/sampling/random.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.random
5+
(ns bigml.sampling.random
66
"Functions for creating and using a random number generator."
77
(:import (cern.jet.random.tdouble.engine MersenneTwister64)
88
(java.util Random)))

src/bigml/sample/reservoir.clj renamed to src/bigml/sampling/reservoir.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.reservoir
5+
(ns bigml.sampling.reservoir
66
"Provides random sampling using reservoirs. This is useful when the
77
original population can't be kept in memory but the sample set
88
can."
9-
(:require (bigml.sample.reservoir [efraimidis :as efraimidis]
10-
[insertion :as insertion]))
11-
(:import (bigml.sample.reservoir.mergeable MergeableReservoir))
9+
(:require (bigml.sampling.reservoir [efraimidis :as efraimidis]
10+
[insertion :as insertion]))
11+
(:import (bigml.sampling.reservoir.mergeable MergeableReservoir))
1212
(:refer-clojure :exclude [merge]))
1313

1414
(def ^:private implementations

src/bigml/sample/reservoir/efraimidis.clj renamed to src/bigml/sampling/reservoir/efraimidis.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.reservoir.efraimidis
5+
(ns bigml.sampling.reservoir.efraimidis
66
"Provides weighted random sampling using reservoirs as described by
77
Efraimidis and Spirakis.
88
http://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf"
9-
(:require (bigml.sample [random :as random]
10-
[util :as util])
9+
(:require (bigml.sampling [random :as random]
10+
[util :as util])
1111
(clojure.data [finger-tree :as tree]))
12-
(:import (bigml.sample.reservoir.mergeable MergeableReservoir)))
12+
(:import (bigml.sampling.reservoir.mergeable MergeableReservoir)))
1313

1414
(def ^:private compare-k
1515
#(compare (:k %1) (:k %2)))

src/bigml/sample/reservoir/insertion.clj renamed to src/bigml/sampling/reservoir/insertion.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.reservoir.insertion
5+
(ns bigml.sampling.reservoir.insertion
66
"Provides random sampling using reservoirs. Uses an insertion
77
method that might originally be from Chao's 'A general purpose
88
unequal probability sampling plan'. It's behind a paywall,
99
however, so that remains a mystery to me."
10-
(:require (bigml.sample [simple :as simple]
11-
[random :as random]
12-
[occurrence :as occurrence]))
13-
(:import (bigml.sample.reservoir.mergeable MergeableReservoir)))
10+
(:require (bigml.sampling [simple :as simple]
11+
[random :as random]
12+
[occurrence :as occurrence]))
13+
(:import (bigml.sampling.reservoir.mergeable MergeableReservoir)))
1414

1515
(defmulti ^:private insert
1616
(fn [reservoir _]

src/bigml/sample/reservoir/mergeable.clj renamed to src/bigml/sampling/reservoir/mergeable.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.reservoir.mergeable
5+
(ns bigml.sampling.reservoir.mergeable
66
"Provides the definition for mergeable reservoirs.")
77

88
(defprotocol MergeableReservoir

src/bigml/sample/simple.clj renamed to src/bigml/sampling/simple.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.simple
5+
(ns bigml.sampling.simple
66
"Provides simple random sampling. The original population is kept in
77
memory but the resulting sample set is produced as a lazy
88
sequence."
9-
(:require (bigml.sample [random :as random]
10-
[util :as util])))
9+
(:require (bigml.sampling [random :as random]
10+
[util :as util])))
1111

1212
(defn- with-replacement [coll rnd]
1313
(when-not (empty? coll)

src/bigml/sample/stream.clj renamed to src/bigml/sampling/stream.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.stream
5+
(ns bigml.sampling.stream
66
"Provides streaming sampling. Neither the input population or the
77
resulting sample are kept in memory. The order of the sample is
88
not randomized, but will be in the order of the input population."
9-
(:require (bigml.sample [random :as random]
10-
[occurrence :as occurrence])))
9+
(:require (bigml.sampling [random :as random]
10+
[occurrence :as occurrence])))
1111

1212
(defn- rate-distribution [sample-size pop-size]
1313
(apply sorted-map

src/bigml/sample/util.clj renamed to src/bigml/sampling/util.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.util
5+
(ns bigml.sampling.util
66
"Provides utility functions.")
77

88
(defn validated-weigh

test/bigml/sample/test/occurrence.clj renamed to test/bigml/sampling/test/occurrence.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.test.occurrence
5+
(ns bigml.sampling.test.occurrence
66
(:use clojure.test)
7-
(:require (bigml.sample [occurrence :as occurrence])))
7+
(:require (bigml.sampling [occurrence :as occurrence])))
88

99
(def big-result
1010
1498231660179642550080525374062985229379154060073454416056804436265250417504978421344703666672011193783194306251922106632531575096104465752579970958417306283423558722428981480592122380206679550814874547016793880384420005011964284022150602938812288536154567998961655336231440060094535026560416077739589623596000N)

test/bigml/sample/test/reservoir.clj renamed to test/bigml/sampling/test/reservoir.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.test.reservoir
5+
(ns bigml.sampling.test.reservoir
66
(:use clojure.test
7-
bigml.sample.test.util)
8-
(:require (bigml.sample [reservoir :as reservoir])))
7+
bigml.sampling.test.util)
8+
(:require (bigml.sampling [reservoir :as reservoir])))
99

1010
(deftest sample
1111
(is (about-eq (reduce + (reservoir/sample (range 1000) 500))

test/bigml/sample/test/simple.clj renamed to test/bigml/sampling/test/simple.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.test.simple
5+
(ns bigml.sampling.test.simple
66
(:use clojure.test
7-
bigml.sample.test.util)
8-
(:require (bigml.sample [simple :as simple]
9-
[random :as random])))
7+
bigml.sampling.test.util)
8+
(:require (bigml.sampling [simple :as simple]
9+
[random :as random])))
1010

1111
(deftest sample
1212
(is (about-eq (reduce + (take 500 (simple/sample (range 1000))))

test/bigml/sample/test/stream.clj renamed to test/bigml/sampling/test/stream.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.test.stream
5+
(ns bigml.sampling.test.stream
66
(:use clojure.test
7-
bigml.sample.test.util)
8-
(:require (bigml.sample [stream :as stream])))
7+
bigml.sampling.test.util)
8+
(:require (bigml.sampling [stream :as stream])))
99

1010
(deftest sample
1111
(is (about-eq (reduce + (stream/sample (range 1000) 500 1000))

test/bigml/sample/test/util.clj renamed to test/bigml/sampling/test/util.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Licensed under the Apache License, Version 2.0
33
;; http://www.apache.org/licenses/LICENSE-2.0
44

5-
(ns bigml.sample.test.util)
5+
(ns bigml.sampling.test.util)
66

77
(defn about-eq
88
"Returns true if the absolute value of the difference

0 commit comments

Comments
 (0)