From e14e48681feaf02f20987a7e7acbdcdf653ab160 Mon Sep 17 00:00:00 2001 From: Kyle Hamilton Date: Sat, 19 Mar 2016 16:47:58 -0400 Subject: [PATCH 1/2] Update basic_benchmark.py --- basic_benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic_benchmark.py b/basic_benchmark.py index 6bb83c0..86feee5 100644 --- a/basic_benchmark.py +++ b/basic_benchmark.py @@ -23,7 +23,7 @@ def main(): fea = features.extract_features(feature_names, data) print("Training the model") - rf = RandomForestClassifier(n_estimators=50, verbose=2, compute_importances=True, n_jobs=-1) + rf = RandomForestClassifier(n_estimators=50, verbose=2, n_jobs=-1) rf.fit(fea, data["OpenStatus"]) print("Reading test file and making predictions") @@ -40,4 +40,4 @@ def main(): cu.write_submission(submission_file, probs) if __name__=="__main__": - main() \ No newline at end of file + main() From 6025be8995a0871d4bea97146ff987ca1773c889 Mon Sep 17 00:00:00 2001 From: Kyle Hamilton Date: Sat, 19 Mar 2016 16:49:28 -0400 Subject: [PATCH 2/2] Update features.py --- features.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features.py b/features.py index 11359a9..7bf91eb 100644 --- a/features.py +++ b/features.py @@ -27,7 +27,7 @@ def title_length(data): def user_age(data): return pd.DataFrame.from_dict({"UserAge": (data["PostCreationDate"] - - data["OwnerCreationDate"]).apply(lambda x: x.total_seconds())}) + - data["OwnerCreationDate"]).apply(lambda x: x/np.timedelta64(1,'s'))}) ########################################################### @@ -52,4 +52,4 @@ def extract_features(feature_names, data): data = cu.get_dataframe("C:\\Users\\Ben\\Temp\\StackOverflow\\train-sample.csv") features = extract_features(feature_names, data) - print(features) \ No newline at end of file + print(features)