Skip to content

Commit

Permalink
version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Denoeux authored and cran-robot committed Mar 20, 2017
1 parent dd9a001 commit 6bba0ee
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 119 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: evclass
Type: Package
Title: Evidential Distance-Based Classification
Version: 1.1.0
Date: 2016-07-01
Version: 1.1.1
Date: 2017-03-19
Author: Thierry Denoeux
Maintainer: Thierry Denoeux <tdenoeux@utc.fr>
Description: Different evidential distance-based classifiers, which provide
Expand All @@ -12,10 +12,10 @@ License: GPL-3
Depends: R (>= 3.1.0)
Imports: FNN
LazyData: TRUE
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
VignetteBuilder: knitr
Suggests: knitr,rmarkdown,datasets
NeedsCompilation: no
Packaged: 2016-07-01 08:58:55 UTC; Thierry
Packaged: 2017-03-19 10:12:39 UTC; Thierry
Repository: CRAN
Date/Publication: 2016-07-01 13:54:48
Date/Publication: 2017-03-20 05:22:18 UTC
46 changes: 23 additions & 23 deletions MD5
@@ -1,8 +1,8 @@
527ced758fbb3daf73e3d5cf8bc6a476 *DESCRIPTION
2ac5725c9684565bc95032c62073ad98 *DESCRIPTION
a5c2724892a74189c1da78b052dd85f5 *NAMESPACE
b1177ebc5f71a8b36341eb7ed2df0baf *R/EkNNfit.R
4a492283408257cfb90af408e81dd804 *R/EkNNinit.R
4ee80bfa2fcaef4a9742f1eb81c32225 *R/EkNNval.R
9eba1012e5420f0fc8e99b040b630cf2 *R/EkNNfit.R
54f63d0437bfb9db30002a0c68807569 *R/EkNNinit.R
5c687ee192237eda2c5247078ae8b688 *R/EkNNval.R
52a431a233d5075e603d3b52f9c9782c *R/classds.R
bba8fad3584d23527015bd66decb3bb5 *R/decision.R
b4b6d2da30c068ca1ebc7483aeab92c8 *R/evclass.R
Expand All @@ -12,27 +12,27 @@ aeaad4cb6952aa9e16d979f5b01f0950 *R/glass-data.R
20a8bb25740f8f2445eda7ea0460ec20 *R/harris.R
7c919b97eb312a99911bba45aa026664 *R/ionosphere-data.R
848b2e2c11ce455a332dd8b0e7306f75 *R/optimds.R
07349727a3fdec8e7adab2d787fb6bf9 *R/proDSfit.R
d290f1445c20f34e6c5f725d2088363f *R/proDSinit.R
0fd8bba09664d173f876e9336c328a12 *R/proDSval.R
9304dd06f9f4b678894aacd75ac0b33c *R/proDSfit.R
d17526659096bd88b364d14ab6a00a9f *R/proDSinit.R
0270969814396a980ecbf472d21b2492 *R/proDSval.R
a988fc277f3bfdb7f16cd8807d7bec4e *R/vehicles-data.R
66d6b013c497c3521de3206e5855209e *build/vignette.rds
b0638d895e5d86904eba4944778227e9 *build/vignette.rds
988e27d0f83a7ff327e4f38f089aeefd *data/glass.RData
b7fa49999b8679c81898cc5262ee0c81 *data/ionosphere.RData
1665c19c5134e390d23a6f938557c3b5 *data/vehicles.RData
533bbd19c4a779c4752827530d2c8ea5 *inst/doc/Introduction.R
0dfd3d1fa0aa29cdb381bc5545958d4b *inst/doc/Introduction.Rmd
4a4cdd01ee8bf578eb467911dadf5d18 *inst/doc/Introduction.html
692b0234dd3ae533733ef4382a3109b6 *man/EkNNfit.Rd
df9e6f51bbe7a511a71c62669b0369e9 *man/EkNNinit.Rd
5c6c7e59a33b0c199ea37c15e93b6f1a *man/EkNNval.Rd
1321ba273ed3af3992038c683ae4d242 *man/decision.Rd
f9877cda81848dcb74cf78427486b2e5 *man/evclass.Rd
ecf423e10f75e6dab5a7ced8a253575b *man/glass.Rd
144a8069c347be152abc7543780db1c2 *man/ionosphere.Rd
4f20dd9c17a3c66b6eda7e1c24012814 *man/proDSfit.Rd
19dc1316032dc586a3b83fd4d9b31945 *man/proDSinit.Rd
5d2098b37a40c37c063e2f93e705331f *man/proDSval.Rd
6d00db39a18df54421981daa1b761cdc *man/vehicles.Rd
0dfd3d1fa0aa29cdb381bc5545958d4b *vignettes/Introduction.Rmd
00ba0472a892302912cad89f89bee419 *inst/doc/Introduction.R
c2c200db2be802ed9dfab1407f4daf83 *inst/doc/Introduction.Rmd
fed14e726d8730357eb82981f07c9b30 *inst/doc/Introduction.html
e53ed775b823c9dc60c78956a46b22db *man/EkNNfit.Rd
a1b2eb0b85044b846f7970d78dc2e7a6 *man/EkNNinit.Rd
25aa6fbec299c876bffb0615065853ab *man/EkNNval.Rd
9db266f40815c32197786c75d1644512 *man/decision.Rd
3aaa9454280722f6c2912c40f9b5b7a9 *man/evclass.Rd
f9927ec9566b8148fac14075e694f06f *man/glass.Rd
ca25346bfe637ddd51b2217a7db2429c *man/ionosphere.Rd
e56e66f1b6c9344529db700bf4ddb5f5 *man/proDSfit.Rd
605f413649e45a313c05ff79a26f8da7 *man/proDSinit.Rd
cec96b0831ec4355fbccbdb83a5d5a55 *man/proDSval.Rd
822d0b76d472aaf0665a9c0d1118dd64 *man/vehicles.Rd
c2c200db2be802ed9dfab1407f4daf83 *vignettes/Introduction.Rmd
7a59c365f0124c990e37d0f2e8c9768c *vignettes/tdenoeux.bib
6 changes: 3 additions & 3 deletions R/EkNNfit.R
Expand Up @@ -7,7 +7,7 @@
#' @param x Input matrix of size n x d, where n is the number of objects and d the number of
#' attributes.
#' @param y Vector of class labels (of length n). May be a factor, or a vector of
#' integers.
#' integers from 1 to M (number of classes).
#' @param K Number of neighbors.
#' @param param Initial parameters (default: NULL).
#' @param alpha Parameter \eqn{\alpha} (default: 0.95)
Expand All @@ -26,7 +26,7 @@
#' \item{param}{The optimized parameters.}
#' \item{cost}{Final value of the cost function.}
#' \item{err}{Leave-one-out error rate.}
#' \item{ypred}{Leave-one-out predicted class labels.}
#' \item{ypred}{Leave-one-out predicted class labels (coded as integers from 1 to M).}
#' \item{m}{Leave-one-out predicted mass functions. The first M columns correspond
#' to the mass assigned to each class. The last column corresponds to the mass
#' assigned to the whole set of classes.}
Expand Down Expand Up @@ -55,7 +55,7 @@
#' fit<-EkNNfit(x,y,K=5)
EkNNfit<-function(x,y,K,param=NULL,alpha=0.95,lambda=1/max(as.numeric(y)),optimize=TRUE,
options=list(maxiter=300,eta=0.1,gain_min=1e-6,disp=TRUE)){
y<-as.numeric(y)
y<-as.integer(as.factor(y))
x<-as.matrix(x)
if(is.null(param)) param<-EkNNinit(x,y,alpha)
knn<-get.knn(x,k=K)
Expand Down
4 changes: 2 additions & 2 deletions R/EkNNinit.R
Expand Up @@ -11,7 +11,7 @@
#' @param x Input matrix of size n x d, where n is the number of objects and d the number of
#' attributes.
#' @param y Vector of class lables (of length n). May be a factor, or a vector of
#' integers.
#' integers from 1 to M (number of classes).
#' @param alpha Parameter \eqn{\alpha}.
#'
#' @return A list with two elements:
Expand Down Expand Up @@ -43,7 +43,7 @@
#' param<-EkNNinit(x,y)
#' param
EkNNinit<-function(x,y,alpha=0.95){
y<-as.numeric(y)
y<-as.integer(as.factor(y))
x<-as.matrix(x)
M<-max(y)
gamm<-rep(0,M)
Expand Down
12 changes: 6 additions & 6 deletions R/EkNNval.R
Expand Up @@ -9,20 +9,20 @@
#' @param xtrain Matrix of size ntrain x d, containing the values of the d attributes for the
#' training data.
#' @param ytrain Vector of class labels for the training data (of length ntrain). May
#' be a factor, or a vector of integers.
#' be a factor, or a vector of integers from 1 to M (number of classes).
#' @param xtst Matrix of size ntst x d, containing the values of the d attributes for the
#' test data.
#' @param K Number of neighbors.
#' @param ytst Vector of class labels for the test data (optional). May
#' be a factor, or a vector of integers.
#' be a factor, or a vector of integers from 1 to M (number of classes).
#' @param param Parameters, as returned by \code{\link{EkNNfit}}.
#'
#' @return A list with three elements:
#' \describe{
#' \item{m}{Predicted mass functions for the test data. The first M columns correspond
#' to the mass assigned to each class. The last column corresponds to the mass
#' assigned to the whole set of classes.}
#' \item{ypred}{Predicted class labels for the test data.}
#' \item{ypred}{Predicted class labels for the test data (coded as integers from 1 to M).}
#' \item{err}{Test error rate.}
#' }
#'
Expand Down Expand Up @@ -54,11 +54,11 @@
#' fit<-EkNNfit(xtrain,ytrain,K)
#' test<-EkNNval(xtrain,ytrain,xtst,K,ytst,fit$param)
EkNNval <- function(xtrain,ytrain,xtst,K,ytst=NULL,param=NULL){

xtst<-as.matrix(xtst)
xtrain<-as.matrix(xtrain)
ytrain<-as.numeric(ytrain)
if(!is.null(ytst)) ytst<-as.numeric(ytst)
ytrain<-y<-as.integer(as.factor(ytrain))
if(!is.null(ytst)) ytst<-y<-as.integer(as.factor(ytst))

if(is.null(param)) param<-EkNNinit(xtrain,ytrain)

Expand Down
4 changes: 2 additions & 2 deletions R/proDSfit.R
Expand Up @@ -10,7 +10,7 @@
#' @param x Input matrix of size n x d, where n is the number of objects and d the number of
#' attributes.
#' @param y Vector of class lables (of length n). May be a factor, or a vector of
#' integers.
#' integers from 1 to M (number of classes).
#' @param param Initial parameters (see \code{link{proDSinit}}).
#' @param lambda Parameter of the cost function. If \code{lambda=1}, the
#' cost function measures the error between the plausibilities and the 0-1 target values.
Expand Down Expand Up @@ -55,7 +55,7 @@
proDSfit <- function(x,y,param,lambda=1/max(as.numeric(y)),mu=0,optimProto=TRUE,
options=list(maxiter=500,eta=0.1,gain_min=1e-4,disp=10)){
x<-as.matrix(x)
y<-as.numeric(y)
y<-as.integer(as.factor(y))
M<-max(y)
n<-nrow(param$W)
p<-ncol(param$W)
Expand Down
4 changes: 2 additions & 2 deletions R/proDSinit.R
Expand Up @@ -10,7 +10,7 @@
#' @param x Input matrix of size n x d, where n is the number of objects and d the number of
#' attributes.
#' @param y Vector of class lables (of length n). May be a factor, or a vector of
#' integers.
#' integers from 1 to M (number of classes).
#' @param nproto Number of prototypes.
#' @param nprotoPerClass Boolean. If TRUE, there are \code{nproto} prototypes per class. If
#' FALSE (default), the total number of prototypes is equal to \code{nproto}.
Expand Down Expand Up @@ -44,7 +44,7 @@
#' param0<-proDSinit(xapp,yapp,nproto=7)
#' param0
proDSinit<- function(x,y,nproto,nprotoPerClass=FALSE,crisp=FALSE){
y<-as.numeric(y)
y<-as.integer(as.factor(y))
x<-as.matrix(x)
M <- max(y)
N <- nrow(x)
Expand Down
5 changes: 3 additions & 2 deletions R/proDSval.R
Expand Up @@ -7,7 +7,7 @@
#' @param x Matrix of size n x d, containing the values of the d attributes for the test data.
#' @param param Neural network parameters, as provided by \code{\link{proDSfit}}.
#' @param y Optional vector of class labels for the test data. May be a factor, or a vector of
#' integers.
#' integers from 1 to M (number of classes).
#'
#' @return A list with three elements:
#' \describe{
Expand Down Expand Up @@ -48,6 +48,7 @@ proDSval<-function(x,param,y=NULL){
n<-nrow(param$W)
p<-ncol(param$W)
x<-as.matrix(x)
y<-as.integer(as.factor(y))
N <- nrow(x)
M <- ncol(param$beta)
x<-t(x)
Expand All @@ -71,7 +72,7 @@ proDSval<-function(x,param,y=NULL){
ypred<-max.col(mk[,1:M])

if(!is.null(y)){
err<-length(which(as.numeric(y)!=ypred))/N
err<-length(which(y!=ypred))/N
} else err<-NULL

return(list(m=mk,ypred=ypred,err=err))
Expand Down
Binary file modified build/vignette.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/doc/Introduction.R
Expand Up @@ -81,7 +81,7 @@ Dupper<-Dlower
Dpig<-Dlower
for(i in 1:nx){
X<-matrix(c(rep(xx[i],ny),yy),ny,2)
val<-proDSval(X,fit$param,rep(0,ny))
val<-proDSval(X,fit$param)
Dupper[i,]<-decision(val$m,L=L,rule='upper')
Dlower[i,]<-decision(val$m,L=L,rule='lower')
Dpig[i,]<-decision(val$m,L=L,rule='pignistic')
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/Introduction.Rmd
Expand Up @@ -154,7 +154,7 @@ Dupper<-Dlower
Dpig<-Dlower
for(i in 1:nx){
X<-matrix(c(rep(xx[i],ny),yy),ny,2)
val<-proDSval(X,fit$param,rep(0,ny))
val<-proDSval(X,fit$param)
Dupper[i,]<-decision(val$m,L=L,rule='upper')
Dlower[i,]<-decision(val$m,L=L,rule='lower')
Dpig[i,]<-decision(val$m,L=L,rule='pignistic')
Expand Down
59 changes: 29 additions & 30 deletions inst/doc/Introduction.html

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions man/EkNNfit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions man/EkNNinit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions man/EkNNval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/decision.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/evclass.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/glass.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/ionosphere.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6bba0ee

Please sign in to comment.