Skip to content

Commit c34cc7a

Browse files
authored
Merge pull request #52 from andersvi/master
typo :external-format - lispworks
2 parents a80147e + 1d3a144 commit c34cc7a

File tree

8 files changed

+24
-32
lines changed

8 files changed

+24
-32
lines changed

clustering/misc/k-means-bench.lisp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
(time (k-means 20 dataset
1010
:distance-fn #'manhattan-distance
1111
:max-iteration 100
12-
:random-state (k-means::make-random-state-with-seed 3)
12+
:random-state
13+
#+lispworks *random-state*
14+
#-lispworks (clml.hjs.k-means:make-random-state-with-seed 0)
1315
:standardization t))
1416

1517

test/src/test-changefinder.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
:external-format :utf-8)
1414
:except '(0) :time-label 0)))
1515
(assert-equality #'= 1015 (length (ts-points ts)))
16-
#- allegro (assert (setf cf (init-changefinder (sub-ts ts :start 0 :end 24)
16+
#- (or allegro lispworks) (assert (setf cf (init-changefinder (sub-ts ts :start 0 :end 24)
1717
:score-type :log
1818
:ts-wsize 5 :score-wsize 5 :sdar-k 4
1919
:discount 0.005d0)))
20-
#- allegro (mapcar (lambda (v1 v2) (assert-equality #'epsilon> v2 v1))
20+
#- (or allegro lispworks) (mapcar (lambda (v1 v2) (assert-equality #'epsilon> v2 v1))
2121
(loop for p across (ts-points (sub-ts ts :start 600 :end 700))
2222
as new-dvec = (ts-p-pos p)
2323
collect (update-changefinder cf new-dvec))

test/src/test-cluster-validation.lisp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
:except '(0) :data-types (make-list 4
1717
:initial-element :numeric))
1818
:random-state
19-
(clml.hjs.k-means:make-random-state-with-seed 0))))
19+
#+lispworks *random-state*
20+
#-lispworks (clml.hjs.k-means:make-random-state-with-seed 0))))
2021
(print (list (calinski) 441.62300853729414))
2122
(assert-true (epsilon> (calinski)
22-
#+ (or lispworks) 441.62300853729414
23-
#- (or lispworks) 441.8562453167574d0))
23+
441.8562453167574d0 ))
2424
(print (list (hartigan) (ball-and-hall) (dunn-index :distance :euclid
2525
:intercluster :hausdorff
2626
:intracluster :centroid)
@@ -30,21 +30,21 @@
3030
(global-silhouette-value :distance :euclid)
3131
))
3232
(assert-true (epsilon> (hartigan)
33-
#+ (or lispworks) 2.5069376578154543
34-
#- (or lispworks) 2.5074656538807005d0))
33+
2.5074656538807005d0
34+
))
3535
(assert-true (epsilon> (ball-and-hall)
36-
#+ (or lispworks) 1128.3210196476964
37-
#- (or lispworks) 1127.7702976190476d0))
36+
1127.7702976190476d0
37+
))
3838
(assert-true (epsilon> (dunn-index :distance :euclid
3939
:intercluster :hausdorff
4040
:intracluster :centroid)
41-
#+ (or lispworks) 1.218510772099368
42-
#- (or lispworks) 1.2576613811360222d0))
41+
1.2576613811360222d0
42+
))
4343
(assert-true (epsilon> (davies-bouldin-index :distance :euclid
4444
:intercluster :average
4545
:intracluster :complete)
46-
#+ (or lispworks) 1.8817487113136586
47-
#- (or lispworks) 1.899415427296523d0))
46+
1.899415427296523d0
47+
))
4848
(assert-true (epsilon> (global-silhouette-value :distance :euclid)
49-
#+ (or lispworks) 0.5793276055727323
50-
#- (or lispworks) 0.5786560352400679d0 ))))
49+
0.5786560352400679d0
50+
))))

