VishalSinghParmar2001 / Relating-Social-Media-to-Stock-Movement-Public

We explore the application of Machine Learning for predicting the return of the stock by using the information of stock returns. A trading strategy based on this analysis leads to increased trading profits up to three times compared with a simple buy and hold strategy.
Apache License 2.0
16 stars 8 forks source link

[Bug]: Imbalanced Classes #8

Open visheshks04 opened 2 years ago

visheshks04 commented 2 years ago

Contact Details

visheshkrsinghofficial@gmail.com

What happened?

As of now, the model is being trained on unbalanced classes which causes it to overfit the majority class and ignore the other one. I can fix this. @ricardoprins can you assign this to me?

Relevant log output

#y_train[y_train==1].count()

target    1444
dtype: int64

#y_train[y_train==0].count()

target    3845932
dtype: int64

       precision    recall  f1-score   support

 0       1.00      1.00      1.00   2563950
 1       0.00      0.00      0.00       968

Code of Conduct

ricardoprins commented 2 years ago

You're it! Thanks again for your valuable input here!

visheshks04 commented 2 years ago

Thanks @ricardoprins

visheshks04 commented 2 years ago

@ricardoprins Should I make the changes in the Logistic Regression Notebook itself? What do you think?

ricardoprins commented 2 years ago

Initially, yes.

Perhaps refactoring it could be material for future issues. You can do it afterward if you desire. It is always a good idea to do it though, to avoid any future issues and to improve maintainability.

visheshks04 commented 2 years ago

Sure I will do that.