examplemodule

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllTransformers

type AllTransformers struct {
	Name0 int     `feature:"identity"`
	Name1 int32   `feature:"minmax"`
	Name2 float32 `feature:"maxabs"`
	Name3 float64 `feature:"standard"`
	Name4 float64 `feature:"quantile"`
	Name5 string  `feature:"onehot"`
	Name6 string  `feature:"ordinal"`
	Name7 float64 `feature:"kbins"`
	Name8 string  `feature:"countvectorizer"`
	Name9 string  `feature:"tfidf"`
}

AllTransformers has all transformer

type AllTransformersFeatureTransformer

type AllTransformersFeatureTransformer struct {
	Name0 fp.Identity         `json:"Name0_identity"`
	Name1 fp.MinMaxScaler     `json:"Name1_minmax"`
	Name2 fp.MaxAbsScaler     `json:"Name2_maxabs"`
	Name3 fp.StandardScaler   `json:"Name3_standard"`
	Name4 fp.QuantileScaler   `json:"Name4_quantile"`
	Name5 fp.OneHotEncoder    `json:"Name5_onehot"`
	Name6 fp.OrdinalEncoder   `json:"Name6_ordinal"`
	Name7 fp.KBinsDiscretizer `json:"Name7_kbins"`
	Name8 fp.CountVectorizer  `json:"Name8_countvectorizer"`
	Name9 fp.TFIDFVectorizer  `json:"Name9_tfidf"`
}

AllTransformersFeatureTransformer is a feature processor for AllTransformers. It was automatically generated by go-featureprocessing tool.

func (*AllTransformersFeatureTransformer) FeatureNames added in v1.0.0

func (e *AllTransformersFeatureTransformer) FeatureNames() []string

FeatureNames provides names of features that match output of transform

func (*AllTransformersFeatureTransformer) Fit

Fit fits transformer for each field

func (*AllTransformersFeatureTransformer) NumFeatures added in v1.0.0

func (e *AllTransformersFeatureTransformer) NumFeatures() int

NumFeatures returns number of features in output feature vector

func (*AllTransformersFeatureTransformer) Transform

Transform transforms struct into feature vector accordingly to transformers

func (*AllTransformersFeatureTransformer) TransformAll added in v1.0.0

TransformAll transforms a slice of AllTransformers

func (*AllTransformersFeatureTransformer) TransformAllInplace added in v1.0.0

func (e *AllTransformersFeatureTransformer) TransformAllInplace(dst []float64, s []AllTransformers)

TransformAllInplace transforms a slice of AllTransformers inplace

func (*AllTransformersFeatureTransformer) TransformAllInplaceParallel added in v1.0.0

func (e *AllTransformersFeatureTransformer) TransformAllInplaceParallel(dst []float64, s []AllTransformers, nworkers uint)

TransformAllInplaceParallel transforms a slice of AllTransformers inplace parallel Useful for very large slices.

func (*AllTransformersFeatureTransformer) TransformAllParallel added in v1.0.0

func (e *AllTransformersFeatureTransformer) TransformAllParallel(s []AllTransformers, nworkers uint) []float64

TransformAllParallel transforms a slice of AllTransformers in parallel

func (*AllTransformersFeatureTransformer) TransformInplace added in v1.0.0

func (e *AllTransformersFeatureTransformer) TransformInplace(dst []float64, s *AllTransformers)

TransformInplace transforms struct into feature vector accordingly to transformers, and does so inplace

type Employee

type Employee struct {
	Age         int     `feature:"identity"`
	Salary      float64 `feature:"minmax"`
	Kids        int     `feature:"maxabs"`
	Weight      float64 `feature:"standard"`
	Height      float64 `feature:"quantile"`
	City        string  `feature:"onehot"`
	Car         string  `feature:"ordinal"`
	Income      float64 `feature:"kbins"`
	Description string  `feature:"tfidf"`
	SecretValue float64
}

Employee is example from readme

type EmployeeFeatureTransformer

