utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FreqDist

type FreqDist struct {
	Samples map[string]int
}

A frequency distribution for the outcomes of an experiment. A frequency distribution records the number of times each outcome of an experiment has occurred. For example, a frequency distribution could be used to record the frequency of each word type in a document. Formally, a frequency distribution can be defined as a function mapping from each sample to the number of times that sample occurred as an outcome. Frequency distributions are generally constructed by running a number of experiments, and incrementing the count for a sample every time it is an outcome of an experiment.

func NewFreqDist

func NewFreqDist(samples map[string]int) *FreqDist

func (*FreqDist) B

func (f *FreqDist) B() int

B returns the total number of sample values (or "bins") that have counts greater than zero.

func (*FreqDist) N

func (f *FreqDist) N() float64

N returns the total number of sample outcomes that have been recorded by this FreqDist.

Jump to

Keyboard shortcuts

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