Utilities¶
-
bike_sharing_demand.utilities.
bump_dummies
(dummy_variables_list: List[int], radius: float = 0) → List[float]¶ Apply RBF bump functions on list of dummy variables.
A bump function is applied for every non-zero entry (taking its index as the mean), the results are summed.
- Parameters
dummy_variables_list – List of dummy variables.
radius – Radius parameter \(\epsilon\) of the bump functions.
- Returns
Transformed list.
- Return type
List[float]
-
bike_sharing_demand.utilities.
bump_function
(x: float, mean: float = 0, radius: float = 1) → float¶ Return image of an RBF bump function with given mean and radius.
\[\begin{split}\phi_{\mu, \epsilon}(x) = \begin{cases} \exp\left(-\frac{1}{1-\epsilon(x - \mu)^2}\right) & \mbox{ for } x<\epsilon + \mu \\ 0 & \mbox{ otherwise } \end{cases}\end{split}\]- Parameters
x – Argument.
mean – Mean parameter \(\mu\) of the bump function.
radius – Radius parameter \(\epsilon\) of the bump function.
- Returns
Image of the bump function for provided argument and parameters.
- Return type
float
References
-
bike_sharing_demand.utilities.
bump_function_distance
(distance, radius: float = 1)¶ Intermediate step for memoization.
- Parameters
distance – Distance from the mean of the bump function.
radius – Radius parameter \(\epsilon\) of the bump function.
- Returns
Image of the bump function for provided argument and parameters.
- Return type
float