test/src/test-hc.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
(assert-equalp #2A((-5 -1) (-4 -2) (2 0) (-6 1) (-3 3) (4 5)) merge-matrix)
2626
;;complete
2727
(multiple-value-setq (cophenetic-matrix merge-matrix) (cophenetic-matrix d-matrix #'hc-complete))
28-
(assert-eql 91.53141537199127d0 (aref cophenetic-matrix 0 1))
28+
(assert-eql #+lispworks 91.53141537199125D0 #-lispworks 91.53141537199127d0 (aref cophenetic-matrix 0 1))
2929
(assert-equalp #2A((-5 -1) (-4 -2) (2 0) (-6 1) (-3 3) (4 5)) merge-matrix)
3030
;;centroid
3131
(multiple-value-setq (cophenetic-matrix merge-matrix) (cophenetic-matrix d-matrix #'hc-centroid))
32-
(assert-eql 44.02758328256393d0 (aref cophenetic-matrix 0 1))
32+
(assert-eql #+lispworks 44.02758328256392D0 #-lispworks 44.02758328256393d0 (aref cophenetic-matrix 0 1))
3333
(assert-equalp #2A((-5 -1) (-4 -2) (2 0) (-6 1) (-3 3) (4 5)) merge-matrix)
3434
;;median
3535
(multiple-value-setq (cophenetic-matrix merge-matrix) (cophenetic-matrix d-matrix #'hc-median))

test/src/test-k-means.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(define-test test-sample-k-means
55
(let (dataset centroids result)
66
(assert
7-
(setf dataset (read-data-from-file (clml.utility.data:fetch "https://mmaul.github.io/clml.data/sample/pos.sexp") :external-format #+allegro :932 #+sbcl :sjis #+ccl :Windows-31j #+lispworks :sjisj)))
7+
(setf dataset (read-data-from-file (clml.utility.data:fetch "https://mmaul.github.io/clml.data/sample/pos.sexp") :external-format #+allegro :932 #+sbcl :sjis #+ccl :Windows-31j #+lispworks :sjis)))
88
(assert
99
(setf dataset
1010
(pick-and-specialize-data dataset :range '(2 3) :data-types '(:numeric :numeric))))

test/src/test-optics.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
(assert-true
66
(optics (clml.utility.data:fetch "https://mmaul.github.io/clml.data/sample/syobu.csv") 10 2 10 '("がく長" "がく幅" "花びら長" "花びら幅")
77
:file-type :csv :csv-type-spec '(string integer integer integer integer)
8-
:distance :manhattan :external-format #+allegro :932 #+sbcl :sjis #+ccl :Windows-31j)))
8+
:distance :manhattan :external-format #+lispworks :sjis #+allegro :932 #+sbcl :sjis #+ccl :Windows-31j)))

test/src/test-som.lisp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
(do-som-by-filename (clml.utility.data:fetch "https://mmaul.github.io/clml.data/sample/som/animal.dat") "hexa" "gaussian"
1919
24 16 123 10000 5 2400 10
2020
'(:absolute #+unix "tmp" #+mswindows "temp")))
21-
#+ (or sbcl ccl allegro)
21+
;; #+ (or sbcl ccl allegro)
22+
#+ (or sbcl ccl allegro lispworks)
2223
(assert-true (string= (concatenate 'string
2324
(format nil "~%in-data-file [~s]~%" (clml.utility.data:fetch "https://mmaul.github.io/clml.data/sample/som/animal.dat"))
2425
(format nil "s-topol[hexa] s-neigh[gaussian] xdim[24] ydim[16] nrand[123]~%")

test/src/test-ts-burst-detection.lisp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@
4141
(with-output-to-string (s str)
4242
(print-burst-indices bi :stream s))
4343
str)
44-
#+ lispworks " 0.0 |
45-
410.0 |+
46-
450.0 |++
47-
565.0 |+++
48-
570.0 |+
49-
600.0 |
50-
710.0 |+
51-
780.0 |
52-
1000.0 |
53-
"
54-
#+ (not lispworks)
5544
" 0.0d0 |
5645
410.0d0 |+
5746
450.0d0 |++

0 commit comments

Comments
 (0)