Skip to content

Instantly share code, notes, and snippets.

@aagnone3
Created October 30, 2020 00:16
Show Gist options
  • Save aagnone3/31a19d77eae9b96f923fd57075ac67ac to your computer and use it in GitHub Desktop.
Save aagnone3/31a19d77eae9b96f923fd57075ac67ac to your computer and use it in GitHub Desktop.
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