Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PacktPublishing/Go-Machine-Learning-Projects
/ functions
Functions
156 in github.com/PacktPublishing/Go-Machine-Learning-Projects
⨍
Functions
156
◇
Types & classes
22
↓ 27 callers
Method
do
(fn func() (tensor.Tensor, error))
Chapter06/rawnn.go:150
↓ 18 callers
Function
makeRS
makeRS creates a ranged slice. It takes an optional step param.
Chapter06/utils.go:12
↓ 17 callers
Function
dieIfErr
(err error)
Chapter04/main.go:113
↓ 13 callers
Function
mHandleErr
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 callers
Function
dieIfErr
* func main() { twitter := anaconda.NewTwitterApiWithCredentials(ACCESSTOKEN, ACCESSTOKENSECRET, CONSUMERKEY, CONSUMERSECRET) raw, err := twitter.Ge
Chapter05/main.go:411
↓ 10 callers
Method
String
()
Chapter03/classifier.go:22
↓ 5 callers
Function
argmax
(a []float64)
Chapter06/main.go:136
↓ 5 callers
Function
newTSPlot
(xs []time.Time, ys []float64, seriesName string)
Chapter04/plotutil.go:85
↓ 5 callers
Function
visualize
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 callers
Method
Predict
(a tensor.Tensor)
Chapter06/rawnn.go:29
↓ 3 callers
Function
asMatrix
(a []*processedTweet)
Chapter05/main.go:174
↓ 3 callers
Method
learnables
()
Chapter07/main.go:83
↓ 3 callers
Function
naughtyGrayscale
(dst []uint8, src *image.NRGBA)
Chapter08/gocv.go:119
↓ 3 callers
Function
pixelWeight
(px byte)
Chapter06/mnist.go:97
↓ 3 callers
Function
writeToPng
(a interface{}, title, filename string, width, height vg.Length)
Chapter04/plotutil.go:147
↓ 3 callers
Function
zca
(data tensor.Tensor)
Chapter06/preprocess.go:11
↓ 2 callers
Method
Predict
(sentence []string)
Chapter03/classifier.go:118
↓ 2 callers
Method
Score
(sentence []string)
Chapter03/classifier.go:91
↓ 2 callers
Method
Step
()
Chapter07/main.go:52
↓ 2 callers
Method
Train
X is the image, Y is a one hot vector
Chapter06/rawnn.go:63
↓ 2 callers
Function
avg
(a []float64)
Chapter06/main.go:147
↓ 2 callers
Function
byClusters
(a []int, expectedClusters int)
Chapter05/main.go:182
↓ 2 callers
Function
clean
hints is a slice of bools indicating whether it's a categorical variable
Chapter02/main.go:157
↓ 2 callers
Function
convert
convert converts a string into a slice of floats
Chapter02/main.go:107
↓ 2 callers
Function
fillRandom
(a []float64, v float64)
Chapter06/rawnn.go:136
↓ 2 callers
Function
ingest
ingest is a function that ingests the file and outputs the header, data, and index.
Chapter02/main.go:43
↓ 2 callers
Function
load
(r io.Reader)
Chapter05/main.go:212
↓ 2 callers
Function
log1pCol
log1pCol applies the log1p transformation on a column
Chapter02/main.go:234
↓ 2 callers
Function
naughtyToImage
(m *gocv.Mat, imge image.Image)
Chapter08/gocv.go:75
↓ 2 callers
Function
pigoSetup
(width, height int)
Chapter08/gocv.go:35
↓ 2 callers
Function
plotDecomposed
(xs []time.Time, a stl.Result)
Chapter04/plotutil.go:137
↓ 2 callers
Function
plotHist
plotHist plots the histogram of a slice of float64s.
Chapter02/main.go:272
↓ 2 callers
Function
prepareX
(M []RawImage)
Chapter06/mnist.go:109
↓ 2 callers
Function
prepareY
(N []Label)
Chapter06/mnist.go:122
↓ 2 callers
Function
readImageFile
(r io.Reader, e error)
Chapter06/mnist.go:61
↓ 2 callers
Function
readLabelFile
(r io.Reader, e error)
Chapter06/mnist.go:35
↓ 2 callers
Function
reversePixelWeight
(px float64)
Chapter07/mnist.go:105
↓ 2 callers
Function
reversePixelWeight
(px float64)
Chapter06/mnist.go:105
↓ 2 callers
Function
scale
(a [][]float64, j int)
Chapter02/utils.go:85
↓ 2 callers
Function
sum
(a []float64)
Chapter06/main.go:152
↓ 2 callers
Function
visualizeWeights
(w tensor.Tensor, rows, cols int, filename string)
Chapter07/mnist.go:213
↓ 2 callers
Function
visualizeWeights
(w tensor.Tensor, rows, cols int, filename string)
Chapter06/mnist.go:213
↓ 1 callers
Function
CEF
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 callers
Method
DataRange
()
Chapter04/plotutil.go:66
↓ 1 callers
Method
Dims
()
Chapter02/main.go:291
↓ 1 callers
Function
New
(input, hidden, output int)
Chapter06/rawnn.go:16
↓ 1 callers
Function
New
()
Chapter03/classifier.go:53
↓ 1 callers
Method
Postprocess
()
Chapter03/classifier.go:70
↓ 1 callers
Method
Start
()
Chapter07/main.go:50
↓ 1 callers
Method
Train
(examples []Example)
Chapter03/classifier.go:64
↓ 1 callers
Function
argmax
(a [MAXCLASS]float64)
Chapter03/classifier.go:173
↓ 1 callers
Function
byClusters2
(a []dmmclust.Cluster, expectedClusters int)
Chapter05/main.go:204
↓ 1 callers
Function
cardinality
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 callers
Function
cleanup
(sigChan chan os.Signal, doneChan chan bool, profiling bool)
Chapter07/main.go:322
↓ 1 callers
Function
convertCategorical
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 callers
Function
dbscan
(a []*processedTweet)
Chapter05/main.go:355
↓ 1 callers
Function
dmm
(a []*processedTweet, expC int, corpusSize int)
Chapter05/main.go:330
↓ 1 callers
Function
forecastTime
(dates []time.Time, forwards int)
Chapter04/main.go:119
↓ 1 callers
Method
fwd
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 callers
Function
gocvClassifier
()
Chapter08/gocv.go:26
↓ 1 callers
Function
hw
(a stl.Result, periodicity, forward int, alpha, beta, gamma float64)
Chapter04/main.go:129
↓ 1 callers
Function
imputeCategorical
imputeCategorical replaces "NA" with the mode of categorical values
Chapter02/main.go:95
↓ 1 callers
Function
inList
(a string, l []string)
Chapter02/utils.go:36
↓ 1 callers
Function
ingest
(typ string)
Chapter03/ingest.go:24
↓ 1 callers
Function
ingestOneFile
(abspath string)
Chapter03/ingest.go:68
↓ 1 callers
Function
invSqrt
(epsilon float64)
Chapter06/preprocess.go:61
↓ 1 callers
Function
iqr
iqr finds the interquartile range
Chapter02/utils.go:46
↓ 1 callers
Function
kmeans
(a []*processedTweet, expC int)
Chapter05/main.go:345
↓ 1 callers
Function
knn
(a [][]float64, k int, distance func(a, b []float64) float64)
Chapter05/knn.go:7
↓ 1 callers
Function
largestCluster2
(clusters []dmmclust.Cluster)
Chapter05/main.go:250
↓ 1 callers
Function
minusMean
(a tensor.Tensor)
Chapter06/preprocess.go:68
↓ 1 callers
Function
mode
mode finds the most common value for each variable
Chapter02/main.go:80
↓ 1 callers
Function
newConvNet
(g *gorgonia.ExprGraph)
Chapter07/main.go:62
↓ 1 callers
Function
newProcessor
()
Chapter05/main.go:64
↓ 1 callers
Function
newResidPlot
(xs []time.Time, ys []float64, seriesName string)
Chapter04/plotutil.go:114
↓ 1 callers
Function
parse
(l loader)
Chapter04/main.go:37
↓ 1 callers
Function
parseDates
(a []string)
Chapter04/utils.go:11
↓ 1 callers
Function
parseDecimalDate
parseDecimalDate takes a string in format of a decimal date "2018.05" and converts it into a date.
Chapter04/utils.go:26
↓ 1 callers
Function
pixelWeight
(px byte)
Chapter07/mnist.go:97
↓ 1 callers
Function
plotCEF
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 callers
Function
plotHeatMap
(corr mat.Matrix, labels []string)
Chapter02/main.go:306
↓ 1 callers
Function
plotKNNDist
(a []float64)
Chapter05/main.go:321
↓ 1 callers
Function
prepareX
(M []RawImage)
Chapter07/mnist.go:109
↓ 1 callers
Function
prepareY
(N []Label)
Chapter07/mnist.go:122
↓ 1 callers
Method
priors
()
Chapter03/classifier.go:142
↓ 1 callers
Method
prob
(word string, class Class)
Chapter03/classifier.go:155
↓ 1 callers
Method
process
(a []*processedTweet)
Chapter05/main.go:106
↓ 1 callers
Function
readImageFile
(r io.Reader, e error)
Chapter07/mnist.go:61
↓ 1 callers
Function
readLabelFile
(r io.Reader, e error)
Chapter07/mnist.go:35
↓ 1 callers
Function
runRegression
(Xs [][]float64, Ys []float64, hdr []string)
Chapter02/main.go:392
↓ 1 callers
Function
shuffle
(a []Example)
Chapter03/classifier.go:186
↓ 1 callers
Function
shuffle
(a [][]float64, b []float64)
Chapter02/utils.go:114
↓ 1 callers
Function
shuffleX
(a [][]float64)
Chapter06/main.go:125
↓ 1 callers
Method
single
(word string)
Chapter05/main.go:79
↓ 1 callers
Function
skew
skew returns the skewness of a column/variable
Chapter02/main.go:223
↓ 1 callers
Function
stripPunct
(a string)
Chapter05/main.go:164
↓ 1 callers
Function
toDocs
(a []*processedTweet)
Chapter05/main.go:45
↓ 1 callers
Method
trainOne
(example Example)
Chapter03/classifier.go:132
↓ 1 callers
Function
transform
(it [][]float64, hdr []string, hints []bool)
Chapter02/main.go:361
↓ 1 callers
Function
tryNumCat
(a string, index map[string][]int, catStrs []string)
Chapter02/utils.go:10
next →
1–100 of 156, ranked by callers