File size: 2,787 Bytes
315b0b3
b552759
 
 
 
 
 
 
 
 
65a336a
b552759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315b0b3
b552759
 
f29f99c
 
 
b552759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import os
from dotenv import dotenv_values
from pathlib import Path
from ipyleaflet import basemaps

from shiny.express import ui


# Paths
# ENV when using standalone shiny server, shiny for python runs from the root of the project
ENV_PATH = Path("env/online.env")

DATA = Path(__file__).parent.parent / "data/"
TEST_FILE = DATA / "Test.csv"
TRAIN_FILE = DATA / "Train.csv"
WEATHER_FILE = DATA / "Weather.csv"
HISTORY = DATA / "history/"
HISTORY_FILE = HISTORY / "history.csv"


# Models
ALL_MODELS = [
    "AdaBoostRegressor",
    "DecisionTreeRegressor",
    "GradientBoostingRegressor",
    "HistGradientBoostingRegressor",
    "LinearRegression",
    # "RandomForestRegressor",
    "XGBRegressor",
]

BEST_MODELS = ["RandomForestRegressor", "XGBRegressor"]


# Urls
TEST_FILE_URL = "https://raw.githubusercontent.com/valiantezabuku/Yassir-ETA-Prediction-Challenge-For-Azubian-Team-Curium/main/Data/Test.csv"
TRAIN_FILE_URL = "https://raw.githubusercontent.com/valiantezabuku/Yassir-ETA-Prediction-Challenge-For-Azubian-Team-Curium/main/Data/Train.csv"
WEATHER_FILE_URL = "https://raw.githubusercontent.com/valiantezabuku/Yassir-ETA-Prediction-Challenge-For-Azubian-Team-Curium/main/Data/Weather.csv"


# Load environment variables from .env file into a dictionary
# environment_variables = dotenv_values(ENV_PATH)


# Google Maps Directions API
# https://maps.googleapis.com/maps/api/distancematrix/
MAPS_API_KEY = os.getenv("MAPS_API_KEY")

# https://maps.app.goo.gl/Fx5rdPs1KeA6jCeB8
KENYA_LAT = 0.15456
KENYA_LON = 37.908383


BASEMAPS = {
    "DarkMatter": basemaps.CartoDB.DarkMatter,
    "Mapnik": basemaps.OpenStreetMap.Mapnik,
    "NatGeoWorldMap": basemaps.Esri.NatGeoWorldMap,
    "WorldImagery": basemaps.Esri.WorldImagery,
}

# Yassir
BRANDCOLORS = {
    "red": "#FB2576",
    "purple-light": "#6316DB",
    "purple-dark": "#08031A",
}

BRANDTHEMES = {
    "red": ui.value_box_theme(bg=BRANDCOLORS['red'], fg='white'),
    "purple-light": ui.value_box_theme(bg=BRANDCOLORS['purple-light'], fg='white'),
    "purple-dark": ui.value_box_theme(bg=BRANDCOLORS['purple-dark'], fg='white'),
}


# Nairobi, https://maps.app.goo.gl/oPbLBYHuicjrC22J9
# National Museum of Kenya, https://maps.app.goo.gl/zbmUpe71admABU9i9
# Closest location
LOCATIONS = {
    "Nairobi": {"latitude": -1.3032036, "longitude": 36.6825914},
    "National Museum of Kenya": {"latitude": -1.2739575, "longitude": 36.8118501},
    "Mombasa": {"latitude": -1.3293123, "longitude": 36.8717466},
}


HOURS = [f"{i:02}" for i in range(0, 24)]

MINUTES = [f"{i:02}" for i in range(0, 12)]

SECONDS = [f"{i:02}" for i in range(0, 60)]


ONE_MINUTE_SEC = 60

ONE_HOUR_SEC = ONE_MINUTE_SEC * 60

ONE_DAY_SEC = ONE_HOUR_SEC * 24

ONE_WEEK_SEC = ONE_DAY_SEC * 7


# Default trip distance
TRIP_DISTANCE = 30275.7