table

package
v0.0.0-...-61db93c Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandValueIn

func RandValueIn(valueAndProbability map[string]float64) func() string

Types

type Cell

type Cell struct {
	Dtype tensor.Dtype
	V     any
}

func StringToCell

func StringToCell(v string) *Cell

func (Cell) Float32

func (v Cell) Float32() float32

func (Cell) Int

func (v Cell) Int() int

func (Cell) String

func (v Cell) String() string

type Row

type Row struct {
	Cells []*Cell
	Tags  map[string]bool
}

func StringsToRow

func StringsToRow(values []string) Row

func (*Row) AddTag

func (r *Row) AddTag(tags ...string)

func (Row) HasAnyTag

func (r Row) HasAnyTag(tags []string) bool

type Rows

type Rows []*Row

type Table

type Table struct {
	Header []string
	Rows   Rows

	ClassesByColumn map[int][]string
}

func ReadCSV

func ReadCSV(pathCSV string) (*Table, error)

ReadCSV loads a CSV table

func (*Table) AddColumn

func (t *Table) AddColumn(columnName string, val interface{})

func (*Table) AddTag

func (t *Table) AddTag(tagFunc func() string)

func (*Table) CategoricalColumns

func (t *Table) CategoricalColumns(excludeColumns ...int) (columns []int, dimensions []int)

func (*Table) EachCell

func (t *Table) EachCell(cb func(rowNumber, columnNumber int, cell *Cell))

func (*Table) EachColumn

func (t *Table) EachColumn(f func(columnName string, v *Cell))

func (*Table) EachRow

func (t *Table) EachRow(f func(row *Row))

func (*Table) Has

func (t *Table) Has(column string) bool

func (*Table) ToTensors

func (t *Table) ToTensors(opts ToTensorOpts) (x *tensor.Dense, y *tensor.Dense)

type ToTensorOpts

type ToTensorOpts struct {
	TargetColumns []int
	SelectTags    []string
}

Jump to

Keyboard shortcuts

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