newral 0.11 → 0.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf672d40895fe65b38d8c889a7097d917e2cee5d
|
4
|
+
data.tar.gz: 48485e1ae8a01a21872faabfeb1ba37dc4bb9c60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 959edca123d309747764650211098e93426f4b718fb87e4fa0c6060e47ec4e6332299c2c9cea7586e8901fd600cfef1bb5a17240d25ce1ff0100d51a4d01a7a8
|
7
|
+
data.tar.gz: 7af4b2733bf287fa4efb3ddd9ce7e7641cc7bbe076c8c30eaa563a166b6ced77e9a958028031fcfa22b5d52f2beaeb7a0c3c87ccd5dfa55a4af1153470131743
|
@@ -46,7 +46,9 @@ module Newral
|
|
46
46
|
end
|
47
47
|
end.flatten
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
|
+
# a dendogram can produce very nested node sets, so you can also
|
51
|
+
# flatten them by converting them to a cluster
|
50
52
|
def to_cluster
|
51
53
|
points = flatten_points
|
52
54
|
Data::Cluster.new( points: points.collect{|p| p.to_a } )
|
data/lib/newral/data/idx.rb
CHANGED
@@ -5,6 +5,8 @@ module Newral
|
|
5
5
|
end
|
6
6
|
attr_reader :calculate_block
|
7
7
|
# as its ruby we of course have to also offer the possibility for blocks
|
8
|
+
# the block is called in calculate, always passing the current @params values
|
9
|
+
# however for more complex examples you should rather derive from Base
|
8
10
|
class Block < Base
|
9
11
|
|
10
12
|
def initialize( directions:0, params:[], &block )
|
@@ -19,7 +21,7 @@ module Newral
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def move( direction: 0, step:0.01, step_percentage: nil )
|
22
|
-
raise Errors::InvalidDirection unless direction
|
24
|
+
raise Errors::InvalidDirection unless direction >=0 && direction<@directions
|
23
25
|
@params[direction]=(step_percentage ? @params[direction]*(1+step_percentage.to_f/100) : @params[direction]+step )
|
24
26
|
self
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newral
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stefan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|