Thursday, September 30, 2004
Hi David,
The following link in project ideas leads to nowhere. Can you check if the site has been changed?
6. Multiclass Classification – using coding theory ideas for multiclass classification
Dietterich, T. G., Bakiri, G. (1995) Solving Multiclass Learning Problems via Error-Correcting Output Codes. Journal of Artificial Intelligence Research 2: 263-286. Postscript file.
Thanks,
Ko-Yu
Thanks. I fixed it. The correct URL is http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume2/dietterich95a.pdf
The following link in project ideas leads to nowhere. Can you check if the site has been changed?
6. Multiclass Classification – using coding theory ideas for multiclass classification
Dietterich, T. G., Bakiri, G. (1995) Solving Multiclass Learning Problems via Error-Correcting Output Codes. Journal of Artificial Intelligence Research 2: 263-286. Postscript file.
Thanks,
Ko-Yu
Thanks. I fixed it. The correct URL is http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume2/dietterich95a.pdf
Wednesday, September 29, 2004
Hi, David. I was just wondering, are you going to post the code that you went over in class last night? Or do you have some other samples of code that runs in R? I find that looking at examples of code is a good way to learn what it can do, and how to write it. Thanks!!
Here's the R code:
Here's the R code:
# read the data
myData <- read.table("c:\\download\\fatalityOrdered.txt")
x <- myData[,1]
y <- myData[,2]
# constants
N <- dim(myData)[1]
MAXWINDOWSIZE <- 250
MINWINDOWSIZE <- 5
NUMITER <- 10
# initialization
pValue <- 0;
smallestLambdaArray <- rep(0,NUMITER);
count <- 1 #first iteration of the algorithm is to find actual clusters, all other permutations are for comparison
compareprob <- rep(0, NUMITER)
while(count <= NUMITER) {
cat("iteration: ",count,"\n");
smallestLambda <- 100000
windowSize <- MINWINDOWSIZE
while(windowSize < MAXWINDOWSIZE){
windowStart <- 1
while (windowStart <= (N - windowSize + 1)) {
window <- y[windowStart:(windowStart+windowSize-1)]
positives <- sum(window)
negatives <- windowSize - positives
outWindowSize <- N - windowSize
outPositives <- sum(y) - positives
outNegatives <- sum(1-y) - negatives
if ((positives > 0) && (negatives > 0) && ((positives/windowSize)>(sum(y)/N))) {
windowLambda <- -1 * (log((positives/windowSize)^positives) + log((negatives/windowSize)^negatives) + log((outPositives/outWindowSize)^outPositives) + log((outNegatives/outWindowSize)^outNegatives))
if (windowLambda < smallestLambda) {
smallestLambda <- windowLambda
# cat(x[windowStart],"-",x[windowStart+windowSize-1],"\t",windowLambda,"\t",windowSize,"\t",positives,"\n");
if(count == 1) {
windowSizeOfCluster <- windowSize
clusterWindowStart <- windowStart
}
}
}
windowStart <- windowStart + 1
}
windowSize <- windowSize + 1
}
y <- sample(y, N, replace = FALSE)
smallestLambdaArray[count] <- smallestLambda
if (smallestLambdaArray[count] <= smallestLambdaArray[1]) {
pValue <- pValue + 1;
}
count <- count + 1
}
cat("Size: ", windowSizeOfCluster,"\n")
cat("Window: ",x[clusterWindowStart],"-",x[clusterWindowStart+windowSizeOfCluster-1],"\n")
cat("pValue: ",pValue/NUMITER,"\n")
Dear David, about the permutation test, according to your handout, do a 999 resample and get the lamda pool; then add the unusual one from the original dataset to make it 1000 than rank and find the location of the unusual lamda. But what if you do a 99 resampling instead of 999? You are going to report that the lamda is the samllest out of 100, right? I think the right way to report how unusual a lamda is is do not put the lamda from orginal data into the pool from resampling. i.e. do 1000 and if we do not see the unusual lamda, we should report that the chance to observe this unusal lamda is less than 1/1000. For our HW, I did 10,000 and did not see anything less or equal to the unusual one. So the chance is less than 1/10,000. What do you think? -B.J.
The example in the homework is a bit unusual in that the p-value is very small. More typically, the observed smallest-lambda would be somewhere in the middle of the bunch. As to whether to do 99 or 999 or 1000 or 10000 iterations, more is better. D.
The example in the homework is a bit unusual in that the p-value is very small. More typically, the observed smallest-lambda would be somewhere in the middle of the bunch. As to whether to do 99 or 999 or 1000 or 10000 iterations, more is better. D.
Hi David, I have a question about the window. Can I use real distance as window size (eg. 1 mile, 2 miles, ...) instead of window of accidents. Y.
Yes, it should not matter so long as you look at enough windows. Just looking at windows like "3-5" is probably not refined enough - you probably need windows like "3.2-5.6" etc. D.
Yes, it should not matter so long as you look at enough windows. Just looking at windows like "3-5" is probably not refined enough - you probably need windows like "3.2-5.6" etc. D.
Matlab has a function called "randperm" that does the trick.
Tuesday, September 28, 2004
What is the MATLAB equivalent of R's "sample" function? Thanks. -- DF
I don't know. Can someone else answer this question? D.
I don't know. Can someone else answer this question? D.
Maybe the e-mail confusion is over the extension of the address.
Is it dmadigan at RCI [dot] rutgers [dot] edu (or STAT [dot] rugters [dot] edu)?
I've sent to dmadigan [at] stat [dot] rutgers [dot] edu half an hour ago. Shock me, it've got the following failure notice message!!
------------------------------------------------------------------------------------------------
Hi. This is the qmail-send program at stat.rutgers.edu.I'm afraid I wasn't able to deliver your message to the following addresses.This is a permanent error; I've given up. Sorry it didn't work out.:Sorry, no mailbox here by that name. (#5.1.1)
------------------------------------------------------------------------------------------------
All of these addresses end up in the same inbox:
madigan at stat dot rutgers dot edu
dmadigan at rci dot rutgers dot edu
dmadigan at rutgers dot edu
D.
Is it dmadigan at RCI [dot] rutgers [dot] edu (or STAT [dot] rugters [dot] edu)?
I've sent to dmadigan [at] stat [dot] rutgers [dot] edu half an hour ago. Shock me, it've got the following failure notice message!!
------------------------------------------------------------------------------------------------
Hi. This is the qmail-send program at stat.rutgers.edu.I'm afraid I wasn't able to deliver your message to the following addresses.This is a permanent error; I've given up. Sorry it didn't work out.
------------------------------------------------------------------------------------------------
All of these addresses end up in the same inbox:
madigan at stat dot rutgers dot edu
dmadigan at rci dot rutgers dot edu
dmadigan at rutgers dot edu
D.
Hi professor, what's your email address? My email about my hw1 to you has been rejected several times. I don't why? --xhuang
dmadigan at rutgers dot edu. If that doesn't work for some reason, try madigan at yahoo dot com. D.
Oops! I sent to madigan@stat.rutgers.edu but never bounce back! Another person?
Maybe another person :( But, this one is shown just below your address at stat. dept. faculty website.
dmadigan at rutgers dot edu. If that doesn't work for some reason, try madigan at yahoo dot com. D.
Oops! I sent to madigan@stat.rutgers.edu but never bounce back! Another person?
Maybe another person :( But, this one is shown just below your address at stat. dept. faculty website.
what will you cover tonight?
I'll talk a little bit about the homework, and also present ideas for projects. Then we will cover Chapter 3 on the textbook covering linear models. After that we might talk about score functions. D.
I'll talk a little bit about the homework, and also present ideas for projects. Then we will cover Chapter 3 on the textbook covering linear models. After that we might talk about score functions. D.
Sunday, September 26, 2004
Regarding to HW1 data set, the location column of the data set is out of order, does it make sense to sort the data set first on "location" from small to large before performing GLRT?
That's correct, you need have them in order to do computations on windows. D.
If it helps, there is an ordered version here D.
That's correct, you need have them in order to do computations on windows. D.
If it helps, there is an ordered version here D.
Hi David & all. I have a question about the "k-wise" dependence that the guest lecturer mentioned last class. I would like to understand more about how k-wise dependence actually arises -- i.e., what kind of processes give rise to k-way dependence (without evidencing lower-order dependencies)? The simplest example I can think of is the XOR function. Thus, in C = xor(A,B), where A and B are independent binary variables, we have a 3-wise dependency without any pairwise dependencies. In other words, all pairs {A,B}, {A,C}, {B,C} are independent, but the triple {A,B,C} has dependency; that is, p(A,B,C) does not equal p(A)p(B)p(C). What is the special property (if there is one) of the XOR function that creates this situation? What other distributions have this property? Are they common or very rare? And how does one synthesize a distribution with this property? Does k-wise dependence (without lower-order dependencies) represent some form of singularity in the probability space? If anyone has any insights (or ideas for further reading), I would be eager to hear them. Thanks very much. -- Dave F.
Saturday, September 25, 2004
Statistics 588 - Data Mining: "I have further questions on Permutation Test: My understanding is to permute on the whole data set (500 in this case) to come up with 999 samplings without replacement, i.e. keeping the total number of injury accidents constant. Then my question is: whether apply GLRT to the whole data set with fixed window size to find smallest lamda in each sampling, then sort and find the position of the observed smallest lamda in this distribution; or apply GLRT only to the unusual windows observed from the orginal data set? Since there could be multiple unusual windows with the same smallest lamda calculated. If only applying GLRT to the unusual windows, then each unusual window needs to be tested for null hypothesis, right? J.C.
Basically whatever statistic you compute on the original data set, you compute exactly the same thing on each of the permuted datasets. So, if you are using a variable window size, you compute lambda for every possible window in the original datset and then find the smallest one. Then do exactly the same thing on each of the permuted datasets. So, you are not testing the particular unusual window that had the smallest lambda in the original data, rather you are testing if its particular value of smallest-lambda is unusual or not.
I'm a little concerned about the term "sampling with replacement" causing confusion here. You need to create random permutations of the labels of the accidents ("injury", "not-injury"). Sampling with replacement usually implies that some objects get sampled more than once and that is not what is happening here. D.
Basically whatever statistic you compute on the original data set, you compute exactly the same thing on each of the permuted datasets. So, if you are using a variable window size, you compute lambda for every possible window in the original datset and then find the smallest one. Then do exactly the same thing on each of the permuted datasets. So, you are not testing the particular unusual window that had the smallest lambda in the original data, rather you are testing if its particular value of smallest-lambda is unusual or not.
I'm a little concerned about the term "sampling with replacement" causing confusion here. You need to create random permutations of the labels of the accidents ("injury", "not-injury"). Sampling with replacement usually implies that some objects get sampled more than once and that is not what is happening here. D.
Friday, September 24, 2004
Here is my understanding about permutation test, please correct me if I am wrong. Do 999 resampling without replacement, plug in the GLRT in that unusual window(one subset only) , sort and find the position of lamda.
Yes, that's basically correct. Note you do not have to use the GRLT if you think you have a better test statistic. Also, the "sampling with replacement" has to keep the total number of injury accidents constant. Really what you are doing is randomly permuting the labels (injury or non-injury) on the accidents. D.
Yes, that's basically correct. Note you do not have to use the GRLT if you think you have a better test statistic. Also, the "sampling with replacement" has to keep the total number of injury accidents constant. Really what you are doing is randomly permuting the labels (injury or non-injury) on the accidents. D.
Thursday, September 23, 2004
Is the permutation test a Monte Carlo-based approach? L.L.
Yes, insofar as it involves generating random draws from the null distribution of the chosen test statistic. D.
Yes, insofar as it involves generating random draws from the null distribution of the chosen test statistic. D.
Here is the paper that describes ome of the material that Suhrid covered on Tuesday. D.
Yes, I have a question: Instead of your Lambda statistic, can I use something simpler like
(fatalINwin/nonFatalINwin) / (fatalOUTwin/nonFatalOUTwin)
This seems reasonable, no? Thanks. -- Dave F.
This is the "odds-ratio" and seems reasonable. Note you will have to
tare of zero counts which will cause your statistic to blow up. D.
(fatalINwin/nonFatalINwin) / (fatalOUTwin/nonFatalOUTwin)
This seems reasonable, no? Thanks. -- Dave F.
This is the "odds-ratio" and seems reasonable. Note you will have to
tare of zero counts which will cause your statistic to blow up. D.
Wednesday, September 22, 2004
Any more questions about the homework? D.
Sunday, September 19, 2004
David,
Can I use SPSS to program HW1?
Does SPSS have some kind of scripting language? I'd be kind of surprised if SPSS could do what you need to do but if it does that's fine. D.
Can I use SPSS to program HW1?
Does SPSS have some kind of scripting language? I'd be kind of surprised if SPSS could do what you need to do but if it does that's fine. D.
Saturday, September 18, 2004
In hw1 is it enough to output the most unusual segment or do we need to run a permutation test to decide whether the segment is really unusual or not?
Thanks
You need to do the permutation test. D.
Thanks
You need to do the permutation test. D.
Thursday, September 16, 2004
Hi! About the HW1, I use the satscan listed in your handout. It turns out great and easy to use. I also noticed that you reqired the code. And basically using satscan doesn't involved any programming (no code). Is it ok to hand in the output only? Thank you.
Its OK to use satscan to check your work, but I want you to implement the algorithm yourself. D.
Its OK to use satscan to check your work, but I want you to implement the algorithm yourself. D.
Hi Prof., I've a question about the meaning of a variable in the GLRT. What is Xw? It refers to location of window on the road or window size or neither. If Xw refers to location, then what is Xnotw? -EH
Xw is the number of injury accidents inside the window. Xnw is the number of injury accidents outside the window. The idea is that you compute these (and the GRLT statistic or some other statistic of your choosing) for every window. D.
So, Nw is no. of non-injury accidents within the window, Nnw is the no. of non-injury accidents outside the window. Am I right? -EH
sorry for the delay - I didn't spot your question here. Nw is the total number of accidents in the window (injury + noninjury). Nnw is the total number of accidents outside the window. D.
Xw is the number of injury accidents inside the window. Xnw is the number of injury accidents outside the window. The idea is that you compute these (and the GRLT statistic or some other statistic of your choosing) for every window. D.
So, Nw is no. of non-injury accidents within the window, Nnw is the no. of non-injury accidents outside the window. Am I right? -EH
sorry for the delay - I didn't spot your question here. Nw is the total number of accidents in the window (injury + noninjury). Nnw is the total number of accidents outside the window. D.
Wednesday, September 15, 2004
Statistics 588 - Data Mining
Can you post the R-code for the kernal smoothing? Thanks.--mimi
I just used the lowess function and the code was:
plot(lowess(x,y,f=0.2),type="l",log="x")
Can you post the R-code for the kernal smoothing? Thanks.--mimi
I just used the lowess function and the code was:
plot(lowess(x,y,f=0.2),type="l",log="x")
Hi, David, I enjoyed the class last night. Can you please post the R code that you showed last night for the kernal smoothing? Thanks. -- Mumi
Statistics 588 - Data Mining
Statistics 588 - Data Mining
Tuesday, September 14, 2004
The ggobi software is here. D.
Thursday, September 09, 2004
Hi. Will we cover any Bayes Net stuff? I'm just curious -- I wouldn't necessarily want to chuck something else in favor of BN. Also, are the course contents more reflective of "foundations of data mining" or "current methods" or "future of data mining"? Do you have a sense of what will be popular in the next 10 years? Have Bayes Nets and SVM and ICA already peaked? Thanks. -- D. Fass
Yes, I will talk about Bayes nets although not in great detail. Concerning your second question, I think its more of a "current methods" class than the other two. Concerning current *research*, I think Bayes nets, SVMs, and ICA continue to attract a lot of attention. As far as which techniques are likely to be in routine use in 10 or 20 years, that's a much trickier question. Clearly the problems these techniques focus on will not disappear but maybe alternative approaches will come to fore. D.
Yes, I will talk about Bayes nets although not in great detail. Concerning your second question, I think its more of a "current methods" class than the other two. Concerning current *research*, I think Bayes nets, SVMs, and ICA continue to attract a lot of attention. As far as which techniques are likely to be in routine use in 10 or 20 years, that's a much trickier question. Clearly the problems these techniques focus on will not disappear but maybe alternative approaches will come to fore. D.
Tuesday, September 07, 2004
Welcome to the Fall 2004 Data Mining class! We'll just continue last year's blog rather than open a new one - maybe some of last year's posts will be useful. D.