scaling

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package scaling contains implementation of feature scaling. It supports two types of feature scaling: normalization and standarization.

Index

Constants

View Source
const (
	Normalization = iota + 1
	Standarization
)

Variables

View Source
var (
	// ErrUnsupportedTechnique is returned if an unsupported feature scaling technique was chosen.
	ErrUnsupportedTechnique = errors.New("unsupported scaling technique")
	// ErrInvalidParameters is returned if scaling parameters vectors have different length.
	ErrInvalidParameters = errors.New("invalid scaling parameters")
)

Functions

func Scale

func Scale(v []float64, p Parameters) ([]float64, error)

Scale scales a single feature vector with given parameters.

Types

type Parameters

type Parameters struct {
	U []float64 // mean value of all features from a design matrix
	S []float64 // range or standard deviation of all features from a design matrix
}

Parameters group together two parameters used in scaling.

type Result

type Result struct {
	X          [][]float64
	Parameters Parameters
}

Result holds the scaled features set along with the scaling parameters.

func ScaleDesignMatrix

func ScaleDesignMatrix(t Technique, x [][]float64) (Result, error)

ScaleDesignMatrix scales a design matrix with a given technique.

type Technique

type Technique int

Technique identifies a feature scaling technique.

Jump to

Keyboard shortcuts

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