Skip to content

Commit

Permalink
Merge pull request #576 from shankari/create_tree_pipeline
Browse files Browse the repository at this point in the history
Minor fixes to inference before redoing it completely
  • Loading branch information
shankari authored Mar 14, 2018
2 parents 35aa174 + 2da23eb commit 6023174
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions emission/analysis/section_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6023174

Please sign in to comment.