0

I need to T-Test to check whether the Sentiment feature has a significant role in identifying gender from text. I have computed the TF-IDF feature and got author_post_new. I have applied the Sentiment feature on the dataset and got X_pac from the dataset. Now I want to determine whether the Sentiment feature has a significant role in identifying gender.

X_pac = feature_computed_on_sentiment_feature
author_post_new = feature_computed_on_TF_IDF

I need to perform T-test for the SVM model on these two features. How can I do that in Python?

Nick ODell
  • 15,465
  • 3
  • 32
  • 66
Christopher Marlowe
  • 2,098
  • 6
  • 38
  • 68
  • Hi Christopher, would you mind elaborating on how you want to test for significance from a statistical perspective? The concept of "calculating p-values to understand whether a variable has a significant impact" does not really carry over to support vector machines, which is why I am asking. To put it differently: T-Test do not make any sense for a SVM because they will not give you any useful result. Once we know what you want to do from a statistical perspective, it should be easy to find an implementation. – Simon David May 19 '23 at 21:38
  • It doesn't sound like you need a T-test. It sounds like what you need is to compute the correlation between Gender and X_pac, and the correlation between Gender and author_post_new, and see which one is higher. – Nick ODell May 19 '23 at 21:39

0 Answers0