Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions basic_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -40,4 +40,4 @@ def main():
cu.write_submission(submission_file, probs)

if __name__=="__main__":
main()
main()
4 changes: 2 additions & 2 deletions features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))})

###########################################################

Expand All @@ -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)
print(features)