MCPcopy Create free account

hub / github.com/cdipaolo/goml / functions

Functions339 in github.com/cdipaolo/goml

↓ 67 callersMethodLen
* implement sort.Interface for Frequency list *// Len gives the length of a frequency array
text/tfidf.go:56
↓ 39 callersFunctionabs
(x float64)
perceptron/perceptron_test.go:22
↓ 36 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
cluster/kmeans.go:251
↓ 36 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
cluster/triangle_kmeans.go:261
↓ 32 callersFunctionNormalizePoint
NormalizePoint is the same as Normalize, but it only operates on one singular datapoint, normalizing it's value to unit length.
base/munge.go:23
↓ 30 callersFunctionNewLogistic
NewLogistic takes in a learning rate alpha, a regularization parameter value (0 means no regularization, higher value means higher bias on the model,)
linear/logistic.go:98
↓ 25 callersFunctionNewLeastSquares
NewLeastSquares returns a pointer to the linear model initialized with the learning rate alpha, the training set trainingSet, and the expected results
linear/linear.go:133
↓ 24 callersMethodLearn
Learn takes the struct's dataset and expected results and runs batch gradient descent on them, optimizing theta so you can predict based on those resu
linear/logistic.go:203
↓ 24 callersFunctionNewSoftmax
NewSoftmax takes in a learning rate alpha, a regularization parameter value (0 means no regularization, higher value means higher bias on the model,)
linear/softmax.go:79
↓ 23 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
linear/logistic.go:179
↓ 22 callersMethodLearn
Learn takes the struct's dataset and expected results and runs gradient descent on them, optimizing theta so you can predict accurately based on those
linear/softmax.go:198
↓ 22 callersFunctionabs
(x float64)
linear/softmax.go:65
↓ 21 callersFunctiondiff
diff returns the square magnitude of the vector subtraction between u and v. This is also known as the Squared Euclidean Distance: diff(u, v) == |u -
cluster/kmeans.go:25
↓ 20 callersMethodLearn
Learn takes the struct's dataset and expected results and runs batch gradient descent on them, optimizing theta so you can predict based on those resu
linear/linear.go:236
↓ 19 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
linear/linear.go:214
↓ 15 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ
linear/softmax.go:164
↓ 14 callersFunctionmaxI
maxI returns the index of the maximum value of a slice of float64's
linear/softmax_test.go:88
↓ 13 callersFunctionSaveDataToCSV
SaveDataToCSV takes in a absolute filepath, as well as a 2D array of 'X' values and a 1D array of 'Y', or expected values, concatenates the format to
base/data.go:164
↓ 11 callersFunctionNewKernelPerceptron
NewKernelPerceptron takes in a learning rate alpha, the number of features (not including the constant term) being evaluated by the model, the update
perceptron/kernel_perceptron.go:79
↓ 11 callersMethodOnlineLearn
OnlineLearn runs off of the datastream within the Perceptron structure. Whenever the model makes a wrong prediction the parameter vector theta is upda
perceptron/kernel_perceptron.go:216
↓ 11 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ
perceptron/kernel_perceptron.go:89
↓ 11 callersMethodString
String implements the fmt interface for clean printing. Here we're using it to print the model as the equation h(θ)=... where h is the perceptron hypo
text/bayes.go:465
↓ 10 callersMethodPredict
Predict takes in a document, predicts the class of the document based on the training data passed so far, and returns the class estimated for the docu
text/bayes.go:277
↓ 10 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
cluster/knn.go:176
↓ 9 callersFunctionNewNaiveBayes
NewNaiveBayes returns a NaiveBayes model the given number of classes instantiated, ready to learn off the given data stream. The sanitization function
text/bayes.go:259
↓ 7 callersFunctionLinearKernel
LinearKernel is the base kernel function. It will return a valid kernel for use within models that can use the Kernel Trick. The resultant kernel just
base/kernel.go:58
↓ 7 callersFunctionNewPerceptron
NewPerceptron takes in a learning rate alpha, the number of features (not including the constant term) being evaluated by the model, the update callba
perceptron/perceptron.go:166
↓ 7 callersFunctionNormalize
Normalize takes in an array of arrays of inputs as well as the corresponding array of solutions and normalizes each 'row' of data to unit vector lengt
base/munge.go:14
↓ 7 callersMethodOnlineLearn
OnlineLearn runs off of the datastream within the Perceptron structure. Whenever the model makes a wrong prediction the parameter vector theta is upda
perceptron/perceptron.go:311
↓ 7 callersMethodOnlineLearn
OnlineLearn lets the NaiveBayes model learn from the datastream, waiting for new data to come into the stream from a separate goroutine
text/bayes.go:364
↓ 7 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ
perceptron/perceptron.go:189
↓ 7 callersMethodProbability
Probability takes in a small document, returns the estimated class of the document based on the model as well as the probability that the model is par
text/bayes.go:325
↓ 6 callersMethodOnlineLearn
OnlineLearn runs similar to using a fixed dataset with Stochastic Gradient Descent, but it handles data by passing it as a channal, and returns errors
linear/logistic.go:344
↓ 6 callersFunctioninsertSorted
insertSorted takes a array v, and inserts u into the list in the position such that the list is sorted inversely. The function will not change the len
cluster/knn.go:136
↓ 5 callersFunctionGaussianKernel
GaussianKernel takes in a parameter for sigma (σ) and returns a valid (Gaussian) Radial Basis Function Kernel. If the input dimensions aren't valid, t
base/kernel.go:17
↓ 5 callersMethodGet
Get looks up a word from h's Word map and should be used in place of a direct map lookup. The only caveat is that it will always return the 'success'
text/bayes.go:215
↓ 5 callersFunctionNewKMeans
NewKMeans returns a pointer to the k-means model, which clusters given inputs in an unsupervised manner. The algorithm only has one optimization metho
cluster/kmeans.go:163
↓ 5 callersFunctionNewTriangleKMeans
NewTriangleKMeans returns a pointer to the k-means model, which clusters given inputs in an unsupervised manner. The differences between this algorith
cluster/triangle_kmeans.go:183
↓ 5 callersMethodOnlineLearn
OnlineLearn runs similar to using a fixed dataset with Stochastic Gradient Descent, but it handles data by passing it as a channel, and returns errors
linear/linear.go:368
↓ 5 callersMethodTokenize
(string)
text/bayes.go:173
↓ 4 callersMethodLearn
Learn takes the struct's dataset and expected results and runs batch gradient descent on them, optimizing theta so you can predict based on those resu
cluster/kmeans.go:282
↓ 4 callersMethodLearn
Learn takes the struct's dataset and expected results and runs batch gradient descent on them, optimizing theta so you can predict based on those resu
cluster/triangle_kmeans.go:390
↓ 4 callersFunctionPolynomialKernel
PolynomialKernel takes in an optional constant (where any extra args passed will be added and count as the constant,) and a main arg of the degree of
base/kernel.go:97
↓ 4 callersMethodTFIDF
TFIDF returns the TermFrequency- InverseDocumentFrequency of a word within a corpus given by the trained NaiveBayes model Look at the TFIDF docs to s
text/tfidf.go:81
↓ 4 callersFunctionTanhKernel
TanhKernel takes in a required Kappa modifier parameter (defaults to 1.0 if 0.0 given,) and optional float64 args afterwords which will be added toget
base/kernel.go:142
↓ 4 callersMethodTokenize
Tokenize splits input sentences into a lowecase slice of strings. The tokenizer's SlitOn string is used as a delimiter and it
text/bayes.go:186
↓ 3 callersFunctionLoadDataFromCSV
LoadDataFromCSV takes in a path to a CSV file and loads that data into a Golang 2D array of 'X' values and a Golang 1D array of 'Y', or expected resul
base/data.go:31
↓ 3 callersFunctionNewKNN
NewKNN returns a pointer to the k-means model, which clusters given inputs in an unsupervised manner. The algorithm only has one optimization method (
cluster/knn.go:96
↓ 3 callersMethodPredict
Predict takes in a variable x (an array of floats,) and finds the value of the hypothesis function given the current parameter vector θ if normalize
linear/local_linear.go:223
↓ 2 callersFunctionEuclideanDistance
EuclideanDistance returns the distance betweek two float64 vectors. NOTE that this function does not check that the vectors are different lengths (to
base/distance.go:17
↓ 2 callersFunctionGradientAscent
GradientAscent operates on a Ascendable model and further optimizes the parameter vector Theta of the model, which is then used within the Predict fun
base/optimize.go:18
↓ 2 callersMethodInverseDocumentFrequency
InverseDocumentFrequency returns the 'uniqueness' of a word within the corpus defined within a trained NaiveBayes model. Look at the TFIDF docs to se
text/tfidf.go:174
↓ 2 callersMethodLearningRate
LearningRate returns the learning rate α to be used in Gradient Descent as the modifier term
base/model.go:128
↓ 2 callersFunctionLoadDataFromCSVToStream
LoadDataFromCSVToStream loads a CSV data file just like LoadDataFromCSV, but it pushes each row into a data channel as it scans. This is useful for ve
base/data.go:95
↓ 2 callersFunctionManhattanDistance
ManhattanDistance returns the manhattan distance between teo float64 vectors. This is the sum of the differences between each value Example Points: .
base/distance.go:45
↓ 2 callersMethodMaxIterations
MaxIterations returns the maximum number of iterations to try using gradient ascent. Might return after less if strong convergance is detected, but it
base/model.go:143
↓ 2 callersMethodMostImportantWords
MostImportantWords runs TFIDF on a whole document, returning the n most important words in the document. If n is greater than the number of words then
text/tfidf.go:96
↓ 2 callersFunctionNewLocalLinear
NewLocalLinear returns a pointer to the linear model initialized with the learning rate alpha, the training set trainingSet, and the expected results
linear/local_linear.go:143
↓ 2 callersMethodOnlineLearn
OnlineLearn runs similar to using a fixed dataset with Stochastic Gradient Descent, but it handles data by passing it as a channal, and returns errors
linear/softmax.go:422
↓ 2 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
text/bayes.go:477
↓ 2 callersMethodRestore
Restore takes the bytes of a NaiveBayes model and restores a model to it. It defaults the sanitizer to base.OnlyWordsAndNumbers and the tokenizer to t
text/bayes.go:506
↓ 2 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The only parameters no
text/bayes.go:537
↓ 2 callersMethodSet
Set sets word k's value to v in h's Word map
text/bayes.go:223
↓ 2 callersFunctionStochasticGradientAscent
StochasticGradientAscent operates on a StochasticAscendable model and further optimizes the parameter vector Theta of the model, which is then used wi
base/optimize.go:75
↓ 2 callersMethodTheta
Theta returns a pointer to the parameter vector theta, which is 1D vector of floats
base/model.go:137
↓ 2 callersMethodcomputeCentroidDistanceMatrix
computeCentroidDistanceMatrix, as said in the function name, computes the centroid distance matrix, saving it to the model. Note that because we only
cluster/triangle_kmeans.go:290
↓ 2 callersFunctionequalStringSlices
(a, b []string)
text/bayes_test.go:393
↓ 2 callersMethodweight
weight corresponds to the weight given between two datapoints (based on how 'far apart' they are.) w[i] = exp(-1 * |x[i] - x|^2 / 2σ^2)
linear/local_linear.go:347
↓ 1 callersMethodDij
Dij returns the derivative of the cost function J(θ) with respect to the j-th parameter of the hypothesis, θ[j], for the training example x[i]. Used i
linear/softmax.go:608
↓ 1 callersMethodDij
Dij returns the derivative of the cost function J(θ) with respect to the j-th parameter of the hypothesis, θ[j], for the training example x[i]. Used i
linear/local_linear.go:417
↓ 1 callersMethodDij
Dj returns the derivative of the cost function J(θ) with respect to the j-th parameter of the hypothesis, θ[j], for the training example x[i]. Called
base/model.go:165
↓ 1 callersMethodDj
Dj returns the partial derivative of the cost function J(θ) with respect to theta[k] where theta is the parameter vector associated with our hypothesi
linear/softmax.go:546
↓ 1 callersMethodDj
Dj returns the partial derivative of the cost function J(θ) with respect to theta[j] where theta is the parameter vector associated with our hypothesi
linear/local_linear.go:368
↓ 1 callersMethodDj
Dj returns the derivative of the cost function J(θ) with respect to the j-th parameter of the hypothesis, θ[j]. Called as Dj(j)
base/model.go:133
↓ 1 callersMethodExamples
Examples returns the number of examples in the training set the model is using
base/model.go:159
↓ 1 callersMethodOnlineLearn
* OnlineLearn implements a variant of the K-Means learning algorithm to work with streams of data. The basis of the model is discusses within this (ht
cluster/kmeans.go:496
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
linear/linear.go:599
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
linear/softmax.go:671
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
linear/logistic.go:556
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
perceptron/perceptron.go:417
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the parameter vector θ to the file, which can be restored later. The function will take paths fr
perceptron/kernel_perceptron.go:297
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the centroid vector to the file, which can be restored later. The function will take paths from
cluster/kmeans.go:603
↓ 1 callersMethodPersistToFile
PersistToFile takes in an absolute filepath and saves the centroid vector to the file, which can be restored later. The function will take paths from
cluster/triangle_kmeans.go:605
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The path must ba an a
linear/linear.go:627
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The path must ba an a
linear/softmax.go:699
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The path must ba an a
linear/logistic.go:584
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The path must ba an a
perceptron/perceptron.go:445
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a parameter vector theta and assigns the model it's operating on's parameter vector to that. The path must ba an a
perceptron/kernel_perceptron.go:325
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a centroid vector and assigns the model it's operating on's parameter vector to that. The path must ba an absolute
cluster/kmeans.go:631
↓ 1 callersMethodRestoreFromFile
RestoreFromFile takes in a path to a centroid vector and assigns the model it's operating on's parameter vector to that. The path must ba an absolute
cluster/triangle_kmeans.go:633
↓ 1 callersMethodRestoreWithFuncs
RestoreWithFuncs takes raw JSON data of a model and restores a model from it. The tokenizer and sanitizer passed in will be assigned to the restored m
text/bayes.go:513
↓ 1 callersMethodSaveClusteredData
SaveClusteredData takes operates on a k-means model, concatenating the given dataset with the assigned class from clustering and saving it to file. B
cluster/kmeans.go:586
↓ 1 callersMethodSaveClusteredData
SaveClusteredData takes operates on a k-means model, concatenating the given dataset with the assigned class from clustering and saving it to file. B
cluster/triangle_kmeans.go:588
↓ 1 callersFunctionTermFrequencies
TermFrequencies gives the TermFrequency of all words in a document, and is more efficient at doing so than calling that function multiple times
text/tfidf.go:143
↓ 1 callersMethodTermFrequency
TermFrequency returns the term frequency of a word within a corpus defined by the trained NaiveBayes model Look at the TFIDF docs to see more about h
text/tfidf.go:122
↓ 1 callersMethodrecalculateCentroids
recalculateCentroids assigns each centroid to the mean of all points assigned to it. This method is abstracted within the Triangle accelerated KMeans
cluster/triangle_kmeans.go:341
↓ 1 callersFunctionround
round rounds a float64
cluster/knn.go:161
FunctionBenchmarkNormalizePoint100Inputs
(b *testing.B)
base/munge_test.go:133
FunctionBenchmarkNormalizePoint1Input
* Benchmarks */
base/munge_test.go:104
FunctionBenchmarkNormalizePoint200Inputs
(b *testing.B)
base/munge_test.go:146
next →1–100 of 339, ranked by callers