-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-data.lisp
552 lines (452 loc) · 22.9 KB
/
test-data.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test the big data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(load #P"cl-pnn.lisp")
(in-package :cl-pnn)
(defparameter *data* (cl-csv:read-csv #P"/media/josephus/My Book/sc_atlas/data/atlas_data/atlas/e7_50_molecules_genes_transposed_r1000.tab" :separator #\Tab))
(defparameter *data* cl-user::*data*)
(makunbound cl-user::*data*)
(length *data*)
(defparameter *t* (get-row *data* 10))
(defparameter *sigma* 1)
(defparameter *anno* (cl-csv:read-csv #P"/media/josephus/My Book/sc_atlas/data/atlas_data/atlas/anno_e7_50.tab" :separator #\Tab))
(defparameter *labels* (get-column-by-header-name *anno* "celltype"))
(defparameter *labels-replaced* (replace-na *labels*))
(defparameter *result* (split-by-group-indexes *labels-replaced*))
;; split data in a stratified manner
(defparameter *split-result* (stratified-train-test-index-split *labels-replaced* :test-size 0.1))
(defparameter *train-indexes* (elt *split-result* 0))
(defparameter *test-indexes* (elt *split-result* 1))
(defparameter *categories* (elt *split-result* 2))
(defparameter *split* (elt *split-result* 3))
(length *split-result*)
;; extract train test data
(defparameter *train-data* (index-extract (cdr *data*) *train-indexes*))
(defparameter *test-data* (index-extract (cdr *data*) *test-indexes*))
(defparameter *train-labels* (index-extract *labels-replaced* *train-indexes*))
(defparameter *test-labels* (index-extract *labels-replaced* *train-indexes*))
;; extract row names
;; convert to numbers
(defparameter *train-row-names* (mapcar #'first *train-data*))
(defparameter *test-row-names* (mapcar #'first *test-data*))
(defparameter *train-matrix* (numbers-extract *train-data*))
(defparameter *test-matrix* (numbers-extract *test-data*))
(difference-square-sum (elt *train-matrix* 0) (elt *test-matrix* 0))
(gaussian-probability-density-function (elt *train-matrix* 0) (elt *test-matrix* 0) 1)
(defparameter *t1* (gaussian-probability-density-function-matrix (elt *test-matrix* 0) *train-matrix* 1))
;; split and limit data in stratified manner
(defparameter *split-limited-result* (stratified-train-test-index-split-limited *labels-replaced* :test-size 0.3 :max-n 50))
(defparameter *train-lim-indexes* (elt *split-limited-result* 0))
(defparameter *test-lim-indexes* (elt *split-limited-result* 1))
(defparameter *categories-lim* (elt *split-limited-result* 2))
(defparameter *split-lim* (elt *split-limited-result* 3))
(defparameter *train-lim-data* (index-extract (cdr *data*) *train-lim-indexes*))
(defparameter *test-lim-data* (index-extract (cdr *data*) *test-lim-indexes*))
(defparameter *train-lim-labels* (index-extract *labels-replaced* *train-lim-indexes*))
(defparameter *test-lim-labels* (index-extract *labels-replaced* *train-lim-indexes*))
;; extract row names
;; convert to numbers
(defparameter *train-lim-row-names* (mapcar #'first *train-lim-data*))
(defparameter *test-lim-row-names* (mapcar #'first *test-lim-data*))
(defparameter *train-lim-matrix* (numbers-extract *train-lim-data*))
(defparameter *test-lim-matrix* (numbers-extract *test-lim-data*))
(difference-square-sum (elt *train-lim-matrix* 0) (elt *test-lim-matrix* 0))
(gaussian-probability-density-function (elt *train-lim-matrix* 0) (elt *test-lim-matrix* 0) 1)
(defparameter *t4* (gaussian-density (elt *test-lim-matrix* 0) (head *train-lim-matrix* 9) 1))
(defparameter *t5* (mapcar (lambda (l2) (gaussian-exponent (elt *test-lim-matrix* 0) l2 *sigma*))
(head *train-lim-matrix* 9)))
(defparameter *t6* (sum-r *t5*))
(defparameter *t1* (gaussian-density (elt *test-lim-matrix* 0) (head *train-lim-matrix* 9) 1))
;; this is strange (it gives a huuuuge number)... what is correct at the end?
#|
#################
# kernel.R
#################
# D square
# @param Xa A vector describing a new observation
# @param X The training set of observation
ds <- function(Xa, X) {
value <- (X - Xa) %*% t(X - Xa)
return(as.numeric(value))
}
Xa <- c(1, 2, 3, 4, 5, 6)
X <- c(10, 10, 10, 10, 10, 10)
;; this is actually
;;;; (defun as-creal (x) (*r 1 x))
(defun ds (x-train-vec x-observed-vec)
(let ((x-train-vec (mapcar #'as-creal x-train-vec))
(x-observed-vec (mapcar #'as-creal x-observed-vec)))
(sum-r (mapcar #'*r x-train-vec x-observed-vec))))
# Exponential kernel
# @param Xa A vector describing a new observation
# @param X The training set of observation
# @param sigma The smooth parameter
pattern <- function(Xa, X, sigma) {
res <- exp( - ds(Xa, X) / (2 * sigma ^ 2) )
return(as.numeric(res))
}
(defun exponent-expression (x-train-vec x-observed-vec sigma)
(exp-r (/r (-r (ds x-train-vec x-observed-vec)) (*r 2 sigma sigma))))
;; (exp-r (/r (-r (ds (elt *tlm* 0) *xov*)) (*r 2 1 1)))
# Apply kernel over all patterns from category A
# @param Xa A vector describing a new observation
# @param X The training set of observation
# @param sigma The smooth parameter
patterns <- function(Xa, X, sigma)
apply(Xa, 1, pattern, X, sigma)
(defun exponent-over-train-matrix (x-train-matrix x-observed-vec sigma)
(mapcar (lambda (x-vec) (exponent-expression x-vec x-observed-vec sigma))
x-train-matrix))
;; (mapcar (lambda (x-vec) (head x-vec)) *tlm*)
;; (exponent-expression (elt *tlm* 0) *xov* 1)
# Sum the results of applying the kernel over all patterns
# @param X Pattern from which we have to decide a category. It is a set of measurements represented by a p-dimensional vector
# @param Xa One of the training patterns from category A
# @param sigma Smoothing parameter
fA <- function(Xa, X, sigma) {
if(missing(Xa)) stop("Xa is missing")
if(missing(X)) stop("X is missing")
if(missing(sigma)) stop("sigma is missing")
p <- length(X) # Dimensionality of measurement space # seems wrong to me!
m <- length(Xa[,1]) # Total number of training patterns from category A
f <- 1 /((2 * pi) ^ (p / 2) * sigma ^ p) / m * sum(patterns(Xa, X, sigma)) # Probability density function
return(f)
}
(defun gaussian-density (x-train-matrix x-observed-vec sigma)
(multiple-value-bind (m p) (dim x-train-matrix)
(let ((coeff (/r 1 (*r (expt-r (*r 2 +pi-r+) (/r p 2)) m))))
(sum-r (mapcar (lambda (exponent) (*r coeff exponent))
(exponent-over-train-matrix x-train-matrix x-observed-vec sigma))))))
(defparameter *tlm* (head *train-lim-matrix* 9))
(defparameter *xov* (elt *test-lim-matrix* 0))
(gaussian-density *tlm* *xov* 1) ;; this was tested
(multiple-value-bind (m p) (dim *tlm*)
(defparameter *m* m)
(defparameter *p* p))
(exponent-over-train-matrix *tlm* *xov* 1) ;; error
53 x 30 = 1590 => 1600 => (setq *PRINT-PREC* 1600)
#################
# guess-probabilities.R
#################
# Predict the probabilities of each category given X
# @param nn An already trained probabilistic neural network
# @param X Pattern from which we have to decide a category. It is a set of measurements represented by a p-dimensional vector
guess.probabilities.of.each.category <- function(nn, X) {
results <- vector()
for(category in nn$categories) {
Xa <- nn$set[nn$set[,nn$category.column] == category,]
Xa <- as.matrix(Xa[,-nn$category.column])
results <- c(results, fA(Xa, X, nn$sigma))
}
probs <- results / sum(results)
names(probs) <- nn$categories
return(probs)
}
(defun creal-to-double-float (creal-num)
"Return double float from creal representation."
(let* ((s (with-output-to-string (out)
(print-r creal-num 20 :stream out)))
(s (string-trim "." s)))
(let ((*read-default-float-format* 'double-float))
(with-input-from-string (in s)
(read in)))))
(defun predict (x-train-matrix y-train x-observed-vec sigma)
(multiple-value-bind (split-x-trains categories) (split-by-group x-train-matrix y-train)
(let* ((results (mapcar (lambda (x-train-mat)
(gaussian-density x-train-mat x-observed-vec sigma))
split-x-trains))
(total (sum-r results))
(probabilities (mapcar (lambda (x) (/r x total))
results))
(probabilities (mapcar #'creal-to-double-float probabilities)) ;; for comparison
(prob-cat-pairs (zip probabilities categories))
(sorted-prob-cat-pairs (sort (copy-seq prob-cat-pairs) #'> :key #'car))
(prediction (car sorted-prob-cat-pairs)))
(values prediction
sorted-prob-cat-pairs))))
(predict *train-lim-matrix* *train-lim-labels* (elt *test-lim-matrix* 0) 1)
(multiple-value-bind (split-x-trains categories)
(split-by-group *train-lim-matrix* *train-lim-labels*)
(mapcar (lambda (x-train-mat) (gaussian-density x-train-mat (elt *test-lim-matrix* 0) 1))
split-x-trains))
(setq *PRINT-PREC* 3000)
(multiple-value-bind (split-x-trains categories)
(split-by-group *train-lim-matrix* *train-lim-labels*)
(mapcar (lambda (x-train-mat) (gaussian-density x-train-mat (elt *test-lim-matrix* 0) 1))
split-x-trains))
;; with 3000 positions still many are below radar
;; would the numbers be smaller, then the numbers would be better
;; the sum of TPMs in different sampels always add up to the same number
;; denominator required to calculate proportions is the same
;; regardless of the sample you are looking at.
(defparameter *train-lim-matrix-tpm* (tpm-pseudo-r *train-lim-matrix*))
(defparameter *cols* (transpose *train-lim-matrix*))
(defparameter *col-totals* (mapcar (lambda (col) (reduce #'+r col)) *cols*))
(defparameter *cols-normed* (mapcar (lambda (col total)
(mapcar (lambda (x) (if (and (zerop x)
(zerop total))
0
(/r x total)))
col))
*cols* *col-totals*))
(defparameter *rows* (transpose *cols-normed*))
(defparameter *cols-rows-normed* (mapcar #'norm-list-r *rows*)) ;; works!
(defparameter *train-lim-matrix-tpm* (tpm-pseudo-r *train-lim-matrix*))
(setq *PRINT-PREC* 500) ;; actually 500 arleady good for this
(defparameter *tlm* (head *train-lim-matrix-tpm* 9))
(defparameter *xov* (elt *test-lim-matrix* 0))
(gaussian-density *tlm* *xov* 1) ;; this was tested
(setq *PRINT-PREC* 1000)
(multi-bind (*train-lim-matrix-tpm* *col-totals*) (tpm-pseudo-r *train-lim-matrix*))
(defparameter *test-lim-matrix-tpm* (tpm-pseudo-r *test-lim-matrix* *col-totals*))
(predict *train-lim-matrix-tpm* *train-lim-labels* (elt *test-lim-matrix* 0) 1)
;; zero division error
;; one has to bring rigorous rules
;; like any division by zero -> zero!
;; also a special treatment of the sparse data!
(defun any-in (x l &key (test #'eql))
(cond ((null l) nil)
((funcall test x (car l)) l)
(t (any-in x (cdr l) :test test))))
(defun //r (x &rest rest)
(if (any-in 0 rest)
0
(/r )))
################
# guess.r
################
#' Guess
#'
#' Infers the category of a new observation.
#'
#' Given an already trained and smoothed Probabilistic neural network, the function \code{guess} gives the category with the highest probability, and the probabilities of each category.
#'
#' @param nn A trained and smoothed Probabilistic neural network.
#' @param X A vector describing a new observation.
#'
#' @seealso \code{\link{pnn-package}}, \code{\link{learn}}, \code{\link{smooth}}, \code{\link{perf}}, \code{\link{norms}}
#'
#' @return A \code{list} of the guessed category and the probabilities of each category.
#'
#' @examples
#' library(pnn)
#' data(norms)
#' pnn <- learn(norms)
#' pnn <- smooth(pnn, sigma=0.8)
#' guess(pnn, c(1,1))
#' guess(pnn, c(1,1))$category
#' guess(pnn, c(1,1))$probabilities
#' guess(pnn, c(2,1))
#' guess(pnn, c(1.5,1))
#' @export
guess <- function(nn, X) {
X <- matrix(X, ncol=nn$k)
probs <- guess.probabilities.of.each.category(nn, X)
if(is.na(probs[1])) return(NA)
category <- names(probs[probs == max(probs)])
results <- list(category=category, probabilities=probs)
return(results)
}
|#
;; at least test with small data
#|
(defparameter *dstring*
"
row sepal_length sepal_width petal_length petal_width
0 5.1 3.5 1.4 0.2
1 4.9 3.0 1.4 0.2
2 4.7 3.2 1.3 0.2
3 4.6 3.1 1.5 0.2
4 5.0 3.6 1.4 0.2
5 5.4 3.9 1.7 0.4
6 4.6 3.4 1.4 0.3
7 5.0 3.4 1.5 0.2
8 4.4 2.9 1.4 0.2
9 4.9 3.1 1.5 0.1
10 5.4 3.7 1.5 0.2
11 4.8 3.4 1.6 0.2
12 4.8 3.0 1.4 0.1
13 4.3 3.0 1.1 0.1
14 5.8 4.0 1.2 0.2
15 5.7 4.4 1.5 0.4
16 5.4 3.9 1.3 0.4
17 5.1 3.5 1.4 0.3
18 5.7 3.8 1.7 0.3
19 5.1 3.8 1.5 0.3
20 5.4 3.4 1.7 0.2
21 5.1 3.7 1.5 0.4
22 4.6 3.6 1.0 0.2
23 5.1 3.3 1.7 0.5
24 4.8 3.4 1.9 0.2
25 5.0 3.0 1.6 0.2
26 5.0 3.4 1.6 0.4
27 5.2 3.5 1.5 0.2
28 5.2 3.4 1.4 0.2
29 4.7 3.2 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3.2 5.9 2.3
144 6.7 3.3 5.7 2.5
145 6.7 3.0 5.2 2.3
146 6.3 2.5 5.0 1.9
147 6.5 3.0 5.2 2.0
148 6.2 3.4 5.4 2.3
149 5.9 3.0 5.1 1.8
")
(defun remove-header-row-names (mat)
(let* ((row-names (cdr (mapcar #'first mat)))
(header (elt mat 0))
(matrix (mapcar #'cdr (cdr mat))))
(values matrix header row-names)))
(defparameter *iris* (parse-whitespace-delimited-string *dstring*))
(defparameter *iris-label* '(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2))
(multi-bind (*iris-matrix* *iris-header* *iris-rownames*)
(remove-header-row-names *iris*))
(defparameter *obs* '(5.9 3.0 5.1 1.8)) ;; should be 2
(defparameter *y-iris* (mapcar (lambda (x) (format nil "~A" x))
*iris-label*)) ;; as strings
;; (general-stratified-train-test-split-indexes *y-iris* :test-size 0.1)
(multi-bind-destructuring (*train-matrix-iris*
*test-matrix-iris*
*train-labels-iris*
*test-labels-iris*
*train-indexes-iris*
*test-indexes-iris*
*dumped-indexes-iris*
*categories-iris*
*split-iris*
*max-n-iris*
*train-row-names-iris*
*test-row-names-iris*
*header-iris*)
(general-stratified-train-test-split-from-named-matrix *iris* *y-iris*
:test-size 0.1))
;; *test-labels-iris*
;; ("0" "0" "0" "0" "0" "1" "1" "1" "1" "1" "2" "2" "2" "2" "2")
(predict *train-matrix-iris* *train-labels-iris* (elt *test-matrix-iris* 0) 1)
(predict *train-matrix-iris* *train-labels-iris* (elt *test-matrix-iris* 1) 1)
(predict *train-matrix-iris* *train-labels-iris* (elt *test-matrix-iris* 8) 1)
(predict *train-matrix-iris* *train-labels-iris* (elt *test-matrix-iris* 13) (as-creal 0.1))
;; it brings worse problems ... horrible ...
;; but maybe probabilistic neural network is in the last step
;; that thing what could make the last inch ...
;; after hefty pruning of features using the visualization with CNN ...
|#