search for: nclass

Displaying 20 results from an estimated 83 matches for "nclass".

Did you mean: class
2017 May 18
2
Bug: floating point bug in nclass.FD can cause hist() to crash
Hello everybody, This is a bug involving functions in core R package: graphics::hist.default, grDevices::nclass.FD, and base::pretty.default. It is not yet on Bugzilla. I cannot submit it myself, as I do not have an account. Could somebody else add it for me, perhaps? That would be much appreciated. Kind regards, Sietse Sietse Brouwer Summary ------- Floating point errors can cause a data vector to have...
2007 Dec 21
1
using apply to loop
Hi, I am running the following loop, but it takes hours to run as n is big. Is there any way "apply" can be used? Thanks. ### Start nclass <- dim(data)[[2]] - 1 z <- matrix(0, ncol = nclass, nrow = nclass) n <- dim(data)[[1]] x <- c(1:nclass) # loop starts for(loop in 1:n) { r <- data[loop, 1:nclass] classified <- x[r == max(r)] truth <- data[loop, nclass + 1] z[...
2007 Dec 21
1
using apply to loop [SEC=UNCLASSIFIED]
Hi Louis, You could try this: # find the index of the maximum value in each row of _data_, # disregarding the last column classified <- apply(data[,-(nclass+1)],1,which.max) ## or, if the maximum may be repeated: classified <- apply(data[,-(nclass+1)], 1, FUN = function(x) which(x == max(x))) # the variable _truth_ is just the last column of _data_ ? truth <- data[,nclass + 1] ?table z <- table(classified, truth) HTH Joe Joe Crombie...
2017 May 18
0
Bug: floating point bug in nclass.FD can cause hist() to crash
...s grDevices utils [5] datasets methods base loaded via a namespace (and not attached): [1] compiler_3.4.0 tools_3.4.0 > On 2017-05-18 3:50 PM, Sietse Brouwer wrote: > Hello everybody, > > This is a bug involving functions in core R package: > graphics::hist.default, grDevices::nclass.FD, and > base::pretty.default. It is not yet on Bugzilla. I cannot submit it > myself, as I do not have an account. Could somebody else add it for > me, perhaps? That would be much appreciated. > > Kind regards, > > Sietse > Sietse Brouwer > > > Summary > ------...
2012 Oct 07
2
[PATCH] drm/nouveau: fix error handling in core/core object creation functions
...t.c b/drivers/gpu/drm/nouveau/core/core/parent.c index 1a48e58..d2ea7c2 100644 --- a/drivers/gpu/drm/nouveau/core/core/parent.c +++ b/drivers/gpu/drm/nouveau/core/core/parent.c @@ -87,8 +87,10 @@ nouveau_parent_create_(struct nouveau_object *parent, if (sclass && sclass->ofuncs) { nclass = kzalloc(sizeof(*nclass), GFP_KERNEL); - if (!nclass) + if (!nclass) { + nouveau_parent_destroy(object); return -ENOMEM; + } nclass->sclass = object->sclass; object->sclass = nclass; -- 1.7.12
2002 Apr 09
0
couldn't find function "nclass.fd"
Dear list, I get the following message while computing truehist in R 1.4.1 on Redhat Linux 7.1: > truehist(lsk$Pox, nbins = "FD" , prob = TRUE, xlab = "Pox [mmol/kg]") Error in switch(casefold(nbins), scott = nclass.scott(data), "freedman-diaconis" = , : couldn't find function "nclass.fd" Maybe the "nclass.fd" should be changed into "nclass.FD"? But I could not find it in the directories. Regards, Ulrich -- ___________________________________________...
2012 Oct 07
1
[PATCH] drm/nouveau: remove >1 sclass support from nouveau_parent_create_
...00644 --- a/drivers/gpu/drm/nouveau/core/core/parent.c +++ b/drivers/gpu/drm/nouveau/core/core/parent.c @@ -85,7 +85,7 @@ nouveau_parent_create_(struct nouveau_object *parent, if (ret) return ret; - while (sclass && sclass->ofuncs) { + if (sclass && sclass->ofuncs) { nclass = kzalloc(sizeof(*nclass), GFP_KERNEL); if (!nclass) return -ENOMEM; @@ -94,7 +94,6 @@ nouveau_parent_create_(struct nouveau_object *parent, object->sclass = nclass; nclass->engine = engine ? nv_engine(engine) : NULL; nclass->oclass = sclass; - sclass++; } object-&gt...
1999 Nov 23
1
postscript colors
Is color specification like this available in R for setting postscript colors? > hue <- c(0, seq(from = 0, by = 1/(nclass), length = nclass)) > sat <- c(0, rep(1.0, nclass)) > bri <- c(0, rep(1.0, nclass)) > zcolors <- cbind(hue, sat, bri) > ps.options (setcolor=ps.setcolor.hsb,colors=zcolors) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- R...
2013 Mar 26
1
randomLCA_with error for me
...ase help. > library(lattice) > library(boot) Attaching package: ‘boot’ The following object(s) are masked from ‘package:lattice’: melanoma > library(utils) > library(randomLCA) > #random parameter latent class model > trt.lca1random <- randomLCA(trt[,1:5],initmodel=0,nclass=1,random=TRUE,quadpoints=41,probit=TRUE) Error in randomLCA(trt[, 1:5], initmodel = 0, nclass = 1, random = TRUE, : patterns must consist of either 0 or 1 > trt.lca2random <- randomLCA(trt[,1:5],initmodel=0,nclass=2,random=TRUE,quadpoints=41,probit=TRUE) Error in randomLCA(trt[, 1:5], init...
2012 Oct 25
5
system is computationally singular: reciprocal condition number
...lem, but there is no way this is a singular matrix. I have uploaded the input file to my ftp: http://mkk.szie.hu/dep/talt/lv/CentInpDuplNoHeader.txt It is a tab delimited txt file with no headers. I tried the StatMatch Mahanalobis function and also this function: mahal_dist <-function (data, nclass, nvariable) { dist <- matrix(0, nclass, nclass) n=0 w <- cov(data) print(w) for(i in 1:nclass) { for(c in 1:nclass){ diffl <- vector(length = nvariable) for(l in 1:nvariable){ diffl[l]=abs(d...
2008 Jun 23
5
Need ideas on how to show spikes in my data and how to code it in R
Hi I have recently been analyzing birthweight data from a clinic. The data has obvious defects in that there is digit preference on certain weights making them overrepresented. This shows as spikes in the histogram on certain well rounded weights like 2, 2.5, 3, etc. I would like to show this to government officials but can't figure out how I should present the finding in an easy to
2011 Dec 16
1
kmeans and plot labels
...et a step further. My question, perhaps a bit clearer, is how to display the case control status (or any other arbitrary point label) after clustering in a plot: With a bit of pseudo code, where dataset is a data.frame, parameters are those column names where we find numerical values (no NAs) and nclasses is the desired number of classes. fit <- kmeans(dataset[, parameters], nclasses) plot(dataset[, parameters], col = fit$cluster, dimen = nclasses) This gives us a nicely coloured plot where all points are circled. Yet, my desire is to see the case / control-Status encoded in a column "St...
2008 May 19
2
How hist() decides breaks?
...gram, * a character string naming an algorithm to compute the number of cells (see Details), * a function to compute the number of cells. In the last three cases the number is a suggestion only. B) The default for 'breaks' is '"Sturges"': see 'nclass.Sturges'. If I look at the code for nclass.Sturges() I see function (x) ceiling(log2(length(x)) + 1) and, for length(X) = 10000, this gives 15. This is not related to any of the numbers of breaks I actually got, in any way obvious to me. So: Question 1: hist() has apparently ignored my &q...
2004 Mar 26
1
color.ramp in maptools
...am using R Version 1.8.1 (2003-11-21) on Linux Looking at the plot.Map function itself, I see that it calls a color.ramp function (I am reporting only the relevant part here): ... if (attr(theMap$Shapes, "shp.type") == "poly") { if (!is.null(auxvar) && nclass > 1) { col.rmp <- color.ramp(nclass, nvec = auxvar) for (i in recs) { ... I don't seem to be able to get any information on this color.ramp function. In fact the function doesn't seem to exist if I search for it with ls() Does anyone have any insight?...
2005 Jul 07
1
Tables: Invitation to make a collective package
...39;Sturges', 'Scott', 'FD'), right=FALSE) { x <- na.omit(x) # User defines only x and/or 'breaks' # (x, {k,}[breaks, right]) if (missing(k)) { brk <- match.arg(breaks) switch(brk, Sturges = k <- nclass.Sturges(x), Scott = k <- nclass.scott(x), FD = k <- nclass.FD(x)) tmp <- range(x) start <- tmp[1] - abs(tmp[2])/100 end <- tmp[2] + abs(tmp[2])/100 R <- end-start h <- R/k } # User defines 'x' an...
2005 May 24
1
Contingency tables from data.frames
...if (is.data.frame(df) != 'TRUE') stop('need "data.frame" data') dim_df <- dim(df) tmpList <- list() for (i in 1:dim_df[2]) { x <- as.matrix(df[ ,i]) x <- na.omit(x) k <- switch(breaks[1], 'Sturges' = nclass.Sturges(x), 'Scott' = nclass.scott(x), 'FD' = nclass.FD(x), stop("'breaks' must be 'Sturges', 'Scott' or 'FD'")) tmp <- range(x) classIni <- tmp[1] - tmp[2]/100...
2006 Oct 17
1
Some questions on Rpart algorithm
Hello: I am using rpart and would like more background on how the splits are made and how to interpret results - also how to properly use text(.rpart). I have looked through Venables and Ripley and through the rpart help and still have some questions. If there is a source (say, Breiman et al) on decision trees that would clear this all up, please let me know. The questions below pertain to a
2003 Nov 25
2
RandomForest & memory demand
Hi, is it correct that i need ~ 2GB RAM that it's possible to work with the default setting ntree=500 and a data.frame with 100.000 rows and max. 10 columns for training and testing? P.S. It's possible calculate approximate the memory demand for different settings with RF? Many thanks & regards, Christian
2007 Mar 20
1
truehist bug?
Hi, Is this a bug in truehist()? > library(MASS) > x <- rep(1, 10) > truehist(x) Error in pretty(data, nbins) : invalid 'n' value Thanks, Gad > R.version platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major 2 minor 4.1 year 2006 month 12 day 18 svn
2007 Mar 20
1
truehist bug?
Hi, Is this a bug in truehist()? > library(MASS) > x <- rep(1, 10) > truehist(x) Error in pretty(data, nbins) : invalid 'n' value Thanks, Gad > R.version platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major 2 minor 4.1 year 2006 month 12 day 18 svn