def feature_vector(trip): velocity = compute_velocity(trip) velocity5 = n_step_diff(trip, n=5) acceleration = np.gradient(velocity) acceleration5 = np.gradient(velocity5) cos_dt = [cos_between(a, np.array([1, 0])) for a in acceleration5] angle_dt = [np.arccos(c) for c in cos_dt] speed = compute_scalar(velocity) corner_features = corners_features(velocity) acc_features = acceleration_features(velocity, angle_dt, cos_dt, speed) return np.hstack((corner_features, acc_features))
def feature_vector(trip): velocity = compute_velocity(trip) speed = compute_scalar(velocity) corner_features = corners_features(velocity) acc_features = acceleration_features(speed) return np.hstack((corner_features, acc_features))