sf_crime_6.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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