I'm making tables for prediction results of classifiers (2 classes) that show
the usual numbers, true positives, false positives, etc
I used the command
table(predictedLabels,realLabels)
to make those.
I just had a case though ,where one of the label vectors had only one class in
it. This
Use factors?
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...
Live: OO#.. Dead:
So..
real=factor(realLabels)
predicted=factor(predictedLabels)
fl-unique(levels(real),levels(predicted))
real=factor(realLabels,fl)
predicted=factor(pl,fl)
table(real,predicted)
?
i kinda dont like
Dear Jessica,
Compare
x-c(1,1,1,0,0)
y-c(1,1,1,1,1)
table(x, y)
with
table(factor(x, levels = 0:1), factor(y, levels = 0:1))
HTH,
Jorge.-
On Wed, Oct 10, 2012 at 12:24 AM, Jessica Streicher wrote:
So..
real=factor(realLabels)
On 09/10/2012 9:24 AM, Jessica Streicher wrote:
So..
real=factor(realLabels)
predicted=factor(predictedLabels)
fl-unique(levels(real),levels(predicted))
real=factor(realLabels,fl)
predicted=factor(pl,fl)
Yepp, i do not necessarily know them beforehand. Or maybe i should rather say
that they may differ from time to time but i want to be able to just copy the
code.
I can use your code that skips the first factor commands though, thanks.
On 09.10.2012, at 15:00, Jeff Newmiller wrote:
Use
6 matches
Mail list logo