Random Forest Regressor with Scikit Learn for Heart Disease Prediction
Warm Up: Machine Learning with a Heart HOSTED BY DRIVENDATA
I used a Random Forest Regressor from Scikit Learn to predict if a given patient has a heart disease
I originallt used a Feedforward Neural Network but the Random Forest Regressor had a better log loss as can be seen in the model file.
-- Link to the competetion: https://www.drivendata.org/competitions/54/machine-learning-with-a-heart/
- Numpy
- Matplotlib(IF YOU WANT TO display trends, I put a # on them to help with processing speed)
- Scikit Learn
- Keras
- Tensorflow
- Math
- Pandas
- Import dependencies
- Load Training Features Data
- Turn data into a pandas data frame and Display
- Replace the strings in thal column with corresponding numbers
- Turn features into numpy arrays
- Check shape
- Split the model
- Define the Model
- Fit and train
- Let's Evaluate Our Model with the loss function and accuracy