Class: PCA::Input
- Inherits:
-
Object
- Object
- PCA::Input
- Defined in:
- lib/appswarm/routing/pca.rb
Instance Method Summary collapse
- #<<(v) ⇒ Object
- #dmatrix ⇒ Object
- #featureCount ⇒ Object
-
#initialize(i = nil) ⇒ Input
constructor
A new instance of Input.
- #trainCount ⇒ Object
Constructor Details
Instance Method Details
#<<(v) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/appswarm/routing/pca.rb', line 20 def <<(v) assert {v.is_a?(Array)} if @vecs.length==0 @vecs<<v else assert {@vecs[0].length == v.length } @vecs<<v end end |
#dmatrix ⇒ Object
38 39 40 |
# File 'lib/appswarm/routing/pca.rb', line 38 def dmatrix Linalg::DMatrix[*@vecs] end |
#featureCount ⇒ Object
34 35 36 |
# File 'lib/appswarm/routing/pca.rb', line 34 def featureCount @vecs[0].length end |
#trainCount ⇒ Object
30 31 32 |
# File 'lib/appswarm/routing/pca.rb', line 30 def trainCount @vecs.length end |