Elemental Data Science A blog on Data Science and Statistics.
Posts with the tag Python:

Using Python and Random Forest to predict Diabetes Risk.

Two weeks ago I wrote a post, Using R and Random Forest to predict Diabetes Risk. Since I am less experienced with using python in machine learning models, and this was a data set that worked out so nicely, I figured I would take an attempt at it. First we need to load all the modules and functions we need to use. import pandas as pd from matplotlib import pyplot as plt import numpy as np import seaborn as snsĀ from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn import metrics The next thing is just like was done in R, load the data, clean it up a bit for using scikit-learn to create a classification model, and then split our factors from our classification variable.