feature

package
v0.0.0-...-d025fe8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertContinuousToDiscrete

func ConvertContinuousToDiscrete(columnIndex int, data *Table) (Feature, []*Instance)

Types

type Create

type Create func(value string) *Instance

type CreateContinuous

type CreateContinuous func(value float64) *Instance

type CreateDiscrete

type CreateDiscrete func(value int64) *Instance

type Feature

type Feature struct {
	Type             FeatureType
	Name             string
	Create           Create
	CreateContinuous CreateContinuous
	CreateDiscrete   CreateDiscrete
}

func NewContinous

func NewContinous(name string) Feature

func NewDiscrete

func NewDiscrete(name string, values []string) Feature

func (Feature) TypeKey

func (f Feature) TypeKey() TypeKey

type FeatureType

type FeatureType int
const (
	Continuous FeatureType = iota
	Discrete
)

type Instance

type Instance struct {
	Feature         Feature
	DiscreteValue   int64
	ContinuousValue float64
	StringValue     string
}

type Table

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

func CreateTable

func CreateTable(features []Feature) *Table

func (*Table) AddColumn

func (t *Table) AddColumn(feature Feature, column []*Instance)

func (*Table) AddStringRow

func (t *Table) AddStringRow(records []string)

func (*Table) At

func (t *Table) At(rowIndex, columnIndex int) *Instance

func (*Table) ColumnIndexFromLabel

func (t *Table) ColumnIndexFromLabel(typeKey TypeKey) int

func (*Table) LabelFromColumnIndex

func (t *Table) LabelFromColumnIndex(columnIndex int) *Feature

func (*Table) NumColumns

func (t *Table) NumColumns() int

func (*Table) NumRows

func (t *Table) NumRows() int

type TableView

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

func (*TableView) At

func (tv *TableView) At(rowIndex, columnIndex int) *Instance

func (*TableView) ColumnIndexFromLabel

func (tv *TableView) ColumnIndexFromLabel(typeKey TypeKey) int

func (*TableView) LabelFromColumnIndex

func (tv *TableView) LabelFromColumnIndex(columnIndex int) *Feature

func (*TableView) NumColumns

func (tv *TableView) NumColumns() int

func (*TableView) NumRows

func (tv *TableView) NumRows() int

type TableViewBuilder

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

func NewTableViewBuilder

func NewTableViewBuilder(table TableViewer) *TableViewBuilder

func (*TableViewBuilder) Build

func (tvb *TableViewBuilder) Build() TableViewer

func (*TableViewBuilder) WithAllColumns

func (tvb *TableViewBuilder) WithAllColumns() *TableViewBuilder

func (*TableViewBuilder) WithAllRows

func (tvb *TableViewBuilder) WithAllRows() *TableViewBuilder

func (*TableViewBuilder) WithColumn

func (tvb *TableViewBuilder) WithColumn(index int) *TableViewBuilder

func (*TableViewBuilder) WithRow

func (tvb *TableViewBuilder) WithRow(index int) *TableViewBuilder

type TableViewer

type TableViewer interface {
	NumColumns() int
	NumRows() int

	At(rowIndex, columnIndex int) *Instance
	LabelFromColumnIndex(columnIndex int) *Feature
	ColumnIndexFromLabel(typeKey TypeKey) int
}

type TypeKey

type TypeKey struct {
	Name string
	Type FeatureType
}

Jump to

Keyboard shortcuts

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