Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sf_crime_6.py
# finalize the log road probability feature
pd_counts = pd.Series(counts)
log_probas = np.log(pd_counts / pd_counts.sum())
# have a look at the distribution of log road probabilities in the data
plt.figure(figsize=(10, 10))
sns.displot(log_probas.values)
plt.xlabel('ln(P(road))')
plt.ylabel('P(x)')
_ = plt.title("Distribution of Log Probas for Street Occurrence", fontdict={'fontsize': 16})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment