Skip to content

Commit

Permalink
Update inter-file dependencies for relocated files
Browse files Browse the repository at this point in the history
Updating import paths and dependencies among the four files ( mapping.py, clustering.py, models.py, data_wrangling.py ) that were recently moved from e-mission-eval-private-data
  • Loading branch information
humbleOldSage committed Dec 3, 2023
1 parent 425136c commit 2fd9d78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions emission/analysis/modelling/trip_model/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import branca.element as bre
from scipy.spatial import ConvexHull

import data_wrangling
from clustering import add_loc_clusters, ALG_OPTIONS
import emission.analysis.modelling.trip_model.data_wrangling as eamtd
from emission.analysis.modelling.trip_model.clustering import add_loc_clusters, ALG_OPTIONS

DENVER_COORD = [39.7392, -104.9903]
MTV_COORD = [37.3861, -122.0839]
Expand Down Expand Up @@ -109,7 +109,7 @@ def find_plot_clusters(user_df,

# expand the 'start_loc' and 'end_loc' column into 'start_lat',
# 'start_lon', 'end_lat', and 'end_lon' columns
all_trips_df = data_wrangling.expand_coords(all_trips_df)
all_trips_df = eamtd.expand_coords(all_trips_df)

labeled_trips_df = all_trips_df.loc[all_trips_df.user_input != {}].dropna(
subset=['purpose_confirm'])
Expand Down
10 changes: 5 additions & 5 deletions emission/analysis/modelling/trip_model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from sklearn.exceptions import NotFittedError

# our imports
from clustering import get_distance_matrix, single_cluster_purity
import data_wrangling
from emission.analysis.modelling.trip_model.clustering import get_distance_matrix, single_cluster_purity
import emission.analysis.modelling.trip_model.data_wrangling as eamtd
import emission.storage.decorations.trip_queries as esdtq
from emission.analysis.classification.inference.labels.inferrers import predict_cluster_confidence_discounting
import emission.core.wrapper.entry as ecwe
Expand All @@ -28,7 +28,7 @@
import emission.analysis.modelling.trip_model.run_model as eamur


import clustering
import emission.analysis.modelling.trip_model.clustering as eamtc
# NOTE: tour_model_extended.similarity is on the
# eval-private-data-compatibility branch in e-mission-server

Expand Down Expand Up @@ -82,7 +82,7 @@ def _clean_data(self, df):

# expand the 'start_loc' and 'end_loc' column into 'start_lat',
# 'start_lon', 'end_lat', and 'end_lon' columns
df = data_wrangling.expand_coords(df)
df = eamtd.expand_coords(df)

# drop trips with missing coordinates
if df.start_lat.isna().any():
Expand Down Expand Up @@ -334,7 +334,7 @@ def fit(self, unused,train_entry_list=None):

# fit the bins
self.sim_model= eamtg.GreedySimilarityBinning(model_config)
cleaned_trip_entry= clustering.cleanEntryTypeData(self.train_df,train_entry_list)
cleaned_trip_entry= eamtc.cleanEntryTypeData(self.train_df,train_entry_list)
self.sim_model.fit(cleaned_trip_entry)

labels = [int(l) for l in self.sim_model.tripLabels]
Expand Down

0 comments on commit 2fd9d78

Please sign in to comment.