Last active
August 29, 2015 14:16
-
-
Save romovpa/2e10888ec31c431d0e90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import urllib2 | |
feature_names_url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/spambase/spambase.names' | |
feature_names = [ | |
line.strip().split(':')[0] | |
for line in urllib2.urlopen(feature_names_url).readlines()[33:] | |
] | |
spam_data = pandas.read_csv( | |
'https://archive.ics.uci.edu/ml/machine-learning-databases/spambase/spambase.data', | |
header=None, names=(feature_names + ['spam']) | |
) | |
X, y = spam_data.ix[:, :-1].values, spam_data.ix[:, -1].values | |
spam_data.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment