[R] dlda{supclust} 's output

Weiwei Shi helprhelp at gmail.com
Tue Jul 3 21:20:15 CEST 2007


Hi,

I modified dlda{supclust} so that the original example in ?dlda gives
the following output:

> set.seed(342)
> xlearn <- matrix(rnorm(200), nrow = 20, ncol = 10)
>
> ## Generating random test data: 8 observations and 10 variables(clusters)
> xtest  <- matrix(rnorm(80),  nrow = 8,  ncol = 10)
>
> ## Generating random class labels for the learning data
> ylearn <- as.numeric(runif(20)>0.5)
>
> ## Predicting the class labels for the test data
>
> t0 = dlda(xlearn, xtest, ylearn)
> t0
          [,1]     [,2]
[1,] 17.595758 21.20141
[2,] 11.882305 20.34470
[3,]  7.837422 12.47240
[4,] 11.025810 12.04523
[5,] 18.167740 15.91930
[6,] 11.396010  9.26949
[7,] 33.911010 26.06992
[8,] 16.140149 19.83915

(to be noticed: the above is anti-probabilities, which means the
smaller, the higher prob for being the label of colname, for example,
sample 5, the class label is predicted as 1 instead of 0)

Here I have one question about it:

since apply(t0, 1, sum) does not give the same sum, I am wondering if
standardization is a proper way to compare the probabilities "BETWEEN"
samples, following the understanding of dlda algorithm.



Thanks,

Weiwei

On 5/7/07, Marcel Dettling <mdettling at bluewin.ch> wrote:
> Hi Weiwei,
>
> it would be possible to obtain probabilities instead of just a 0/1
> output. The code needs to be altered though. Sorry I don't have the time
> to do that. But R is open source and contributions are most welcome.
>
> I'm sorry not to be able of more help,
>
> Marcel
>
> --------------------------------------
> Marcel Dettling
> Phone:  +41 79 489 72 04
> E-Mail: mdettling at bluewin.ch
> Web:    http://stat.ethz.ch/~dettling
> --------------------------------------
> ----- Original Message -----
> From: "Weiwei Shi" <helprhelp at gmail.com>
> To: "R Help" <R-help at stat.math.ethz.ch>
> Cc: <dettling at stat.math.ethz.ch>
> Sent: Tuesday, May 01, 2007 11:50 PM
> Subject: dlda{supclust} 's output
>
>
> > Hi,
> >
> > I am using dlda algorithm from supclust package and I am wondering if
> > the output can be a continuous probability instead of discrete class
> > label (zero or one) since it puts some restriction on convariance
> > matrix, compared with lda, while the latter can.
> >
> > thanks,
> >
> > --
> > Weiwei Shi, Ph.D
> > Research Scientist
> > GeneGO, Inc.
> >
> > "Did you always know?"
> > "No, I did not. But I believed..."
> > ---Matrix III
> >
> >
> > !DSPAM:4637b61518111667610022!
> >
>
>


-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III



More information about the R-help mailing list