type EmployeeFeatureTransformer struct {
	Age         fp.Identity         `json:"Age_identity"`
	Salary      fp.MinMaxScaler     `json:"Salary_minmax"`
	Kids        fp.MaxAbsScaler     `json:"Kids_maxabs"`
	Weight      fp.StandardScaler   `json:"Weight_standard"`
	Height      fp.QuantileScaler   `json:"Height_quantile"`
	City        fp.OneHotEncoder    `json:"City_onehot"`
	Car         fp.OrdinalEncoder   `json:"Car_ordinal"`
	Income      fp.KBinsDiscretizer `json:"Income_kbins"`
	Description fp.TFIDFVectorizer  `json:"Description_tfidf"`
}

EmployeeFeatureTransformer is a feature processor for Employee. It was automatically generated by go-featureprocessing tool.

func (*EmployeeFeatureTransformer) FeatureNames added in v1.0.0

func (e *EmployeeFeatureTransformer) FeatureNames() []string

FeatureNames provides names of features that match output of transform

func (*EmployeeFeatureTransformer) Fit

Fit fits transformer for each field

func (*EmployeeFeatureTransformer) NumFeatures added in v1.0.0

func (e *EmployeeFeatureTransformer) NumFeatures() int

NumFeatures returns number of features in output feature vector

func (*EmployeeFeatureTransformer) Transform

func (e *EmployeeFeatureTransformer) Transform(s *Employee) []float64

Transform transforms struct into feature vector accordingly to transformers

func (*EmployeeFeatureTransformer) TransformAll added in v1.0.0

func (e *EmployeeFeatureTransformer) TransformAll(s []Employee) []float64

TransformAll transforms a slice of Employee

func (*EmployeeFeatureTransformer) TransformAllInplace added in v1.0.0

func (e *EmployeeFeatureTransformer) TransformAllInplace(dst []float64, s []Employee)

TransformAllInplace transforms a slice of Employee inplace

func (*EmployeeFeatureTransformer) TransformAllInplaceParallel added in v1.0.0

func (e *EmployeeFeatureTransformer) TransformAllInplaceParallel(dst []float64, s []Employee, nworkers uint)

TransformAllInplaceParallel transforms a slice of Employee inplace parallel Useful for very large slices.

func (*EmployeeFeatureTransformer) TransformAllParallel added in v1.0.0

func (e *EmployeeFeatureTransformer) TransformAllParallel(s []Employee, nworkers uint) []float64

TransformAllParallel transforms a slice of Employee in parallel

func (*EmployeeFeatureTransformer) TransformInplace added in v1.0.0

func (e *EmployeeFeatureTransformer) TransformInplace(dst []float64, s *Employee)

TransformInplace transforms struct into feature vector accordingly to transformers, and does so inplace

type LargeMemoryTransformer

type LargeMemoryTransformer struct {
	Name1 string  `feature:"onehot"`
	Name2 string  `feature:"onehot"`
	Name3 string  `feature:"ordinal"`
	Name4 string  `feature:"ordinal"`
	Name5 float64 `feature:"quantile"`
	Name6 float64 `feature:"quantile"`
	Name7 float64 `feature:"kbins"`
	Name8 float64 `feature:"kbins"`
}

LargeMemoryTransformer has large memory footprint since each transformer is large

type LargeMemoryTransformerFeatureTransformer

type LargeMemoryTransformerFeatureTransformer struct {
	Name1 fp.OneHotEncoder    `json:"Name1_onehot"`
	Name2 fp.OneHotEncoder    `json:"Name2_onehot"`
	Name3 fp.OrdinalEncoder   `json:"Name3_ordinal"`
	Name4 fp.OrdinalEncoder   `json:"Name4_ordinal"`
	Name5 fp.QuantileScaler   `json:"Name5_quantile"`
	Name6 fp.QuantileScaler   `json:"Name6_quantile"`
	Name7 fp.KBinsDiscretizer `json:"Name7_kbins"`
	Name8 fp.KBinsDiscretizer `json:"Name8_kbins"`
}

LargeMemoryTransformerFeatureTransformer is a feature processor for LargeMemoryTransformer. It was automatically generated by go-featureprocessing tool.

