API reference¶
Core¶
best_strategy(num_banners: int, num_polygons: int = 10 ** 2, target_audience: dict[str, ...] = {'gender': 'all', 'ageFrom': 18, 'ageTo': 100, 'income': 'abc'}, iterations: int = 10) -> list[Polygon]
¶
Synchronously predict best strategy
Parameters:
-
num_banners(int) –number of banners the company can afford
-
num_polygons(int, default:10 ** 2) –number of polygons the city would be divided in (should be a full square)
-
target_audience(dict[str, ...], default:{'gender': 'all', 'ageFrom': 18, 'ageTo': 100, 'income': 'abc'}) –target audience as a dict ("name" field doesn't matter)
-
iterations(int, default:10) –number of iterations
Returns:
-
list[Polygon]–Predicted strategy
Source code in src/advertising_locations/main.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
best_strategy_async(num_banners: int, num_polygons: int = 10 ** 2, target_audience: dict[str, ...] = {'gender': 'all', 'ageFrom': 18, 'ageTo': 100, 'income': 'abc'}, iterations: int = 10) -> list[Polygon]
async
¶
Asynchronous wrapper around the best_strategy function
Parameters:
-
num_banners(int) –number of banners the company can afford
-
num_polygons(int, default:10 ** 2) –number of polygons the city would be divided in (should be a full square)
-
target_audience(dict[str, ...], default:{'gender': 'all', 'ageFrom': 18, 'ageTo': 100, 'income': 'abc'}) –target audience as a dict ("name" field doesn't matter)
-
iterations(int, default:10) –number of iterations
Returns:
-
list[Polygon]–Predicted strategy
Source code in src/advertising_locations/main.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |