Sha256: 5d6f135a6f86f47f4db0aa933b0d6907506d97651692ae25abe34f647fcdaa75

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

if false

$: << File.expand_path("../..",__FILE__)

require 'pca.rb'

describe "PCA" do
  it "should compress/decompress without failure if element is in training-set" do
    i=PCA::Input.new
    i<<[1,1,0]
    i<<[0,1,1]
    i<<[0,1,2]
    i<<[9,1,1]
    i<<[0,1,0]
    
    base=PCA::Base.new(i)
    
    ref=[1,1,0]
    
    c=base.compress(ref)
    r=base.decompress(c)
    
    (r-Linalg::DMatrix[ref]).norm.should < 0.1
  end
end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appswarm-0.0.1 lib/appswarm/routing/spec/pca_spec.rb