func (*LargeMemoryTransformerFeatureTransformer) FeatureNames added in v1.0.0

FeatureNames provides names of features that match output of transform

func (*LargeMemoryTransformerFeatureTransformer) Fit

Fit fits transformer for each field

func (*LargeMemoryTransformerFeatureTransformer) NumFeatures added in v1.0.0

NumFeatures returns number of features in output feature vector

func (*LargeMemoryTransformerFeatureTransformer) Transform

Transform transforms struct into feature vector accordingly to transformers

func (*LargeMemoryTransformerFeatureTransformer) TransformAll added in v1.0.0

TransformAll transforms a slice of LargeMemoryTransformer

func (*LargeMemoryTransformerFeatureTransformer) TransformAllInplace added in v1.0.0

func (e *LargeMemoryTransformerFeatureTransformer) TransformAllInplace(dst []float64, s []LargeMemoryTransformer)

TransformAllInplace transforms a slice of LargeMemoryTransformer inplace

func (*LargeMemoryTransformerFeatureTransformer) TransformAllInplaceParallel added in v1.0.0

func (e *LargeMemoryTransformerFeatureTransformer) TransformAllInplaceParallel(dst []float64, s []LargeMemoryTransformer, nworkers uint)

TransformAllInplaceParallel transforms a slice of LargeMemoryTransformer inplace parallel Useful for very large slices.

func (*LargeMemoryTransformerFeatureTransformer) TransformAllParallel added in v1.0.0

func (e *LargeMemoryTransformerFeatureTransformer) TransformAllParallel(s []LargeMemoryTransformer, nworkers uint) []float64

TransformAllParallel transforms a slice of LargeMemoryTransformer in parallel

func (*LargeMemoryTransformerFeatureTransformer) TransformInplace added in v1.0.0

TransformInplace transforms struct into feature vector accordingly to transformers, and does so inplace

type SomeOther

type SomeOther struct {
	Name1 float64
	Name2 float64
	Name3 string
}

SomeOther is ignored since there is no gencode command in source file

type SomeOtherWithTags

type SomeOtherWithTags struct {
	Name1 float64 `feature:"minmax"`
	Name2 float64 `feature:"maxabs"`
	Name3 string  `feature:"onehot"`
	Name4 string  `feature:""`
}

SomeOtherWithTags is ignored since there is no gencode command in source file, even though it has correct feature tags

type WeirdTags

type WeirdTags struct {
	OnlyFeature       float64 `feature:"minmax"`
	FeatureNotFirst   float64 `json:"name2" feature:"maxabs"`
	FirstFeature      string  `feature:"onehot" json:"some_json_tag"`
	Multiline         float64 `json:"multiline" feature:"maxabs"`
	WithoutFeatureTag string  `json:"with_tag"`

	WithoutTag string

	// UTF-8 is allowed
	A안녕하세요  int    `feature:"minmax"`
	B안녕하세요1 string `feature:"onehot"`
	C안녕하세요0 string `feature:"tfidf"`
}

WeirdTags has unusual but valid tags

type WeirdTagsFeatureTransformer

type WeirdTagsFeatureTransformer struct {
	OnlyFeature     fp.MinMaxScaler    `json:"OnlyFeature_minmax"`
	FeatureNotFirst fp.MaxAbsScaler    `json:"FeatureNotFirst_maxabs"`
	FirstFeature    fp.OneHotEncoder   `json:"FirstFeature_onehot"`
	Multiline       fp.MaxAbsScaler    `json:"Multiline_maxabs"`
	A안녕하세요          fp.MinMaxScaler    `json:"A안녕하세요_minmax"`
	B안녕하세요1         fp.OneHotEncoder   `json:"B안녕하세요1_onehot"`
	C안녕하세요0         fp.TFIDFVectorizer `json:"C안녕하세요0_tfidf"`
}

WeirdTagsFeatureTransformer is a feature processor for WeirdTags. It was automatically generated by go-featureprocessing tool.

func (*WeirdTagsFeatureTransformer) FeatureNames added in v1.0.0

