# Finding the attribute that affects the outcome the most

Lets say I have a medical data set of cause of deaths.

df.columns

Index(['Cause of Death', 'Community Area', 'Community Area Name',
'Cumulative Deaths 2006 - 2010', 'Cumulative Deaths Rank',
'Average Annual Deaths 2006 - 2010', 'Average Crude Rate 2006 - 2010',
'Average Crude Rate Lower CI', 'Average Crude Rate Upper CI',
'Crude Rate Rank', 'Average Adjusted Rate 2006 - 2010',
'Average Annual Years of Potential Life Lost (YPLL) Rate 2006 - 2010',
'YPLL Rate RANK', 'WARNING'],
dtype='object')


One of the causes of death is "Diabetes." Now If I want to find the single or few attributes in the data that have the most impact on cause of death being "Diabetes," what should I do?

If you can, please provide code samples (in Python or pandas) too as I'm a novice.

• It would help to know the context of your analysis. Are you: a) learning to code some stats; or b) doing actual applied research? – conjectures Mar 6 '17 at 15:39
• @conjectures This is supposed to be the first step of doing research on the data. We may have to change the dataset itself in future, but the purpose pretty much remains the same: finding the most significant attributes that lead to death by Diabetes. (Say, income, Zip Code, Sex, ...) These will be attributes in our dataset. And the Cause of Death will be another attribute. – Goh-shans Mar 7 '17 at 19:30

Tree based ensemble machine learning algorithms such as Random Forest and Gradient boost etc. give level of importances (impact) of individual predictors (attributes i.e. X) in determining the target (death by Diabetes i.e. y).

You can implement these through python using Scikit-learn libraries.

Note that one must also take into consideration the inherent drawbacks and biases of these method.