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() 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)