]> gitweb.factorcode.org Git - factor.git/blob - extra/machine-learning/rebalancing/rebalancing-tests.factor
bc02dcec87b7a5bb4ce7bbab56283ee442316605
[factor.git] / extra / machine-learning / rebalancing / rebalancing-tests.factor
1 ! Copyright (C) 2012 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs kernel machine-learning.rebalancing math
4 math.statistics math.text.english sequences tools.test
5 math.vectors ;
6 IN: machine-learning.rebalancing.tests
7
8 [ t ] [
9     { 1 1 1 2 } [ [ number>text ] map ] [ ] bi
10     100,000 balance-labels nip
11     histogram values first2 - abs 3,000 <
12 ] unit-test
13
14
15 [ t ] [
16     { 1 1 1 2 } [ [ number>text ] map ] [ ] bi
17     { 1/10 9/10 } 100,000 skew-labels nip
18     histogram values { 10,000 90,000 } -.05 v~
19 ] unit-test