dataset

package
v0.0.0-...-ebc0b1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCSV

func LoadCSV(r io.Reader) (*mat64.Dense, error)

LoadCSV loads training set from the path supplied as a parameter. It returns data matrix that contains particular CSV fields in columns. It returns error if the supplied data set contains corrrupted data or if the data can not be converted to float numbers

func Scale

func Scale(mx mat64.Matrix) mat64.Matrix

Scale centers the data set to zero mean values and scales each column. It modifies the data stored in the data set. If your data contains also labeles in the last column, make sure you extract it before scaling.

Types

type DataSet

type DataSet struct {
	// contains filtered or unexported fields
}

DataSet represents training data set

func NewDataSet

func NewDataSet(path string, labeled bool) (*DataSet, error)

NewDataSet returns new data set or fails with error if either the path to data set supplied as a parameter does not exist or if the data set file is encoded in an unsupported format. File format is inferred from the file extension. Currently only CSV files are supported. You can specify if the data set is labeled or not In CSV context "labeled" means that the labels are the last column in the raw file

func (DataSet) Data

func (ds DataSet) Data() mat64.Matrix

Data returns the data set represented as matrix

func (DataSet) Features

func (ds DataSet) Features() mat64.Matrix

Features returns features matrix from the underlying raw data matrix Raw matrix contains both features and labels read from the data file. If the dataset is not labeled the function returns the raw data matrix

func (DataSet) IsLabeled

func (ds DataSet) IsLabeled() bool

IsLabeled returns true if the loaded data set contains labels Labels are assumed to be in the last column of the data matrix

func (DataSet) Labels

func (ds DataSet) Labels() mat64.Matrix

Labels returns data labels from the raw data. If the data set is not labeled or if it only contains one columne it returns nil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL