Description Usage Arguments Details Value References See Also Examples
A function to build prediction model using Stochastic Gradient Descent (SGD) method.
1 |
dataTrain |
a data.frame that representing training data (m \times n), where m is the number of instances and n is the number of variables where the last column is the output variable. dataTrain must have at least two columns and ten rows of data that contain only numbers (integer or float). |
alpha |
a float value representing learning rate. Default value is 0.1 |
maxIter |
the maximal number of iterations. |
seed |
a integer value for static random. Default value is NULL, which means the function will not do static random. |
This function based on GD
method with optimization to use only one instance
of training data stochasticaly. So, SGD will perform fast computation and the learning.
However, the learning to reach minimum cost will become more unstable.
a vector matrix of theta (coefficient) for linear model.
N. Le Roux, M. Schmidt, F. Bach A Stochastic Gradient Method with an Exceptional Convergence Rate for Finite Training Sets, Advances in Neural Information Processing Systems, (2011)
1 2 3 4 5 6 7 8 9 10 11 12 | ##################################
## Learning and Build Model with SGD
## load R Package data
data(gradDescentRData)
## get z-factor data
dataSet <- gradDescentRData$CompressilbilityFactor
## split dataset
splitedDataSet <- splitData(dataSet)
## build model with SGD
SGDmodel <- SGD(splitedDataSet$dataTrain)
#show result
print(SGDmodel)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.