diff --git a/emission/analysis/classification/inference/mode/seed/pipeline.py b/emission/analysis/classification/inference/mode/seed/pipeline.py index 7a9e0f48b..d51e94d3a 100644 --- a/emission/analysis/classification/inference/mode/seed/pipeline.py +++ b/emission/analysis/classification/inference/mode/seed/pipeline.py @@ -313,10 +313,12 @@ def selectFeatureIndicesStep(self): logging.debug("location features = %s" % LocationFeatureIndices) logging.debug("time features = %s" % TimeFeatureIndices) logging.debug("bus train features = %s" % BusTrainFeatureIndices) + retIndices = genericFeatureIndices if eac.get_config()["classification.inference.mode.useAdvancedFeatureIndices"]: - return genericFeatureIndices + AdvancedFeatureIndices + BusTrainFeatureIndices - else: - return genericFeatureIndices + BusTrainFeatureIndices + retIndices = retIndices + AdvancedFeatureIndices + if eac.get_config()["classification.inference.mode.useBusTrainFeatureIndices"]: + retIndices = retIndices + BusTrainFeatureIndices + return retIndices def buildModelStep(self): from sklearn import ensemble diff --git a/emission/analysis/section_features.py b/emission/analysis/section_features.py index 83e9bdfdc..a62f81baa 100644 --- a/emission/analysis/section_features.py +++ b/emission/analysis/section_features.py @@ -102,9 +102,9 @@ def calHCR(section_entry): return 0 def calSR(section): - if 'speeds' not in section: + if 'speeds' not in section.data: return 0 - speeds = section.speeds + speeds = section.data["speeds"] if len(speeds) < 2: return 0 else: @@ -114,7 +114,7 @@ def calSR(section): if currVelocity != None and currVelocity <= 0.75: stopNum += 1 - sectionDist = section.distance + sectionDist = section.data.distance if sectionDist != None and sectionDist != 0: return stopNum/sectionDist else: diff --git a/emission/storage/decorations/analysis_timeseries_queries.py b/emission/storage/decorations/analysis_timeseries_queries.py index dbeb39c2d..d4ad9a073 100644 --- a/emission/storage/decorations/analysis_timeseries_queries.py +++ b/emission/storage/decorations/analysis_timeseries_queries.py @@ -83,7 +83,7 @@ def get_timeseries_for_user(user_id): def get_time_query_for_trip_like(key, trip_like_id): """ Returns the query that returns all the points associated with this - trip-like (raw trip, cleaned trip, raw section) + trip-like (examples of trip-like objects are: raw trip, cleaned trip, raw section) """ trip = get_object(key, trip_like_id) return get_time_query_for_trip_like_object(trip)