Displaying 20 results from an estimated 1000 matches similar to: "unexpected behavior of rpart 3.1-43, loss matrix"
2002 Mar 13
0
rpart error with 0-frequency factor levels (with partial fix) (PR#1378)
(I'm sending to r-bugs because rpart is one of the recommended packages and
is always installed. I'm also sending it directly to Dr. Ripley, as the
maintainer.)
rpart working as a classifier does not work (produces no splits) when the
class indicator has no instances of one of the factor levels, as long as the
factor level is not the final level. I have at least a partial fix, which I
2002 Jan 25
0
rpart subsets
A few weeks back I posted that the subset feature of rpart was not working
when predicting a categorical variable. I was able to figure out a simple
solution to the problem that I hope can be included in future editions of
rpart. I also include a fix for another related problem.
The basic problem is that when predicting a categorical using a subset, the
subset may not have all the categories
2002 Jan 28
0
rpart subset fix
(Apparently, I posted this to the wrong place. I am hopefully posting this
is the correct place now. If not, please advise.)
A few weeks back I posted that the subset feature of rpart was not working
when predicting a categorical variable. I was able to figure out a simple
solution to the problem that I hope can be included in future editions of
rpart. I also include a fix for another related
2006 Nov 30
0
extending data.frame with S4 class
Hi.
When I extend "numeric" with S4 and create an instance, I get something
that looks and acts like a numeric. When I extend "data.frame" and
create an instance, I get a NULL 'core'. Why is this, and can it be
fixed? setOldClass(), prototype=, and initialize() don't seem to help.
Thanks,
Tim
----
2007 May 02
4
Shared Nested Resources
The skinny is that I''m attempting to add "Discussions" as resources
under different resources ("Groups", "Projects", for example) and I''ve
simply hit a roadblock (or two).
Discussions are an association between the "discussable" (Group,
Project, etc.) and a "Topic" so:
class Discussion < ActiveRecord::Base
belongs_to :topic
2005 May 25
0
Error with user defined split function in rpart (PR#7895)
Full_Name: Bill Wheeler
Version: 2.0.1
OS: Windows 2000
Submission from: (NULL) (67.130.36.229)
The program to reproduce the error is below. I am calling rpart with a
user-defined split function for a binary response variable and one continuous
independent variable. The split function works for some datasets but not
others.
The error is:
Error in "$<-.data.frame"(`*tmp*`,
2007 Jan 03
1
User defined split function in Rpart
Dear all,
I'm trying to manage with user defined split function in rpart
(file rpart\tests\usersplits.R in
http://cran.r-project.org/src/contrib/rpart_3.1-34.tar.gz - see bottom of
the email).
Suppose to have the following data.frame (note that x's values are already
sorted)
> D
y x
1 7 0.428
2 3 0.876
3 1 1.467
4 6 1.492
5 3 1.703
6 4 2.406
7 8 2.628
8 6 2.879
9 5 3.025
10 3 3.494
2009 Feb 11
2
error in my previous message
i'm sorry. i had an error in my previous code because i left out a
letter in the rownames.
while fixing that, i also found a solution. so i'm sorry for the
confusion.
below is my fix.
temp2 <- matrix(rnorm(10),nc=1,nrow=10)
rownames(temp2) <-
2013 Mar 01
7
Conditional Weighted Average (ddply or any other function)
Hello R community,
I am computing weighted average statistic by using ddply function:
My data set is:
N1 T1 S1 I1 C1 FY-4 ROE11 EPS11 MKT11
N1 T1 S1 I1 C1 FY-3 ROE12 EPS12 MKT12
N1 T1 S1 I1 C1 FY-2 ROE13 EPS13 MKT13
N1 T1 S1 I1 C1 FY-1 ROE14 EPS14 MKT14
N1 T1 S1 I1 C1 FY0 ROE15 EPS15 MKT15
N1 T1 S1 I1 C1 FY1 ROE16 EPS16 MKT16
N1 T1 S1 I1 C1 FY2 ROE17
2009 Feb 11
2
sorting a matrix by the column
this is a bad question but I can't figure it out and i've tried. if i
sort the 2 column
matrix , temp1, by the first column, then things work as expected. But,
if I sort the 1 column matrix, temp2, then it gets turned coerced to a
vector. I realize that I
need to use drop=FALSE but i've put it in a few different places with no
success. Thanks.
temp1 <-
2012 Jul 27
1
about dovecot quota ,i will crazy!
Hi ALL:
my SQL:
user_query=select concat('*bytes=',trim(TRAILING 'S' FROM quota)) as quota_rule,concat('/home/data/domains/',maildir) as mail ,conca
t('/home/data/domains/',homedir) as home,uidnumber as uid,gidnumber as gid from mailbox where username='%u'
password_query= select username as user ,password,uidnumber as userdb_uid,gidnumber as
2012 Oct 31
2
Aggregate Table Data into Cell Frequencies
R-help -
I have this set of aggregated tables (sample data below via dput()). And I
would like to have delayValue as the column variables with the "temp"
(temp1, temp2, temp3) values as the row variables. However I would like to
have the temp variables *aggregated into single rows* so that I have the
frequency ("Freq" | counts) of each time each "delayValue" occurs
2007 Nov 21
1
Help Required in using cast (reshape package) function
Hello everyone,
I am new to R. I have data in the form of excel pivot table format and I
want to cast it into a format which can make it compatible with
computation.
Since I already have the package in pivot format; I avoid melt function
and use the cast directly.
I inspect the
dataread <- read.csv(".....", header=TRUE)
Data in the format
Id Region Country Industry
2017 Sep 11
4
Case statement in sqldf
Hi all,
I am trying to create a new variable called Fiscal Year (FY) using case expression in sqldf and I am getting a null FY , see the code below .
Please advise me as to how I can do this mutation.
library(zoo)
library(lubridate)
library(stringr)
library(RH2)
library(sqldf)
cr$ReportDate = as.Date(cr$ReportDate, format ='%Y-%m-%d')
> cr2 = sqldf(" select
2013 Jul 16
2
Problem following an R bug fix to integrate()
I have been told by the CRAN administrators that the following code generated
an error on 64-bit Fedora Linux (gcc, clang) and on Solaris machines (sparc,
x86), but runs well on all other systems):
> fn <- function(x, y) ifelse(x^2 + y^2 <= 1, 1 - x^2 - y^2, 0)
> tol <- 1.5e-8
> fy <- function(x) integrate(function(y) fn(x, y), 0, 1,
2004 Sep 28
3
sapply behavior
Hi,
I use sapply very frequently, but I have recently noticed a behavior of
sapply which I don't understand and have never seen before. Basically,
sapply returns what looks like a matrix, says it a matrix, and appears to
let me do matrix things (like transpose). But it is also a list and behaves
like a list when I subset it, not a vector (so I can't sort a row for
instance). I
2017 Sep 11
0
Case statement in sqldf
2018-03-3 in your code should be 2018-03-31.
The line
then'201415'
needs to be fixed.
When posting please provide minimal self-contained examples. There was
no input provided and library statements not relevant to the posted
code were included.
Fixing the invalid date and bad line, getting rid of those library
statements that are unnecessary and providing some test input, it
works
2003 Nov 23
4
remove 0 rows from a data frame
Dear all,
As part of a larger function, I am randomly removing rows from a data
frame. The number of removed rows is determmined by a Poisson distribution
with a low mean. Sometimes, the random number is 0, and that's when the
problem starts:
My data frame:
> temp
occ x y dbh age
801 0 2977.196 3090.225 6 36.0
802 0 2951.892 3083.769 8 40.6
803 0 2919.111
2006 Jan 04
3
matrix math
I am using R 2.1.1 in an windows XP environment.
I have 2 dataframes, temp1 and temp2.
Each dataframe has 20 variables (“cocolumns") and 525 observations (“rows”). All variables are numeric.
I want to create a new dataframe that also has 20 columns and 525 rows. The values in this dataframe should be the sum of the 2 other dataframe.
(i.e. temp1$column
2007 Jan 30
2
rbind-ing list
hi,
i have a list of data.frame that has same structure. i would like to know a
efficient way of rbind-ing it.
right now, i write:
n = length(temp) # 'temp' is a list of data.frames
temp2 = data.frame()
for (i in 1:n) temp2 = rbind( temp2, temp[[i]])
return(temp2)
but this is not an efficient way since we keeping overwriting temp2. i
wonder if there's faster way.
thanks
--