prediction: Predicting Function for Linear Model

Description Usage Arguments Details Value See Also Examples

Description

A function to predict testing data with built gradient descent model

Usage

1
prediction(model, dataTestInput)

Arguments

model

a matrix of coefficients used as a linear model to predict testing data input. This parameter exclusively produced by the gradient-descent-based learning function.

dataTestInput

a data.frame represented dataset with input variables only (m \times n-1), where m is the number of instances and n is the number of input variables only.

Details

This function used to predict testing data with only input variable named dataTestInput. The model parameter is the coefficients that produced by gradient-descent-based learning function. The result of this function is a dataset that contains dataTestInput combined with prediction data as the last column of dataset.

Value

a data.frame of testing data input variables and prediction variables.

See Also

GD, MBGD, SGD, SAGD, MGD, AGD, ADAGRAD, ADADELTA RMSPROP, ADAM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 
################################## 
## Predict Testing Data Using GD Model
## load R Package data  
data(gradDescentRData)
## get z-factor Data
dataSet <- gradDescentRData$CompressilbilityFactor
## do variance scaling to dataset
featureScalingResult <- varianceScaling(dataSet)
## split dataset
splitedDataSet <- splitData(featureScalingResult$scaledDataSet)
## built model using GD
model <- GD(splitedDataSet$dataTrain)
## separate testing data with input only
dataTestInput <- (splitedDataSet$dataTest)[,1:ncol(splitedDataSet$dataTest)-1]
## predict testing data using GD model
prediction <- prediction(model,dataTestInput)
## show result()
prediction
    
        

gradDescentR documentation built on March 9, 2017, 9:02 a.m.