MCPcopy Create free account

hub / github.com/PacktPublishing/Go-Machine-Learning-Projects / functions

Functions156 in github.com/PacktPublishing/Go-Machine-Learning-Projects

↓ 27 callersMethoddo
(fn func() (tensor.Tensor, error))
Chapter06/rawnn.go:150
↓ 18 callersFunctionmakeRS
makeRS creates a ranged slice. It takes an optional step param.
Chapter06/utils.go:12
↓ 17 callersFunctiondieIfErr
(err error)
Chapter04/main.go:113
↓ 13 callersFunctionmHandleErr
mHandleErr is the error handler for the main function. If an error happens within the main function, it is not unexpected for a fatal error to be logg
Chapter02/main.go:36
↓ 11 callersFunctiondieIfErr
* func main() { twitter := anaconda.NewTwitterApiWithCredentials(ACCESSTOKEN, ACCESSTOKENSECRET, CONSUMERKEY, CONSUMERSECRET) raw, err := twitter.Ge
Chapter05/main.go:411
↓ 10 callersMethodString
()
Chapter03/classifier.go:22
↓ 5 callersFunctionargmax
(a []float64)
Chapter06/main.go:136
↓ 5 callersFunctionnewTSPlot
(xs []time.Time, ys []float64, seriesName string)
Chapter04/plotutil.go:85
↓ 5 callersFunctionvisualize
visualize visualizes the first N images given a data tensor that is made up of float64s. It's arranged into (rows, 10) image. Row counts are calculate
Chapter06/mnist.go:143
↓ 3 callersMethodPredict
(a tensor.Tensor)
Chapter06/rawnn.go:29
↓ 3 callersFunctionasMatrix
(a []*processedTweet)
Chapter05/main.go:174
↓ 3 callersMethodlearnables
()
Chapter07/main.go:83
↓ 3 callersFunctionnaughtyGrayscale
(dst []uint8, src *image.NRGBA)
Chapter08/gocv.go:119
↓ 3 callersFunctionpixelWeight
(px byte)
Chapter06/mnist.go:97
↓ 3 callersFunctionwriteToPng
(a interface{}, title, filename string, width, height vg.Length)
Chapter04/plotutil.go:147
↓ 3 callersFunctionzca
(data tensor.Tensor)
Chapter06/preprocess.go:11
↓ 2 callersMethodPredict
(sentence []string)
Chapter03/classifier.go:118
↓ 2 callersMethodScore
(sentence []string)
Chapter03/classifier.go:91
↓ 2 callersMethodStep
()
Chapter07/main.go:52
↓ 2 callersMethodTrain
X is the image, Y is a one hot vector
Chapter06/rawnn.go:63
↓ 2 callersFunctionavg
(a []float64)
Chapter06/main.go:147
↓ 2 callersFunctionbyClusters
(a []int, expectedClusters int)
Chapter05/main.go:182
↓ 2 callersFunctionclean
hints is a slice of bools indicating whether it's a categorical variable
Chapter02/main.go:157
↓ 2 callersFunctionconvert
convert converts a string into a slice of floats
Chapter02/main.go:107
↓ 2 callersFunctionfillRandom
(a []float64, v float64)
Chapter06/rawnn.go:136
↓ 2 callersFunctioningest
ingest is a function that ingests the file and outputs the header, data, and index.
Chapter02/main.go:43
↓ 2 callersFunctionload
(r io.Reader)
Chapter05/main.go:212
↓ 2 callersFunctionlog1pCol
log1pCol applies the log1p transformation on a column
Chapter02/main.go:234
↓ 2 callersFunctionnaughtyToImage
(m *gocv.Mat, imge image.Image)
Chapter08/gocv.go:75
↓ 2 callersFunctionpigoSetup
(width, height int)
Chapter08/gocv.go:35
↓ 2 callersFunctionplotDecomposed
(xs []time.Time, a stl.Result)
Chapter04/plotutil.go:137
↓ 2 callersFunctionplotHist
plotHist plots the histogram of a slice of float64s.
Chapter02/main.go:272
↓ 2 callersFunctionprepareX
(M []RawImage)
Chapter06/mnist.go:109
↓ 2 callersFunctionprepareY
(N []Label)
Chapter06/mnist.go:122
↓ 2 callersFunctionreadImageFile
(r io.Reader, e error)
Chapter06/mnist.go:61
↓ 2 callersFunctionreadLabelFile
(r io.Reader, e error)
Chapter06/mnist.go:35
↓ 2 callersFunctionreversePixelWeight
(px float64)
Chapter07/mnist.go:105
↓ 2 callersFunctionreversePixelWeight
(px float64)
Chapter06/mnist.go:105
↓ 2 callersFunctionscale
(a [][]float64, j int)
Chapter02/utils.go:85
↓ 2 callersFunctionsum
(a []float64)
Chapter06/main.go:152
↓ 2 callersFunctionvisualizeWeights
(w tensor.Tensor, rows, cols int, filename string)
Chapter07/mnist.go:213
↓ 2 callersFunctionvisualizeWeights
(w tensor.Tensor, rows, cols int, filename string)
Chapter06/mnist.go:213
↓ 1 callersFunctionCEF
CEF is the conditional expectation function that finds the conditionally expected value when each of the values in the variable is held fixed.
Chapter02/main.go:209
↓ 1 callersMethodDataRange
()
Chapter04/plotutil.go:66
↓ 1 callersMethodDims
()
Chapter02/main.go:291
↓ 1 callersFunctionNew
(input, hidden, output int)
Chapter06/rawnn.go:16
↓ 1 callersFunctionNew
()
Chapter03/classifier.go:53
↓ 1 callersMethodPostprocess
()
Chapter03/classifier.go:70
↓ 1 callersMethodStart
()
Chapter07/main.go:50
↓ 1 callersMethodTrain
(examples []Example)
Chapter03/classifier.go:64
↓ 1 callersFunctionargmax
(a [MAXCLASS]float64)
Chapter03/classifier.go:173
↓ 1 callersFunctionbyClusters2
(a []dmmclust.Cluster, expectedClusters int)
Chapter05/main.go:204
↓ 1 callersFunctioncardinality
cardinality counts the number of unique values in a column. This assumes that the index i of indices represents a column.
Chapter02/main.go:71
↓ 1 callersFunctioncleanup
(sigChan chan os.Signal, doneChan chan bool, profiling bool)
Chapter07/main.go:322
↓ 1 callersFunctionconvertCategorical
convertCategorical is a basic function that encodes a categorical variable as a slice of floats. There are no smarts involved at the moment. The encod
Chapter02/main.go:119
↓ 1 callersFunctiondbscan
(a []*processedTweet)
Chapter05/main.go:355
↓ 1 callersFunctiondmm
(a []*processedTweet, expC int, corpusSize int)
Chapter05/main.go:330
↓ 1 callersFunctionforecastTime
(dates []time.Time, forwards int)
Chapter04/main.go:119
↓ 1 callersMethodfwd
This function is particularly verbose for educational reasons. In reality, you'd wrap up the layers within a layer struct type and perform per-layer a
Chapter07/main.go:88
↓ 1 callersFunctiongocvClassifier
()
Chapter08/gocv.go:26
↓ 1 callersFunctionhw
(a stl.Result, periodicity, forward int, alpha, beta, gamma float64)
Chapter04/main.go:129
↓ 1 callersFunctionimputeCategorical
imputeCategorical replaces "NA" with the mode of categorical values
Chapter02/main.go:95
↓ 1 callersFunctioninList
(a string, l []string)
Chapter02/utils.go:36
↓ 1 callersFunctioningest
(typ string)
Chapter03/ingest.go:24
↓ 1 callersFunctioningestOneFile
(abspath string)
Chapter03/ingest.go:68
↓ 1 callersFunctioninvSqrt
(epsilon float64)
Chapter06/preprocess.go:61
↓ 1 callersFunctioniqr
iqr finds the interquartile range
Chapter02/utils.go:46
↓ 1 callersFunctionkmeans
(a []*processedTweet, expC int)
Chapter05/main.go:345
↓ 1 callersFunctionknn
(a [][]float64, k int, distance func(a, b []float64) float64)
Chapter05/knn.go:7
↓ 1 callersFunctionlargestCluster2
(clusters []dmmclust.Cluster)
Chapter05/main.go:250
↓ 1 callersFunctionminusMean
(a tensor.Tensor)
Chapter06/preprocess.go:68
↓ 1 callersFunctionmode
mode finds the most common value for each variable
Chapter02/main.go:80
↓ 1 callersFunctionnewConvNet
(g *gorgonia.ExprGraph)
Chapter07/main.go:62
↓ 1 callersFunctionnewProcessor
()
Chapter05/main.go:64
↓ 1 callersFunctionnewResidPlot
(xs []time.Time, ys []float64, seriesName string)
Chapter04/plotutil.go:114
↓ 1 callersFunctionparse
(l loader)
Chapter04/main.go:37
↓ 1 callersFunctionparseDates
(a []string)
Chapter04/utils.go:11
↓ 1 callersFunctionparseDecimalDate
parseDecimalDate takes a string in format of a decimal date "2018.05" and converts it into a date.
Chapter04/utils.go:26
↓ 1 callersFunctionpixelWeight
(px byte)
Chapter07/mnist.go:97
↓ 1 callersFunctionplotCEF
plotCEF plots the CEF. This is a simple plot with only the CEF. More advanced plots can be also drawn to expose more nuance in understanding the data.
Chapter02/main.go:242
↓ 1 callersFunctionplotHeatMap
(corr mat.Matrix, labels []string)
Chapter02/main.go:306
↓ 1 callersFunctionplotKNNDist
(a []float64)
Chapter05/main.go:321
↓ 1 callersFunctionprepareX
(M []RawImage)
Chapter07/mnist.go:109
↓ 1 callersFunctionprepareY
(N []Label)
Chapter07/mnist.go:122
↓ 1 callersMethodpriors
()
Chapter03/classifier.go:142
↓ 1 callersMethodprob
(word string, class Class)
Chapter03/classifier.go:155
↓ 1 callersMethodprocess
(a []*processedTweet)
Chapter05/main.go:106
↓ 1 callersFunctionreadImageFile
(r io.Reader, e error)
Chapter07/mnist.go:61
↓ 1 callersFunctionreadLabelFile
(r io.Reader, e error)
Chapter07/mnist.go:35
↓ 1 callersFunctionrunRegression
(Xs [][]float64, Ys []float64, hdr []string)
Chapter02/main.go:392
↓ 1 callersFunctionshuffle
(a []Example)
Chapter03/classifier.go:186
↓ 1 callersFunctionshuffle
(a [][]float64, b []float64)
Chapter02/utils.go:114
↓ 1 callersFunctionshuffleX
(a [][]float64)
Chapter06/main.go:125
↓ 1 callersMethodsingle
(word string)
Chapter05/main.go:79
↓ 1 callersFunctionskew
skew returns the skewness of a column/variable
Chapter02/main.go:223
↓ 1 callersFunctionstripPunct
(a string)
Chapter05/main.go:164
↓ 1 callersFunctiontoDocs
(a []*processedTweet)
Chapter05/main.go:45
↓ 1 callersMethodtrainOne
(example Example)
Chapter03/classifier.go:132
↓ 1 callersFunctiontransform
(it [][]float64, hdr []string, hints []bool)
Chapter02/main.go:361
↓ 1 callersFunctiontryNumCat
(a string, index map[string][]int, catStrs []string)
Chapter02/utils.go:10
next →1–100 of 156, ranked by callers