search for: nn1

Displaying 20 results from an estimated 22 matches for "nn1".

Did you mean: nn
2009 Feb 18
1
Training nnet in two ways, trying to understand the performance difference - with (i hope!) commented, minimal, self-contained, reproducible code
...m dataset from package kernlab >data(list = "spam", package = "kernlab") >set.seed(42) >my.sample <- sample(nrow(spam), 3221) >spam.train <- spam[my.sample, ] >spam.test <- spam[-my.sample, ] ## Example 1 - my own code # train artificial neural network (nn1) >( nn1 <- nnet(type~., data=spam.train, size=3, decay=0.1, maxit=1000) ) # predict spam.test dataset on nn1 > ( nn1.pr.test <- predict(nn1, spam.test, type='class') ) [1] "spam" "spam" "spam" "spam" "nonspam" &quo...
2006 Aug 16
0
Regular expressions: retrieving matches depending on intervening strings [Follow-up]
Dear all This is a follow-up to an earlier posting today regarding a regular expression question. In the meantime, this is the best approximation I could come up with and should give you a better idea what I am talking about. a<-c("<w AT0>a <w NN1>blockage <w CJC>and <w DT0>that<c PUN>.", "<w AT0>a <w NN1>blockage <w CJC>and <ptr target=KB2LC003><w DT0>that<c PUN>.", "<w AT0>a <w NN1>blockage <w CJC>and<c PUN>, <w DT0>that<...
2009 May 12
0
FW: neural network not using all observations
As a follow-up to my email below: The input data frame to nnet() has dimensions: > dim(coreaff.trn.nn) [1] 5088 8 And the predictions from the neural network (35 records are dropped - see email below for more details) has dimensions: > pred <- predict(coreaff.nn1) > dim(pred) [1] 5053 1 So, the following line of R code does not work as the dimensions are different. > sum((coreaff.trn.nn$hh.iast.y - predict(coreaff.nn1))^2) Error: dims [product 5053] do not match the length of object [5088] In addition: Warning message: In coreaff.trn.n...
2009 May 12
0
How do I extract the scoring equations for neural networks and support vector machines?
...bservations As a follow-up to my email below: The input data frame to nnet() has dimensions: > dim(coreaff.trn.nn) [1] 5088 8 And the predictions from the neural network (35 records are dropped - see email below for more details) has dimensions: > pred <- predict(coreaff.nn1) > dim(pred) [1] 5053 1 So, the following line of R code does not work as the dimensions are different. > sum((coreaff.trn.nn$hh.iast.y - predict(coreaff.nn1))^2) Error: dims [product 5053] do not match the length of object [5088] In addition: Warning message: In coreaff.trn.nn$...
2006 Sep 11
2
Translating R code + library into Fortran?
...ead.table("bayest.par") names(stadler)=c("exp.shift","exp.scale","exp.shape") cell.size=20 sim.size=600 #first train initial neural nets training.data=data.gen(1e4,cell.size,cell.size,.1,1,.1,1,1,4) #train nn.shift with error checking ok=F while(ok==F){ nn1.shift=nnet(exp.shift~min+q1+med+mean+q3+max+samples,data=training.data,size=8,linout=T,rang=1e-08,maxit=500,trace=F) cor.shift=predict(nn.shift,training.data[,c(1:7)],type="raw") temp=hist(cor.shift,plot=F) if(length(temp$counts[temp$counts>0])>10){ ok=T } }...
2012 Jul 24
3
Nearest Neighbors
I was wondering if there is a way in R to find k nearest neighbors of various orders, say order 2, 3, or 4. In otherwords neighbors of neighbors of neighbors. You get the idea. I know that I can use knearneigh(matrix.data, k) but this only gives me the k nearest neighbors and not of a particular order. Thanks in advance. -- View this message in context:
2009 May 12
0
neural network not using all observations
...0 0 5 484253 -0.6112205 -0.7306664 0.64013414 0.07979137 1 0 0 6 799054 0.6580506 1.1763114 0.24784295 0.07979137 0 1 1 > coreaff.nn1 <- nnet(hh.iast.y ~ WC_Total_Assets + all_assets_per_hh + age + tenure + max_acc_ownr_liq_asts_n_med + + max_acc_ownr_nwrth_n_med + max_acc_ownr_ann_incm_n_med, coreaff.trn.nn, size = 2, decay = 1e-3, + linout = T, skip = T, maxit = 1000, Hess = T) # we...
2008 Jun 12
1
About Mcneil Hanley test for a portion of AUC!
...ion cROC. I can only find the value of "r" for the whole AUC's . > seROC<-function(AUC,na,nn){ > a<-AUC > q1<-a/(2-a) > q2<-(2*a^2)/(1+a) > se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na)) > se > } > > cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){ > se1<-seROC(AUC1,na1,nn1) > se2<-seROC(AUC2,na2,nn2) > > sed<-sqrt(se1^2+se2^2-2*r*se1*se2) > zad<-(AUC1-AUC2)/sed > p<-dnorm(zad) > a<-list(zad,p) > a Could somebody kindly suggest me how to calculate the value of "r" or some w...
2006 Mar 15
1
How to compare areas under ROC curves calculated with ROCR package
.... I used the following program I found on R-help archives : From: Bernardo Rangel Tura Date: Thu 16 Dec 2004 - 07:30:37 EST seROC<-function(AUC,na,nn){ a<-AUC q1<-a/(2-a) q2<-(2*a^2)/(1+a) se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na)) se } cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){ se1<-seROC(AUC1,na1,nn1) se2<-seROC(AUC2,na2,nn2) sed<-sqrt(se1^2+se2^2-2*r*se1*se2) zad<-(AUC1-AUC2)/sed p<-dnorm(zad) a<-list(zad,p) a } The author of this script says: "The first function (seROC) calculate the standard error of ROC curve, the second fun...
2006 Mar 20
1
How to compare areas under ROC curves calculated with ROC R package
.... I used the following program I found on R-help archives : From: Bernardo Rangel Tura Date: Thu 16 Dec 2004 - 07:30:37 EST seROC<-function(AUC,na,nn){ a<-AUC q1<-a/(2-a) q2<-(2*a^2)/(1+a) se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na)) se } cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){ se1<-seROC(AUC1,na1,nn1) se2<-seROC(AUC2,na2,nn2) sed<-sqrt(se1^2+se2^2-2*r*se1*se2) zad<-(AUC1-AUC2)/sed p<-dnorm(zad) a<-list(zad,p) a } The author of this script says: "The first function (seROC) calculate the standard error of ROC curve, the second fun...
2012 Aug 01
3
Neuralnet Error
I require some help in debugging this codeĀ  library(neuralnet) ir<-read.table(file="iris_data.txt",header=TRUE,row.names=NULL) ir1 <- data.frame(ir[1:100,2:6]) ir2 <- data.frame(ifelse(ir1$Species=="setosa",1,ifelse(ir1$Species=="versicolor",0,""))) colnames(ir2)<-("Output") ir3 <- data.frame(rbind(ir1[1:4],ir2))
2006 Jun 23
1
Problems creating packages.
...root Here is a sample .r file format: ########################################################################### # # Freq function returns the frequencies of numerical vectors # ########################################################################### freq = function(x1,x2,x3){ nn1=rep(0, length(x)) nn2=rep(0, length(x)) nn3=rep(0, length(x)) for ( i in 1:length(x)){ nn1[i]=sum(x[i]==x1) nn2[i]=sum(x[i]==x2) nn3[i]=sum(x[i]==x3) } mm = as.matrix(rbind(nn1,nn2,nn3)) mm } Here is a sample man page format: \name{freq} \ali...
2009 Jun 02
2
What do you think about my function?
...a mistake!) ########## My function ############################################# dzieci<-transform(dzieci, zywnosc=0) zywnoscCalosc<- function( jedzenie, sklep, n1, n2, n3, n4, d1, d2, d3, d4 ) { skl <- sklep wynik <- vector() wynik <- jedzenie ndf <- data.frame(nn1=n1,nn2=n2,nn3=n3,nn4=n4) ddf <- data.frame(dd1=d1,dd2=d2,dd3=d3,dd4=d4) for (i in 1:length(n1)){ wekt_n = ndf[i,] wekt_d = ddf[i,] wekt_n_ok = wekt_n[!is.na(wekt_n)] wekt_n_ok = as.numeric(wekt_n_ok) wekt_d_ok = wekt_d[!is.na(wekt_d)] wekt_d_ok = as...
2009 May 31
1
Error:non-numeric argument in my function
Hello! I have a function: zywnoscCalosc<- function( jedzenie, n1, n2, n3, n4, d1, d2, d3, d4 ) { ndf <- data.frame(nn1=n1,nn2=n2,nn3=n3,nn4=n4) ddf <- data.frame(dd1=d1,dd2=d2,dd3=d3,dd4=d4) for (i in 1:length(n1)){ wekt_n = ndf[i,] wekt_n_ok = wekt_n[!is.na(wekt_n)] dl_n = length(wekt_n_ok) wynik = (1*wekt_n_ok)/(1*dl_n) } } and I get an error like this: Error in 1 * wekt_n_ok : non-numeric argument to bin...
2009 Oct 28
1
need help explain the routine input parameters for seROC and cROC found in the R archive
...e. > From: Bernardo Rangel Tura > Date: Thu 16 Dec 2004 - 07:30:37 EST > > seROC<-function(AUC,na,nn){ > a<-AUC > q1<-a/(2-a) > q2<-(2*a^2)/(1+a) > se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na)) > se > } > > cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){ > se1<-seROC(AUC1,na1,nn1) > se2<-seROC(AUC2,na2,nn2) > > sed<-sqrt(se1^2+se2^2-2*r*se1*se2) > zad<-(AUC1-AUC2)/sed > p<-dnorm(zad) > a<-list(zad,p) > a > } > -- Waverley @ Palo Alto
2004 Jun 21
2
visualizing a list of probabilities
Hi, I'm using nnet to work on a 2 class classification problem. The result of my code is data.frame of true class, predicted class and associated probability. One way of summarizing the data is by a confusion matrix. However are there any graphical ways I could represent the data - specifically, I'd like to show the probabilities associated with each member of my prediction set? (I
2004 Dec 15
3
(no subject)
Dear R-helper, I would like to compare the AUC of two logistic regression models (same population). Is it possible with R ? Thank you Roman Rouzier [[alternative HTML version deleted]]
2001 Sep 27
1
Making a factor with common levels ...
...h vector. I can get the list of common names quite easily, using: nn<-sort(unique(c(levels(n1)[table(n1)>N],levels(n0)[table(n0)>N]))) Some of the factor levels may be empty for one of the factors but the same level must be present in the other. Is there a simple way to extract nn0 and nn1 so that the pairs remain correctly aligned and each list has at least N cases of each name? Or do I have to jump into my steamroller and do a couple of loops? TIA John -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwie...
2006 Feb 11
2
Xend crashes repeatedly starting DomU - please help...
...to get a DomU booting. I constantly get the following error "Error: Received invalid response from Xend, twice." on trying to start the domain Where do I actually look to try and debug this further? I do have SELinux compiled in on this kernel, but it''s in non-enforcing mode nn1 xen # xm create -c ttylinux Using config file "ttylinux". Error: Received invalid response from Xend, twice. nn1 xen # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 125 2 r----- 641.6 Domain-16...
2011 Jan 05
0
Nnet and AIC: selection of a parsimonious parameterisation
...IC ) { cat('\n j',j,'AIC'=AIC.tmp,'AIC_1',AIC,'\n') break } else { nn=nn.tmp; AIC=AIC.tmp; RSS=RSS.tmp } } list(choice=sqrt(RSS/100),nparam=sum(nn$wts!=0),AIC=AIC,nn=nn) } #Modified function for optimisation CVnn1 <- function(decay, formula, data, nreps=1, ri, size, linout, skip, maxit, optimFlag=FALSE, alpha) { truth <- log10(data$perf) nn <- nnet(formula, data[ri !=1,], trace=FALSE, size=size, linout=linout, skip=skip, maxit=maxit, Hess = TRUE) RSS=(alpha-1)*sum((truth[ri != 1] - pre...