Problems with Linear Discriminant Analysis Classifier

I wrote two functions for determining the linear discriminant classifier of an EEG data set. The data set consists of preprocessed EEG data ∈5×62×5322 and stimulus labels ∈2×5322 during a copy-spelling paradigm with a P300 speller. The data matrix X contains 5 selected time windows of EEG activity at 62 electrodes after a visual stimulus was presented on the screen in front of the subject. If the first row of is 1, the stimulus was a target stimulus, if the …
Category: Data Science

Adding $1$ feature to data point to avoid bias

Given data point $x\in X,\ x\in \mathbb{R}^p$, once we resolve the parameters of the linear discriminant model, we will have $\hat{B} = (X^TX)^{-1}X^TY$, where $Y \in \mathbb{R}^{N\times K}$ is the response matrix. We can then produce a vector for each data point $\hat{f}\left( x \right) =\left[ \left( 1\ x \right) \hat{B} \right] ^T$To know which class the data point belongs to, we use $G\left( x \right) ={arg\max}\hat{f}_k\left( x \right)$. I noticed that $(p+1)$ has 1 added feature to all inputs …
Category: Data Science

Comparison of classifier confusion matrices

I tried implementing Logistic regression, Linear Discriminant Analysis and KNN for the smarket dataset provided in "An Introduction to Statistical Learning" in python. Logistic Regression and LDA was pretty straight forward in terms of implementation. Here are the confusion matrices on a test dataset. Both of them are pretty similar with almost same accuracy. But I tried finding a K for KNN by plotting the loss vs K graph: and chose a K around 125 to get this confusion matrix …
Category: Data Science

Difference between LDA and Naive Bayes

LDA: linear discriminant analysis Suppose we have a classification problem. I understand that the data can be such that the features may have discrete values or continuous values. Suppose our data contains continuous feature values. Then we can apply Naive Bayes using a distribution. Lets assume the data to be normally distributed and so use Naive Bayes with normal distribution. We can also apply LDA which also uses Normal distribution. Using Naive Bayes we assume the features to be independent …
Category: Data Science

Linear discriminant analysis in R: how to choose the most suitable model?

The data set vaso in the robustbase library summarizes the vasoconstriction (or not) of subjects’ fingers along with their breathing volumes and rates. > head(vaso) Volume Rate Y 1 3.70 0.825 1 2 3.50 1.090 1 3 1.25 2.500 1 4 0.75 1.500 1 5 0.80 3.200 1 6 0.70 3.500 1 I want to perform a linear discriminant analysis in R to see how well these distinguish between the two groups. And I consider two cases: ld <- lda(Y …
Category: Data Science

Linear Discriminant Analysis + bayesian theorem = LDA classifier??

I am new to machine learning and as I learn about Linear Discriminant Analysis, I can't see how it is used as a classifier. I can understand the difference between LDA and PCA and I can see how LDA is used as dimension reduction method. I've read some articles about LDA classification but I'm still not exactly sure how LDA is used as classifier. From what I understand, we consider the features vector x as multivariate gaussian distribution and use …
Category: Data Science

Is there a relationship between LDA, linear SVMs and Perceptron?

LDA (linear discriminant analysis), SVMs with a linear kernel, and perceptrons are linear classifiers. Is there any other relationship between them, e.g.: Every decision boundary that can be found by LDA can be found by linear SVM Every decision boundary that can be found by linear SVM can be found by LDA. Every decision boundary that can be found by LDA can be found by a perceptron Every decision boundary that can be found by linear SVM can be found …
Category: Data Science

Linear Discriminant Analysis (LDA) , Removing colinear features in cross validation set up is correct or not?

My data is a matrix with 725 features and 667 observations which have binary data(either 0 or 1). my target variable is a univariate which has two classes (either 0 or 1). I removed the features which had zero as column sums, so features reduced to 652. since I have a binary data I did not do the preprocessing (Mean = 0 and s.d=1). But, My data is highly sparse; there is 99% sparsity. If I want to use LDA …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.