predict.nda: Calculation of predicted values of Generalized Network-based...

View source: R/predict.nda.R

predict.ndaR Documentation

Calculation of predicted values of Generalized Network-based Dimensionality Reduction and Analysis (GNDA)

Description

Calculation of predicted values of Generalized Network-based Dimensionality Reduction and Analysis (GNDA)

Usage

## S3 method for class 'nda'
predict(object, newdata, ...)

Arguments

object

An object of class 'nda'.

newdata

A required data frame in which to look for variables with which to predict.

...

further arguments passed to or from other methods.

Value

Residual values (data frame)

Author(s)

Zsolt T. Kosztyan*, Marcell T. Kurbucz, Attila I. Katona

e-mail*: kosztyan.zsolt@gtk.uni-pannon.hu

References

KosztyƔn, Z. T., Katona, A. I., Kurbucz, M. T., & Lantos, Z. (2024). Generalized network-based dimensionality analysis. Expert Systems with Applications, 238, 121779. <URL: https://doi.org/10.1016/j.eswa.2023.121779>.

See Also

plot, print, ndr.

Examples

# Example of prediction function of GNDA
set.seed(1) # Fix the random seed
data(swiss) # Use Swiss dataset
resdata<-swiss
sample <- sample(c(TRUE, FALSE), nrow(resdata), replace=TRUE, prob=c(0.9,0.1))
train <- resdata[sample, ] # Split the dataset to train and test
test <- resdata[!sample, ]
p<-ndr(train) # Use GNDA only on the train dataset
P<-ndr(swiss) # USE GNDA on the entire dataset
res<-predict(p,test) # Calculate the prediction to the test dataset
real<-P$scores[!sample, ]
cor(real,res) # The correlation between original and predicted values

kzst/nda documentation built on Dec. 16, 2024, 7:02 a.m.