Questions tagged [linear-discriminant]

103 questions
27
votes
1 answer

Why eigenvector & eigenvalue in LDA become zero?

I'd like to implement fast PLDA (Probabilistic Linear Discriminant Analysis) in OpenCV. in this, LINK fast PLDA have been implemented in Matlab and Python. One of the parts of PLDA is LDA. I've written following code for implementing LDA in…
Saeid
  • 508
  • 1
  • 4
  • 20
8
votes
1 answer

Linear Discriminant Analysis vs Naive Bayes

What are the advantages and disadvantages of LDA vs Naive Bayes in terms of machine learning classification? I know some of the differences like Naive Bayes assumes variables to be independent, while LDA assumes Gaussian class-conditional…
6
votes
1 answer

LDA interpretation

I use the HMeasure package to involve the LDA in my analysis about credit risk. I have 11000 obs and I've chosen age and income to develop the analysis. I don't know exactly how to interpret the R results of LDA. So, I don't know if I chosen the…
Dalila
  • 181
  • 2
  • 2
  • 8
4
votes
2 answers

R - "CAPdiscrim" and "lda" error "variable 1 appears to be constant within groups"

so I've been trawling through existing questions for solutions to this one, but to no avail. I have a dataset consisting of individuals (117), each with an observation from a different variable (12), and grouped by a factor variable with 8 levels. I…
4
votes
0 answers

Why do LDA returns only 1 column in sklearn/Python?

The following code print "X type", type(X_all2) print "X shape", np.shape(X_all2) print "Y type", type(y_all2) print "Y shape", np.shape(y_all2) y_all2 = np.reshape(y_all2, (395, 1)) print "Y type", type(y_all2) print "Y shape",…
Dims
  • 47,675
  • 117
  • 331
  • 600
3
votes
0 answers

How can I plot a histogram on rotated axis in projection space (LDA)

I used the mean separation criterion (find parameter w that maximizes distance between class means) as well as Fisher LDA to find a nice line to separate two linearly separable classes. Then I plotted the histogram. As you can see there is a lot of…
dg_m87
  • 67
  • 5
3
votes
0 answers

Is it possible to get decision boundary equation for Quadratic Discriminant Analysis?

I use Python and sklearn packages. I used LDA for predictions and I can get the coefficients of the decision boundary. clf = LinearDiscriminantAnalysis(priors=[prob_norm, prob_anem]) clf.fit(X_train, y_train) y_predict =…
Arzental
  • 103
  • 6
3
votes
1 answer

Plot boundary lines between classes in python based on multidimensional data?

I am trying to plot boundary lines of Iris data set using LDA in sklearn Python based on this documentation. For two dimensional data, we can easily plot the lines using LDA.coef_ and LDA.intercept_. But for multidimensional data that has been…
Luxi
  • 31
  • 1
  • 3
3
votes
2 answers

difference between sklearn.lda.LDA() and sklearn.discriminant_analysis.LinearDiscriminantAnalysis()

In duration of reading about LinearDiscriminantAnalysis using python , I had got two different methods to implement it which are available here…
3
votes
1 answer

How to perform prediction with LDA (linear discriminant) in scikit-learn?

I've been testing out how well PCA and LDA works for classifying 3 different types of image tags I want to automatically identify. In my code, X is my data matrix where each row are the pixels from an image and y is a 1D array stating the…
Jack Simpson
  • 1,681
  • 3
  • 30
  • 54
3
votes
3 answers

R Error : some group is too small for 'qda'

I used the MASS::qda() to find the classfier for my data and it always reported `some group is too small for 'qda' Is it due to the size of test data I used for model ? I increased the test sample size from 30 to 100, it reported the same error.…
user2993059
  • 55
  • 1
  • 1
  • 7
2
votes
1 answer

Apply PLSDA model to predict another data?

I am developing a discriminant model using PLSDA (mixOmics package, the model works well by external validations. To do external validation, I use the predict() function. However, suppose now I have to give this prediction equation/model to my…
hn.phuong
  • 835
  • 6
  • 15
  • 24
2
votes
2 answers

Subscript out of bounds while LDA analysis

I am trying to run linear discriminant analysis in R. My dataframe contains two groups of data with dimension of 102 and 24. I ran R-code as follows: mydata<-read.table() head(mydata) Factor TL SL FL HL HH EHH BH BW CL CH FNL DFH…
mohammad gerami
  • 153
  • 1
  • 9
2
votes
0 answers

MemoryError when shrinkage=true for LinearDiscriminantAnalysis

The rest of the scenarios the algorithm works well apart from setting the shrinkage parameter. In order to improve the accuracy of the algorithm I am using various techniques. In the scikit document it says using shrinkage can improve accuracy. I…
2
votes
0 answers

sklearn LDA: difference between coef_ and scalings_?

I'm new to LDA. The documentation isn't very clear - what's the difference between coef_ and scalings_? My data has many features (F1, F2, ..., F10000) and some labeled classes (C1, C2, ..., C5). I want to find the equations of the 2 lines (linear…
Ray Zhang
  • 1,411
  • 4
  • 18
  • 36
1
2 3 4 5 6 7