class SHAInet::Data

Direct Known Subclasses

Defined in:

shainet/data/data.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(inputs : Array(Array(Float64)), outputs : Array(Array(Float64))) #

[View source]

Class Method Detail

def self.new_with_csv_input_target(csv_file_path, input_column_range, target_column) #

@data_pairs : Takes a path to a CSV file, a range of inputs and the index of the target column. Returns a SHAInet::Data object.

data = SHAInet::Data.new_with_csv_input_target("iris.csv", 0..3, 4)

[View source]

Instance Method Detail

def array_for_label(a_label) #

Takes a label as a String and returns the corresponding output array


[View source]
def data #

[View source]
def denormalize(x, xmin, xmax) #

[View source]
def denormalize_outputs(outputs : Array(GenNum)) #

[View source]
def inputs : Array(Array(Float64)) #

[View source]
def label_for_array(an_array) #

Takes an output array of 0,1s and returns the corresponding label


[View source]
def labels : Array(String) #

[View source]
def labels=(label_array) #

Receives an array of labels (String or Symbol) and sets them for this Data object


[View source]
def normalize(x, xmin, xmax) #

[View source]
def normalize_inputs(inputs : Array(GenNum)) #

[View source]
def normalize_min_max(data : Array(Array(Float64))) #

[View source]
def normalize_min_max #

[View source]
def normalize_outputs(outputs : Array(GenNum)) #

[View source]
def normalized_inputs : Array(Array(Float64)) #

[View source]
def normalized_inputs=(normalized_inputs : Array(Array(Float64))) #

[View source]
def normalized_outputs : Array(Array(Float64)) #

[View source]
def normalized_outputs=(normalized_outputs : Array(Array(Float64))) #

[View source]
def outputs : Array(Array(Float64)) #

[View source]
def outputs=(outputs : Array(Array(Float64))) #

[View source]
def raw_data #

[View source]
def size #

[View source]
def split(factor) #

Splits the receiver in a TrainingData and a TestData object according to factor


[View source]
def to_onehot(data : Array(Array(Float64)), vector_size : Int32) #

[View source]