diff --git a/emission/analysis/modelling/trip_model/mapping.py b/emission/analysis/modelling/trip_model/mapping.py index cd2d11766..06f0614ea 100644 --- a/emission/analysis/modelling/trip_model/mapping.py +++ b/emission/analysis/modelling/trip_model/mapping.py @@ -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] @@ -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']) diff --git a/emission/analysis/modelling/trip_model/models.py b/emission/analysis/modelling/trip_model/models.py index f3026b6b8..e5fc08b46 100644 --- a/emission/analysis/modelling/trip_model/models.py +++ b/emission/analysis/modelling/trip_model/models.py @@ -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 @@ -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 @@ -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(): @@ -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]