Week 7: Finishing Touches And Moving On
April 21, 2023
Welcome back to my blog! This week’s entry will be a bit on the shorter side. I did some finishing touches on the models before comparing them. Next week, I can move on to applying these models to the current tech industry, and how companies can use these models to benefit their employees.
Finishing Touches On The Models:
The accuracy for my logistic regression model was much lower than expected: around 70%, which is similar to the accuracy for the random forest. Thus I decided to revisit the model and try to get a higher accuracy without overfitting.
First, I decided to create a method that would define a logistic regression model, taking in X, Y, and a test size.
Next, I tested the method to make sure it works.
Finally, I created a loop which would create 1000 different models. Then I found the model with the highest accuracy among all of those.
The highest accuracy I ended up getting was around 74%.
Comparing The Models:
Now that my models are complete, I can move on to comparing them. Here is a chart comparing the accuracies of the models:
Model | Accuracy | Percent Over Baseline |
Logistic Regression | 74% | 24% |
Neural Network | 73% | 23% |
Random Forest | 70% | 20% |
The best model seems to be the logistic regression model, but since the accuracy of the logistic regression model and the neural network are similar, we can compare then by their false positives and negatives.
Confusion matrix for logistic regression model:
Confusion matrix for neural network:
As you can see, both models have a similar number of false positives and negatives, but the logistic regression model has a few more false negatives while the neural network has a few more false negatives. Since this is roughly similar, I would say that the logistic regression model is the best in this case.
Next week, I will begin applying these models to the current tech industry, so that companies can use these models to benefit their employees.
Thank you for reading!
Sources:
- Open Sourcing Mental Illness, LTD. “OSMI Mental Health In Tech Survey 2016.” Kaggle.Com, 2016, Www.Kaggle.Com/Datasets/Osmi/Mental-Health-In-Tech-2016.