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] |
Maintainer: | Shufeng LI <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-02-06 03:56:36 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.
met
met
A data frame with 378 rows and 11 variables:
MAT
double COLUMN_DESCRIPTION
WMMT
double COLUMN_DESCRIPTION
CMMT
double COLUMN_DESCRIPTION
GROWSEAS
double COLUMN_DESCRIPTION
GSP
double COLUMN_DESCRIPTION
MMGSP
double COLUMN_DESCRIPTION
Three_WET
double COLUMN_DESCRIPTION
Three_DRY
double COLUMN_DESCRIPTION
RH
double COLUMN_DESCRIPTION
SH
double COLUMN_DESCRIPTION
ENTHAL
double COLUMN_DESCRIPTION
DETAILS
Data from a global collection by Robert A. Spicer. It include 31 leaf physiognomies variables from 378 sites.
physg
physg
A data frame with 378 rows and 31 variables:
Lobed
double COLUMN_DESCRIPTION
No.Teeth
double COLUMN_DESCRIPTION
Regular.teeth
double COLUMN_DESCRIPTION
Close.teeth
double COLUMN_DESCRIPTION
Round.teeth
double COLUMN_DESCRIPTION
Acute.teeth
double COLUMN_DESCRIPTION
Compound.teeth
double COLUMN_DESCRIPTION
Nanophyll
double COLUMN_DESCRIPTION
Leptophyll.1
double COLUMN_DESCRIPTION
Leptophyll.2
double COLUMN_DESCRIPTION
Microphyll.1
double COLUMN_DESCRIPTION
Microphyll.2
double COLUMN_DESCRIPTION
Microphyll.3
double COLUMN_DESCRIPTION
Mesophyll.1
double COLUMN_DESCRIPTION
Mesophyll.2
double COLUMN_DESCRIPTION
Mesophyll.3
double COLUMN_DESCRIPTION
Emarginate.apex
double COLUMN_DESCRIPTION
Round.apex
double COLUMN_DESCRIPTION
Acute.apex
double COLUMN_DESCRIPTION
Attenuate.apex
double COLUMN_DESCRIPTION
Cordate.base
double COLUMN_DESCRIPTION
Round.base
double COLUMN_DESCRIPTION
Acute.base
double COLUMN_DESCRIPTION
L.W..1.1
double COLUMN_DESCRIPTION
L.W.1.2.1
double COLUMN_DESCRIPTION
L.W.2.3.1
double COLUMN_DESCRIPTION
L.W.3.4.1
double COLUMN_DESCRIPTION
L.W..4.1
double COLUMN_DESCRIPTION
Obovate
double COLUMN_DESCRIPTION
Elliptic
double COLUMN_DESCRIPTION
Ovate
double 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")