Class: MachineLearner::DataSet

Inherits:
Object
  • Object
show all
Defined in:
lib/machine_learner/dataset.rb

Overview

学習器にかけるデータ特徴空間xと識別結果yを持つ

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, id = nil) ⇒ DataSet

コンストラクタ

Parameters:

  • x

    特徴空間

  • y

    識別結果



13
14
15
16
# File 'lib/machine_learner/dataset.rb', line 13

def initialize(x, y, id = nil)
  @x, @y = x, y
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/machine_learner/dataset.rb', line 8

def id
  @id
end

#xObject (readonly)

Returns the value of attribute x.



7
8
9
# File 'lib/machine_learner/dataset.rb', line 7

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



7
8
9
# File 'lib/machine_learner/dataset.rb', line 7

def y
  @y
end

Instance Method Details

#to_sObject

Returns データセットを表現する文字列.

Returns:

  • データセットを表現する文字列



19
20
21
# File 'lib/machine_learner/dataset.rb', line 19

def to_s
  "(#{@x}=>#{@y})"
end