func (e *WeirdTagsFeatureTransformer) FeatureNames() []string

FeatureNames provides names of features that match output of transform

func (*WeirdTagsFeatureTransformer) Fit

Fit fits transformer for each field

func (*WeirdTagsFeatureTransformer) NumFeatures added in v1.0.0

func (e *WeirdTagsFeatureTransformer) NumFeatures() int

NumFeatures returns number of features in output feature vector

func (*WeirdTagsFeatureTransformer) Transform

func (e *WeirdTagsFeatureTransformer) Transform(s *WeirdTags) []float64

Transform transforms struct into feature vector accordingly to transformers

func (*WeirdTagsFeatureTransformer) TransformAll added in v1.0.0

func (e *WeirdTagsFeatureTransformer) TransformAll(s []WeirdTags) []float64

TransformAll transforms a slice of WeirdTags

func (*WeirdTagsFeatureTransformer) TransformAllInplace added in v1.0.0

func (e *WeirdTagsFeatureTransformer) TransformAllInplace(dst []float64, s []WeirdTags)

TransformAllInplace transforms a slice of WeirdTags inplace

func (*WeirdTagsFeatureTransformer) TransformAllInplaceParallel added in v1.0.0

func (e *WeirdTagsFeatureTransformer) TransformAllInplaceParallel(dst []float64, s []WeirdTags, nworkers uint)

TransformAllInplaceParallel transforms a slice of WeirdTags inplace parallel Useful for very large slices.

func (*WeirdTagsFeatureTransformer) TransformAllParallel added in v1.0.0

func (e *WeirdTagsFeatureTransformer) TransformAllParallel(s []WeirdTags, nworkers uint) []float64

TransformAllParallel transforms a slice of WeirdTags in parallel

func (*WeirdTagsFeatureTransformer) TransformInplace added in v1.0.0

func (e *WeirdTagsFeatureTransformer) TransformInplace(dst []float64, s *WeirdTags)

TransformInplace transforms struct into feature vector accordingly to transformers, and does so inplace

type With32Fields

type With32Fields struct {
	Name1  float64 `feature:"minmax"`
	Name2  float64 `feature:"minmax"`
	Name3  float64 `feature:"minmax"`
	Name4  float64 `feature:"minmax"`
	Name5  float64 `feature:"minmax"`
	Name6  float64 `feature:"minmax"`
	Name7  float64 `feature:"minmax"`
	Name8  float64 `feature:"minmax"`
	Name9  float64 `feature:"minmax"`
	Name10 float64 `feature:"minmax"`
	Name11 float64 `feature:"minmax"`
	Name12 float64 `feature:"minmax"`
	Name13 float64 `feature:"minmax"`
	Name14 float64 `feature:"minmax"`
	Name15 float64 `feature:"minmax"`
	Name16 float64 `feature:"minmax"`
	Name17 float64 `feature:"minmax"`
	Name18 float64 `feature:"minmax"`
	Name19 float64 `feature:"minmax"`
	Name21 float64 `feature:"minmax"`
	Name22 float64 `feature:"minmax"`
	Name23 float64 `feature:"minmax"`
	Name24 float64 `feature:"minmax"`
	Name25 float64 `feature:"minmax"`
	Name26 float64 `feature:"minmax"`
	Name27 float64 `feature:"minmax"`
	Name28 float64 `feature:"minmax"`
	Name29 float64 `feature:"minmax"`
	Name30 float64 `feature:"minmax"`
	Name31 float64 `feature:"minmax"`
	Name32 float64 `feature:"minmax"`
}

With32Fields has many fields

type With32FieldsFeatureTransformer

