Tutorial: Pass train_file.name instead of train_file

Change train_file to train_file.name in tutorial for Linear model.
This commit is contained in:
Sahil Dua 2017-06-17 18:52:03 +02:00 committed by GitHub
parent 1f82b7a5bf
commit 817c4db19e

View File

@ -69,8 +69,8 @@ COLUMNS = ["age", "workclass", "fnlwgt", "education", "education_num",
"marital_status", "occupation", "relationship", "race", "gender", "marital_status", "occupation", "relationship", "race", "gender",
"capital_gain", "capital_loss", "hours_per_week", "native_country", "capital_gain", "capital_loss", "hours_per_week", "native_country",
"income_bracket"] "income_bracket"]
df_train = pd.read_csv(train_file, names=COLUMNS, skipinitialspace=True) df_train = pd.read_csv(train_file.name, names=COLUMNS, skipinitialspace=True)
df_test = pd.read_csv(test_file, names=COLUMNS, skipinitialspace=True, skiprows=1) df_test = pd.read_csv(test_file.name, names=COLUMNS, skipinitialspace=True, skiprows=1)
``` ```
Since the task is a binary classification problem, we'll construct a label Since the task is a binary classification problem, we'll construct a label