data_prep 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
data/data_prep.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{data_prep}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["reddavis"]
data/lib/data_prep.rb CHANGED
@@ -14,7 +14,7 @@ class DataPrep
14
14
  def inject_outputs(data)
15
15
  @data = []
16
16
  data.each_pair do |output, data|
17
- @data << data.map! {|x| [x, [output]]}
17
+ @data << data.map! {|x| [x, [output].flatten]}
18
18
  end
19
19
  end
20
20
 
@@ -23,7 +23,18 @@ describe "DataPrep" do
23
23
  @data_prep.training[0][0].class.should == Array
24
24
  @data_prep.training[0][1].class.should == Array
25
25
  end
26
+ end
27
+
28
+ describe "When having a target thats array" do
29
+ before do
30
+ ham = [[1, 0.5]] * 20
31
+ spam = [[0, 0.2]] * 20
32
+ @data_prep = DataPrep.new([0] => ham, [1] => spam)
33
+ end
26
34
 
35
+ it "should hold 2 arrays" do
36
+ @data_prep.training[0][1].dimensions.should == 1
37
+ end
27
38
  end
28
39
 
29
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_prep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - reddavis