hyperopt

package
v0.0.0-...-4560c35 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package hyperopt implements SMBO/TPE hyper-parameter optimization for ML models

Many thanks to Masashi SHIBATA for his excellent work on goptuna I used github.com/c-bata/goptuna as a reference implementation for the paper 'Algorithms for Hyper-Parameter Optimization' https://papers.nips.cc/paper/4443-algorithms-for-hyper-parameter-optimization.pdf

TPE sampler mostly derived from goptuna.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(m interface{}, p Params)

Apply apples params to a model

Types

type BestParams

type BestParams struct {
	Params
	Score float64
}

BestParams is a result of Hyper-parameters Optimization

type IntRange

type IntRange [2]int

IntRange is a close integer range specified by min and max values [min,max]

type List

type List []float64

List is a list of possible parameter values

type LogIntRange

type LogIntRange [2]int

LogRange is a close logarithmic integer range specified by min and max values [min,max]

type LogRange

type LogRange [2]float64

LogRange is a open float logarithmic range specified by min and max values (min,max)

type Params

type Params map[string]float64

Params is a set of hyper-parameters used by *SearchCV functions to generate new model

func (Params) Get

func (p Params) Get(name string, dflt float64) float64

Get value of the parameter by name if exists and dflt value otherwise

type Range

type Range [2]float64

Range is a open float range specified by min and max values (min,max)

type Space

type Space struct {
	Source     tables.AnyData // dataset source
	Features   []string       // dataset features
	Label      string         // dataset label
	Seed       int            // random seed
	Kfold      int            // count of dataset folds
	Iterations int            // model fitting iterations
	Metrics    model.Metrics  // model evaluation metrics
	Score      model.Score    // function to calculate score of train/test metrics

	// the model generation function
	ModelFunc func(Params) model.HungryModel

	// hyper-parameters variance
	Variance Variance
}

Space is a definition of hyper-parameters optimization space

func (Space) LuckyOptimize

func (ss Space) LuckyOptimize(trails int) BestParams

func (Space) Optimize

func (ss Space) Optimize(trails int) (best BestParams, err error)

type Value

type Value float64

Value is a single value parameter

type Variance

type Variance map[string]distribution

Variance is a space of hyper-parameters used in *Search functions

Jump to

Keyboard shortcuts

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