Closed Sand567 closed 8 years ago
You need to provide more info.
As per the professor's code the KFold takes in n=len(labels),nfolds=k. But When i trying to find out the combinations of features, we would need to make a call to cross validation accuracy to get the accuracy score.
Here what I doing here is ..
docs, labels = read_data(os.path.join('data', 'train')) feature_fns = [token_features, token_pair_features, lexicon_features] eval_all_combinations(docs,labels,[True,False],feature_fns,[2,5,10])
When I try to do this I see the below error
C:\Users\Sandeep\Anaconda3\lib\site-packages\scipy\sparse\csr.py in check_bounds(indices, N) 235 max_indx = indices.max() 236 if max_indx >= N: --> 237 raise IndexError('index (%d) out of range' % max_indx) 238 239 min_indx = indices.min()
IndexError: index (399) out of range
I tried printing the len(labels) it shows 400
what is your parameters used to call the cross_validation_accuracy function?
cross_validation_accuracy(clf, X, labels, k) clf - LogisticRegression() classifier X - csr matrix labels - list of ints, 1=positive, 0=negative label k - nfolds
I mean your real solid parameters.
X - got from calling Vectorize labels - got from the main method clf - LogisticRegression() k - 5
These are what I am passing to the function cross_validation_accuracy() . ABOVE
Then your bug probably hidden in vectorize function.
The Doctests pass for the dataset given but how would I find out where would the error lie in this huge data set ?
Dataset is always correct.
Dataset is always correct.
On Oct 21, 2016 8:38 PM, "Sand567" notifications@github.com wrote:
The Doctests pass for the dataset given but how would I find out where would the error lie in this huge data set ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iit-cs579/main/issues/305#issuecomment-255499523, or mute the thread https://github.com/notifications/unsubscribe-auth/AITtFcNWm2q_2uVQoE3cq7cnClPfPDW6ks5q2WkvgaJpZM4KdtM5 .
Hi,
I am seeing an error when I am trying to call cross validation accuracy from eval all combinations saying
C:\Users\Sandeep\Anaconda3\lib\site-packages\scipy\sparse\csr.py in check_bounds(indices, N) 235 max_indx = indices.max() 236 if max_indx >= N: --> 237 raise IndexError('index (%d) out of range' % max_indx) 238 239 min_indx = indices.min()
IndexError: index (399) out of range
Would anyone of you please help?