| Title: | General Regression Neural Networks Package |
|---|---|
| Description: | This General Regression Neural Networks Package uses various distance functions. It was motivated by Specht (1991, ISBN:1045-9227), and updated from previous published paper Li et al. (2016) <doi:10.1016/j.palaeo.2015.11.005>. This package includes various functions, although "euclidean" distance is used traditionally. |
| Authors: | Shufeng LI [aut, cre] (ORCID: <https://orcid.org/0000-0002-5144-4432>) |
| Maintainer: | Shufeng LI <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-06-05 09:55:35 UTC |
| Source: | https://github.com/shufeng-li/grnns |
Find best spread
findSpread(p_train, v_train, k, fun, scale = TRUE)findSpread(p_train, v_train, k, fun, scale = TRUE)
p_train |
The dataframe of training predictor dataset |
v_train |
The dataframe of training response variables |
k |
The numeric number of k folds |
fun |
The distance function |
scale |
The logic statements (TRUE/FALSE) |
Best spread
data("met") data("physg") ## Not run: best.spread<-findSpread(physg,met,10,"bray",scale=TRUE)data("met") data("physg") ## Not run: best.spread<-findSpread(physg,met,10,"bray",scale=TRUE)
find best spreads using Rdist
findSpreadRdist(x, y, k, fun, scale = TRUE)findSpreadRdist(x, y, k, fun, scale = TRUE)
x |
The dataframe of training predictor dataset |
y |
The dataframe of training response variables |
k |
The numeric number of k folds |
fun |
The distance function |
scale |
The logic statements (TRUE/FALSE) |
The vector of best spreads
Find best spread using vegan function
findSpreadVegan(x, y, k, fun, scale = TRUE)findSpreadVegan(x, y, k, fun, scale = TRUE)
x |
The dataframe of training predictor dataset |
y |
The dataframe of training response variables |
k |
The numeric number of k folds |
fun |
The distance function |
scale |
The logic statements (TRUE/FALSE) |
The vector of best spreads
This GRNNs uses various distance functions including: "euclidean", "minkowski", "manhattan", "maximum", "canberra", "angular", "correlation", "absolute_correlation", "hamming", "jaccard","bray", "kulczynski", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao","mahalanobis".
grnn(p_input, p_train, v_train, fun = "euclidean", best.spread, scale = TRUE)grnn(p_input, p_train, v_train, fun = "euclidean", best.spread, scale = TRUE)
p_input |
The dataframe of input predictors |
p_train |
The dataframe of training predictor dataset |
v_train |
The dataframe of training response variables |
fun |
The distance function |
best.spread |
The vector of best spreads |
scale |
The logic statements (TRUE/FALSE) |
The predictions
data("met") data("physg") best.spread<-c(0.33,0.33,0.31,0.34,0.35,0.35,0.32,0.31,0.29,0.35,0.35) predict<-physg[1,] physg.train<-physg[-1,] met.train<-met[-1,] prediction<-grnn(predict,physg.train,met.train,fun="euclidean",best.spread,scale=TRUE)data("met") data("physg") best.spread<-c(0.33,0.33,0.31,0.34,0.35,0.35,0.32,0.31,0.29,0.35,0.35) predict<-physg[1,] physg.train<-physg[-1,] met.train<-met[-1,] prediction<-grnn(predict,physg.train,met.train,fun="euclidean",best.spread,scale=TRUE)
grnn distance
grnn.distance(x, y, fun)grnn.distance(x, y, fun)
x |
The dataframe of training predictor dataset |
y |
The dataframe of training response variables |
fun |
The distance function |
The matrix of distance between a and b
data("physg") physg.train<-physg[1:10,] physg.test<-physg[11:30,] distance<-grnn.distance(physg.test,physg.train,"bray")data("physg") physg.train<-physg[1:10,] physg.test<-physg[11:30,] distance<-grnn.distance(physg.test,physg.train,"bray")
General Regression Neural Networks (GRNNs)
grnn.kfold(x, y, k, fun, scale = TRUE)grnn.kfold(x, y, k, fun, scale = TRUE)
x |
The dataframe of training predictor dataset |
y |
The dataframe of training response variables |
k |
The numeric number of k folds |
fun |
The distance function |
scale |
The logic statements (TRUE/FALSE) |
rmse,stdae,stdev,mae,r,pvalue,best spread
data("met") data("physg") results_kfold<-grnn.kfold(physg,met,10,"euclidean",scale=TRUE)data("met") data("physg") results_kfold<-grnn.kfold(physg,met,10,"euclidean",scale=TRUE)
Data from a global collection by Robert A. Spicer. It include 11 climate variables from 378 sites.
metmet
A data frame with 378 rows and 11 variables:
MATdouble COLUMN_DESCRIPTION
WMMTdouble COLUMN_DESCRIPTION
CMMTdouble COLUMN_DESCRIPTION
GROWSEASdouble COLUMN_DESCRIPTION
GSPdouble COLUMN_DESCRIPTION
MMGSPdouble COLUMN_DESCRIPTION
Three_WETdouble COLUMN_DESCRIPTION
Three_DRYdouble COLUMN_DESCRIPTION
RHdouble COLUMN_DESCRIPTION
SHdouble COLUMN_DESCRIPTION
ENTHALdouble COLUMN_DESCRIPTION
DETAILS
Data from a global collection by Robert A. Spicer. It include 31 leaf physiognomies variables from 378 sites.
physgphysg
A data frame with 378 rows and 31 variables:
Lobeddouble COLUMN_DESCRIPTION
No.Teethdouble COLUMN_DESCRIPTION
Regular.teethdouble COLUMN_DESCRIPTION
Close.teethdouble COLUMN_DESCRIPTION
Round.teethdouble COLUMN_DESCRIPTION
Acute.teethdouble COLUMN_DESCRIPTION
Compound.teethdouble COLUMN_DESCRIPTION
Nanophylldouble COLUMN_DESCRIPTION
Leptophyll.1double COLUMN_DESCRIPTION
Leptophyll.2double COLUMN_DESCRIPTION
Microphyll.1double COLUMN_DESCRIPTION
Microphyll.2double COLUMN_DESCRIPTION
Microphyll.3double COLUMN_DESCRIPTION
Mesophyll.1double COLUMN_DESCRIPTION
Mesophyll.2double COLUMN_DESCRIPTION
Mesophyll.3double COLUMN_DESCRIPTION
Emarginate.apexdouble COLUMN_DESCRIPTION
Round.apexdouble COLUMN_DESCRIPTION
Acute.apexdouble COLUMN_DESCRIPTION
Attenuate.apexdouble COLUMN_DESCRIPTION
Cordate.basedouble COLUMN_DESCRIPTION
Round.basedouble COLUMN_DESCRIPTION
Acute.basedouble COLUMN_DESCRIPTION
L.W..1.1double COLUMN_DESCRIPTION
L.W.1.2.1double COLUMN_DESCRIPTION
L.W.2.3.1double COLUMN_DESCRIPTION
L.W.3.4.1double COLUMN_DESCRIPTION
L.W..4.1double COLUMN_DESCRIPTION
Obovatedouble COLUMN_DESCRIPTION
Ellipticdouble COLUMN_DESCRIPTION
Ovatedouble COLUMN_DESCRIPTION
DETAILS
distance using vegdist
veg.distance(a, b, fun = "bray")veg.distance(a, b, fun = "bray")
a |
The dataframe of training predictor dataset |
b |
The dataframe of validation predictor dataset |
fun |
The distance function |
The matrix of distance between a and b
data("physg") physg.train<-physg[1:10,] physg.test<-physg[11:30,] distance<-veg.distance(physg.test,physg.train,"bray")data("physg") physg.train<-physg[1:10,] physg.test<-physg[11:30,] distance<-veg.distance(physg.test,physg.train,"bray")