Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull out visualization code from the similarity detection #14

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

shankari
Copy link
Contributor

This is largely a direct copy of the existing graph function from
emission/analysis/modelling/tour_model/similarity.py in
https://github.com/e-mission/e-mission-server.git

Minor modifications:

  • move the matplotlib imports out
  • create a figure (fig = plt.figure()) before the plot
  • return the figure so it is displayed properly
  • add a line indicating the cutoff point in the graph
    • change the color of the existing cutoff to be red
    • notice that it is not visible
    • add a line indicating the cutoff instead

Also add the scaffolding to read and analyse data before generating the graph

  • read the data
  • create a similarity object
  • create the bins

Note that this uses the newly refactored calc_cutoff_bins method so we can
plot the graph before and after the uncommon trips are removed

This is largely a direct copy of the existing `graph` function from
`emission/analysis/modelling/tour_model/similarity.py` in
https://github.com/e-mission/e-mission-server.git

Minor modifications:
- move the matplotlib imports out
- create a figure (`fig = plt.figure()`) before the plot
- return the figure so it is displayed properly
- add a line indicating the cutoff point in the graph
    - change the color of the existing cutoff to be red
    - notice that it is not visible
    - add a line indicating the cutoff instead

Also add the scaffolding to read and analyse data before generating the graph
- read the data
- create a similarity object
- create the bins

Note that this uses the newly refactored `calc_cutoff_bins` method so we can
plot the graph *before* and after the uncommon trips are removed
shankari added a commit to shankari/e-mission-server that referenced this pull request Jan 27, 2021
Pull out the visualization code so it can be run in a notebook
New code is here:
e-mission/e-mission-eval-private-data#14

Required a minor refactor since the prior call to graph was in the middle of
`delete_bins` - after the cutoff and before the remove.

We clearly don't want to generate graphs for this as part of a production
system. So it is correct to remove the `graph()` call.

To access the state of the object between the cutoff and the remove, we pull
out the cutoff into a separate function
@shankari shankari merged commit 3825bbc into e-mission:master Jan 28, 2021
@shankari shankari deleted the add_clustering_viz branch January 28, 2021 00:58
jf87 pushed a commit to jf87/e-mission-server that referenced this pull request Jun 21, 2021
Pull out the visualization code so it can be run in a notebook
New code is here:
e-mission/e-mission-eval-private-data#14

Required a minor refactor since the prior call to graph was in the middle of
`delete_bins` - after the cutoff and before the remove.

We clearly don't want to generate graphs for this as part of a production
system. So it is correct to remove the `graph()` call.

To access the state of the object between the cutoff and the remove, we pull
out the cutoff into a separate function
humbleOldSage pushed a commit to humbleOldSage/e-mission-eval-private-data that referenced this pull request Dec 1, 2023
This is largely a direct copy of the existing `graph` function from
`emission/analysis/modelling/tour_model/similarity.py` in
https://github.com/e-mission/e-mission-server.git

Minor modifications:
- move the matplotlib imports out
- create a figure (`fig = plt.figure()`) before the plot
- return the figure so it is displayed properly
- add a line indicating the cutoff point in the graph
    - change the color of the existing cutoff to be red
    - notice that it is not visible
    - add a line indicating the cutoff instead

Also add the scaffolding to read and analyse data before generating the graph
- read the data
- create a similarity object
- create the bins

Note that this uses the newly refactored `calc_cutoff_bins` method so we can
plot the graph *before* and after the uncommon trips are removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant