Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def huff_model_probability(df_distances, df_attractiveness, alpha, beta, df_popu
|
|
23 |
|
24 |
adjusted_population = df_population.repeat(df_distances.shape[1]).values.reshape(df_distances.shape) * adjustment_factors
|
25 |
attractiveness_term = df_attractiveness ** alpha
|
26 |
-
distance_term =
|
27 |
|
28 |
numerator = (attractiveness_term * distance_term).multiply(adjusted_population, axis=0)
|
29 |
denominator = numerator.sum(axis=1)
|
|
|
23 |
|
24 |
adjusted_population = df_population.repeat(df_distances.shape[1]).values.reshape(df_distances.shape) * adjustment_factors
|
25 |
attractiveness_term = df_attractiveness ** alpha
|
26 |
+
distance_term =np.exp(df_distances * -beta)
|
27 |
|
28 |
numerator = (attractiveness_term * distance_term).multiply(adjusted_population, axis=0)
|
29 |
denominator = numerator.sum(axis=1)
|