predict.nda | R Documentation |
Calculation of predicted values of Generalized Network-based Dimensionality Reduction and Analysis (GNDA)
## S3 method for class 'nda'
predict(object, newdata, ...)
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. |
Residual values (data frame)
Zsolt T. Kosztyan*, Marcell T. Kurbucz, Attila I. Katona
e-mail*: kosztyan.zsolt@gtk.uni-pannon.hu
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>.
plot
, print
, ndr
.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.