Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# with the street probabilities, we can now assign them to each sample.
# as mentioned before, samples on street corners receive the mean of each street probability.
def assign_street_probabilities(address, probabilities):
return np.mean([
for road in address.split(" / ")
train["RoadProba"] = train["Address"].map(partial(assign_street_probabilities, probabilities=log_probas))
train.drop("Address", axis=1, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment