Questions tagged [linear-discriminant]

103 questions
0
votes
0 answers

How use Linear Discriminant Analysis to predict based on values from serial

I'm working on a program that predicts hand movements based on EMG signals. So far, i have a CSV file to be used as a database for the LDA program. The issue that i'm finding is actually being able to predict with the program. Is there a way in…
Crowned 31
  • 11
  • 3
0
votes
0 answers

Should I use multinomial logistic regression or linear discriminant analysis?

In a classification problem, I cannot use a simple logit model if my data label (aka., dependent variable) has more than two categories. That leaves me with multinomial regression and Linear Discriminant Analysis (LDA) and the likes. Why is it that…
0
votes
0 answers

How to plot decision boundaries for a Linear Discrimination Analysis plot in R using 3 input variables

I would like to plot the decision boundaries of LDA for a matrix with 3 input variables and 2 classes. I could find some code for plotting the boundaries if only 2 input variables are given to LDA, but the code I found for 3 input variables gives an…
0
votes
0 answers

ValueError: X has 2 features per sample; expecting 10

Hello i am a beginner in coding and have to do a gene analysis for my bio-informatics class. When i classify some genes. I get the following error: File "C:\Users\arthi\Anaconda3\lib\site-packages\sklearn\discriminant_analysis.py", line 514, in…
0
votes
0 answers

Linear Discriminant Analysis Functions in R

I have the following R code ldf <- function(x, prior, mu, covar) { x <- matrix(as.numeric(diabetes), ncol=1) log(lda.res$prior) - (0.5*t(lda.res$mean)%*%solve(cov_all)%*%lda.res$mean) + (t(x)%*%solve(covar)%*%mu) } I understand that the code is a…
asasas
  • 1
0
votes
0 answers

Log-odds decision boundary of multivariate distribution

I have some 2d data about 2 classes and I am trying to compute the log odds: ln(P(class=a|x)/P(class=b|x)) Then I want to plot the decision boundary, namely all the points that have log odds = 0. I have done this for 1d data but for 2d data, my…
user10706448
0
votes
0 answers

Single sample prediction problem when training set dimensions reduced with LDA

I have a trouble with supervised classification method I am using for my data. Let's think we are training our algorithm with a data (N=70) after reducing the dimensions from 100 to 2 by using LDA dimensionality reduction method. Now, we would like…
0
votes
1 answer

How to Obtain Constant Term in Linear Discriminant Analysis

Consider dput: structure(list(REAÇÃO = structure(c(0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1), format.spss = "F11.0"), IDADE = structure(c(22, 38, 36, 58, 37, 31, 32, 54, 60, 34,…
neves
  • 796
  • 2
  • 10
  • 36
0
votes
1 answer

Linear Discriminant Analysis requirements

I'm trying to analyse a sparse dataset using sklearn LDA (but not only that one, I've also tried a personal implementation). The dataset has 14 columns and some varying number of columns which I've selected to run different experiments, keeping…
0
votes
1 answer

Get projection matrix of lda in scikit-learn

I need to get the projection matrix from lda, which has been supplied the train data, so that I can use that to project the train data in the lda space. I have done the following : def get_projection(features,label): transformer =…
rj dj
  • 260
  • 1
  • 5
  • 22
0
votes
0 answers

Linear Discriminant Analysis in python

I am doing Linear Discriminant Analysis in python but having some problems. Using the tutorial given here is was able to calculate linear discriminant analysis using python and got a plot like this: Using this code given below: import pandas as…
0
votes
0 answers

How can I visualize Flexible Discrimant Analysis as a biplot in R?

I've read the paper of Gardner and Le Roux about Extensions of Biplot Methodology to Discriminant Analysis. I wanted to ask if someone got any practical experience with that method. I've got a FDA model for a data set from kaggle Human Resources…
sha
  • 1
  • 1
0
votes
1 answer

RuntimeWarning: invalid value encountered in divide S**2))[:self._max_components]

I'm trying to perform dimensionality reduction on a classification problem with two classes. I have 6 csv files. My code is here: def linear_discrimination_analysis(files): with open(os.path.join("/Users", "byname", "PycharmProjects",…
user2398046
0
votes
0 answers

Logistic Regression Error Classification

I have a question that has to do with evaluating the prediction of a logistic regression model. I am fairly new to this, so please bear with me. First I will show what I have done with LDA because I want to have a similar "misclassification rate"…
0
votes
1 answer

LDA accuracy is higher for reduced dataset than for original

I'm trying to reduce a dataset with LDA. I expect that on reduced dataset I will have less accuracy. However, depending on the random seed I get sometimes the reduced version is giving me higher accuracy. X, y = make_classification(1000, 50,…