filters

package
Version: v0.0.0-...-4fa0698 Latest Latest
Warning

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

Go to latest
Published: May 24, 2014 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinningFilter

type BinningFilter struct {
	Attributes []int
	Instances  *base.Instances
	BinCount   int
	MinVals    map[int]float64
	MaxVals    map[int]float64
	// contains filtered or unexported fields
}

BinningFilter does equal-width binning for numeric Attributes (aka "histogram binning")

func NewBinningFilter

func NewBinningFilter(inst *base.Instances, bins int) BinningFilter

NewBinningFilter creates a BinningFilter structure with some helpful default initialisations.

func (*BinningFilter) AddAllNumericAttributes

func (b *BinningFilter) AddAllNumericAttributes()

AddAllNumericAttributes adds every suitable attribute to the BinningFilter for discretiation

func (*BinningFilter) AddAttribute

func (b *BinningFilter) AddAttribute(a base.Attribute)

AddAttribute adds the index of the given attribute `a' to the BinningFilter for discretisation.

func (*BinningFilter) Build

func (b *BinningFilter) Build()

Build computes and stores the bin values for the training instances.

func (*BinningFilter) Run

func (b *BinningFilter) Run(on *base.Instances)

Run applies a trained BinningFilter to a set of Instances, discretising any numeric attributes added.

IMPORTANT: Run discretises in-place, so make sure to take a copy if the original instances are still needed

IMPORTANT: This function panic()s if the filter has not been trained. Call Build() before running this function

IMPORTANT: Call Build() after adding any additional attributes. Otherwise, the training structure will be out of date from the values expected and could cause a panic.

type ChiMergeFilter

type ChiMergeFilter struct {
	Attributes   []int
	Instances    *base.Instances
	Tables       map[int][]*FrequencyTableEntry
	Significance float64
	MinRows      int
	MaxRows      int
	// contains filtered or unexported fields
}

ChiMergeFilter implements supervised discretisation by merging successive numeric intervals if the difference in their class distribution is not statistically signficant. See Bramer, "Principles of Data Mining", 2nd Edition

pp 105--115

func NewChiMergeFilter

func NewChiMergeFilter(inst *base.Instances, significance float64) ChiMergeFilter

Create a ChiMergeFilter with some helpful intialisations.

func (*ChiMergeFilter) AddAllNumericAttributes

func (b *ChiMergeFilter) AddAllNumericAttributes()

AddAllNumericAttributes adds every suitable attribute to the ChiMergeFilter for discretisation

func (*ChiMergeFilter) AddAttribute

func (c *ChiMergeFilter) AddAttribute(attr base.Attribute)

AddAttribute add a given numeric Attribute `attr' to the filter.

IMPORTANT: This function panic()s if it can't locate the attribute in the Instances set.

func (*ChiMergeFilter) Build

func (c *ChiMergeFilter) Build()

Build trains a ChiMergeFilter on the ChiMergeFilter.Instances given

func (*ChiMergeFilter) Run

func (c *ChiMergeFilter) Run(on *base.Instances)

Run discretises the set of Instances `on'

IMPORTANT: ChiMergeFilter discretises in place.

type FrequencyTableEntry

type FrequencyTableEntry struct {
	Value     float64
	Frequency map[string]int
}

func ChiMBuildFrequencyTable

func ChiMBuildFrequencyTable(attr int, inst *base.Instances) []*FrequencyTableEntry

func (*FrequencyTableEntry) String

func (t *FrequencyTableEntry) String() string

Jump to

Keyboard shortcuts

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