0
$\begingroup$

My data has 50 features like... 1. student_num 2. sub1 3. sub2 4. sub3 .. .. 50. hasFailed

There's one row for each student. I have 12000 students so 12000 records. My goal is to reduce dimensional. I need to predict if a student will fail.

Should I remove student_num before PCA?

$\endgroup$
11
  • 1
    $\begingroup$ Can you say more about your situation, your data, & your goals? Why are you doing PCA? Is student_num just a unique identifier for each individual student (1st student, 2nd student, etc)? Why would that be in your dataset, do you have multiple rows for some (every) student? $\endgroup$ Commented Jan 31, 2019 at 19:15
  • 6
    $\begingroup$ If the student ID is just a convenient identifier, then it's irrelevant. For example, students' phone numbers have no relationship to academic achievement, so likewise you wouldn't include the phone number as data. $\endgroup$
    – Sycorax
    Commented Jan 31, 2019 at 19:48
  • 1
    $\begingroup$ A more interesting question is why you think you need to do a PCA before doing your logistic regression. $\endgroup$
    – mdewey
    Commented Feb 1, 2019 at 13:32
  • 2
    $\begingroup$ @Sycorax The student ID is not necessarily irrelevant: see Lord's paper on football numbers. I have encountered such situations. In one, soil samples were identified with sequential integers--and those identifiers were extremely useful for modeling the results, because for practical reasons the samplers did not move around randomly and thus the IDs were a good proxy for spatial proximity. In the student case, ID could be related to when the student enrolled and that could be related to all kinds of meaningful characteristics. $\endgroup$
    – whuber
    Commented Feb 1, 2019 at 15:46
  • 2
    $\begingroup$ @whuber Fair point. I leapt to the conclusion that student IDs are independent from the data, and therefore irrelevant, which may not hold true in some circumstances. $\endgroup$
    – Sycorax
    Commented Feb 1, 2019 at 16:02

1 Answer 1

0
$\begingroup$

PCA should only be used on interval type variables.

These are variables where differences and division make sense. Because PCA performs such operations.

So given the student is example: does it make sense to compute the differences of student IDs? Does it make sense to argue that the student IDs of Bob and Sally differ by twice as much as those of Adam and Eve? If not, then you probably shouldn't use PCA not standardization.

It doesn't mean such variables are useless. They may just need to be handled differently. For example phone numbers (used to) have a meaningful area code. Treating phone numbers with PCA is stupid, but treating the area code as a category is okay. It's even better when you can map them to actual cities...

$\endgroup$
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.