type With32FieldsFeatureTransformer struct {
	Name1  fp.MinMaxScaler `json:"Name1_minmax"`
	Name2  fp.MinMaxScaler `json:"Name2_minmax"`
	Name3  fp.MinMaxScaler `json:"Name3_minmax"`
	Name4  fp.MinMaxScaler `json:"Name4_minmax"`
	Name5  fp.MinMaxScaler `json:"Name5_minmax"`
	Name6  fp.MinMaxScaler `json:"Name6_minmax"`
	Name7  fp.MinMaxScaler `json:"Name7_minmax"`
	Name8  fp.MinMaxScaler `json:"Name8_minmax"`
	Name9  fp.MinMaxScaler `json:"Name9_minmax"`
	Name10 fp.MinMaxScaler `json:"Name10_minmax"`
	Name11 fp.MinMaxScaler `json:"Name11_minmax"`
	Name12 fp.MinMaxScaler `json:"Name12_minmax"`
	Name13 fp.MinMaxScaler `json:"Name13_minmax"`
	Name14 fp.MinMaxScaler `json:"Name14_minmax"`
	Name15 fp.MinMaxScaler `json:"Name15_minmax"`
	Name16 fp.MinMaxScaler `json:"Name16_minmax"`
	Name17 fp.MinMaxScaler `json:"Name17_minmax"`
	Name18 fp.MinMaxScaler `json:"Name18_minmax"`
	Name19 fp.MinMaxScaler `json:"Name19_minmax"`
	Name21 fp.MinMaxScaler `json:"Name21_minmax"`
	Name22 fp.MinMaxScaler `json:"Name22_minmax"`
	Name23 fp.MinMaxScaler `json:"Name23_minmax"`
	Name24 fp.MinMaxScaler `json:"Name24_minmax"`
	Name25 fp.MinMaxScaler `json:"Name25_minmax"`
	Name26 fp.MinMaxScaler `json:"Name26_minmax"`
	Name27 fp.MinMaxScaler `json:"Name27_minmax"`
	Name28 fp.MinMaxScaler `json:"Name28_minmax"`
	Name29 fp.MinMaxScaler `json:"Name29_minmax"`
	Name30 fp.MinMaxScaler `json:"Name30_minmax"`
	Name31 fp.MinMaxScaler `json:"Name31_minmax"`
	Name32 fp.MinMaxScaler `json:"Name32_minmax"`
}

With32FieldsFeatureTransformer is a feature processor for With32Fields. It was automatically generated by go-featureprocessing tool.

func (*With32FieldsFeatureTransformer) FeatureNames added in v1.0.0

func (e *With32FieldsFeatureTransformer) FeatureNames() []string

FeatureNames provides names of features that match output of transform

func (*With32FieldsFeatureTransformer) Fit

Fit fits transformer for each field

func (*With32FieldsFeatureTransformer) NumFeatures added in v1.0.0

func (e *With32FieldsFeatureTransformer) NumFeatures() int

NumFeatures returns number of features in output feature vector

func (*With32FieldsFeatureTransformer) Transform

Transform transforms struct into feature vector accordingly to transformers

func (*With32FieldsFeatureTransformer) TransformAll added in v1.0.0

func (e *With32FieldsFeatureTransformer) TransformAll(s []With32Fields) []float64

TransformAll transforms a slice of With32Fields

func (*With32FieldsFeatureTransformer) TransformAllInplace added in v1.0.0

func (e *With32FieldsFeatureTransformer) TransformAllInplace(dst []float64, s []With32Fields)

TransformAllInplace transforms a slice of With32Fields inplace

func (*With32FieldsFeatureTransformer) TransformAllInplaceParallel added in v1.0.0

func (e *With32FieldsFeatureTransformer) TransformAllInplaceParallel(dst []float64, s []With32Fields, nworkers uint)

TransformAllInplaceParallel transforms a slice of With32Fields inplace parallel Useful for very large slices.

func (*With32FieldsFeatureTransformer) TransformAllParallel added in v1.0.0

func (e *With32FieldsFeatureTransformer) TransformAllParallel(s []With32Fields, nworkers uint) []float64

TransformAllParallel transforms a slice of With32Fields in parallel

func (*With32FieldsFeatureTransformer) TransformInplace added in v1.0.0

func (e *With32FieldsFeatureTransformer) TransformInplace(dst []float64, s *With32Fields)

TransformInplace transforms struct into feature vector accordingly to transformers, and does so inplace

Jump to

Keyboard shortcuts

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