@@ -33,14 +33,14 @@ def get_clusters_swiss(t=0.3, end_date=None):
3333 """
3434 Params to get the list of clusters computed by the compute_cluster
3535 function.
36-
36+
3737 Parameters
3838 ----------
3939 t : float
4040 Thereshold used in the clusterization.
4141 end_date : str
4242 Indicates the last day used to compute the cluster.
43-
43+
4444 Returns
4545 -------
4646 Array
@@ -76,12 +76,12 @@ def get_clusters_swiss(t=0.3, end_date=None):
7676def get_cluster_by_canton (canton ):
7777 """
7878 Function to return the cluster that contains a specific canton.
79-
79+
8080 Parameters
8181 ----------
8282 canton : str
8383 Name (two letters code) of the canton.
84-
84+
8585 Returns
8686 -------
8787 List
@@ -99,11 +99,11 @@ def remove_zeros(tgt):
9999 """
100100 Function to remove the zeros of the target curve. It needs to be
101101 done to us be able to use the LogNormal dist.
102-
102+
103103 Parameters
104104 ----------
105105 tgt : array
106-
106+
107107 """
108108
109109 tgt [tgt == 0 ] = 0.01
@@ -129,10 +129,10 @@ def train_eval_single_canton(
129129):
130130 """
131131 Function to train and evaluate the model for one georegion.
132-
132+
133133 Important: * By default the function is using the clustering cantons
134134 and the
135- data since 2020.
135+ data since 2020.
136136 * For the predictor hospCapacity is used as predictor the column
137137 ICU_Covid19Patients.
138138
@@ -177,9 +177,9 @@ def train_eval_single_canton(
177177 -------
178178 pd.DataFrame
179179 The return is a pandas DataFrame.
180-
180+
181181 """
182-
182+
183183 cluster_canton = [canton ] # get_cluster_by_canton(canton)
184184
185185 target_name = f"{ target_curve_name } _{ canton } "
@@ -242,13 +242,13 @@ def train_eval_all_cantons(
242242
243243 """
244244 Function to make prediction for all the cantons.
245-
245+
246246 Important:
247247 * By default the function is using the clustering cantons and the
248248 data since 2020.
249249 * For the predictor hospCapacity is used as predictor the column
250250 ICU_Covid19Patients.
251-
251+
252252 Parameters
253253 ----------
254254 target_curve_name : str
@@ -277,7 +277,7 @@ def train_eval_all_cantons(
277277 look_back : int
278278 Number of the last days that will be used to forecast the next
279279 days.
280-
280+
281281 Returns
282282 -------
283283 pd.DataFrame
@@ -357,13 +357,13 @@ def train_single_canton(
357357
358358 """
359359 Function to train and evaluate the model for one georegion.
360-
360+
361361 Important: * By default the function is using the clustering cantons
362362 and the
363363 data since 2020.
364364 * For the predictor hospCapacity is used as predictor the column
365365 ICU_Covid19Patients.
366-
366+
367367 Parameters
368368 ----------
369369 canton : str
@@ -378,7 +378,7 @@ def train_single_canton(
378378 Determines the beggining of the train dataset
379379 path : str
380380 Determines where the model trained will be saved.
381- update_data : bool
381+ update_data : bool
382382 Determines if the data from the Geneva hospital will be used.
383383 This params only is used when canton = GE and target_curve_name
384384 = hosp.
@@ -390,7 +390,7 @@ def train_single_canton(
390390 look_back : int
391391 Number of the last days that will be used to forecast the next
392392 days.
393-
393+
394394 Returns
395395 -------
396396 None
@@ -449,17 +449,17 @@ def train_all_cantons(
449449 look_back = 14 ,
450450 path = None ,
451451):
452-
452+
453453 """
454454 Function to train and evaluate the model for all the cantons in
455455 switzerland.
456-
457- Important:
456+
457+ Important:
458458 * By default the function is using the clustering cantons and the
459- data since 2020.
459+ data since 2020.
460460 * For the predictor hospCapacity is used as predictor the column
461461 ICU_Covid19Patients.
462-
462+
463463 Parameters
464464 ----------
465465 target_curve_name : str
@@ -480,14 +480,13 @@ def train_all_cantons(
480480 look_back : int
481481 Number of the last days that will be used to forecast the next
482482 days.
483-
483+
484484 Returns
485485 -------
486486 pd.DataFrame
487487 Dataframe with the forecast for all the cantons.
488488 """
489489
490-
491490 clusters = get_clusters_swiss (t = 0.6 )
492491
493492 for cluster in clusters :
@@ -541,13 +540,13 @@ def forecast_single_canton(
541540):
542541 """
543542 Function to make the forecast for one canton.
544-
543+
545544 Important:
546545 * By default the function is using the clustering cantons and the
547546 data since 2020.
548547 * For the predictor hospCapacity is used as predictor the column
549548 ICU_Covid19Patients.
550-
549+
551550 Parameters
552551 ----------
553552 target_curve_name : str
@@ -569,14 +568,13 @@ def forecast_single_canton(
569568 look_back : int
570569 Number of the last days that will be used to forecast the next
571570 days.
572-
571+
573572 Returns
574573 -------
575574 pd.DataFrame
576575 Dataframe with the forecast for one canton.
577576 """
578577
579-
580578 cluster_canton = [canton ] # get_cluster_by_canton(canton)
581579
582580 df = get_cluster_data (
@@ -609,13 +607,13 @@ def forecast_all_cantons(
609607):
610608 """
611609 Function to make the forecast for all the cantons.
612-
610+
613611 Important:
614612 * By default the function is using the clustering cantons and the
615613 data since 2020.
616614 * For the predictor hospCapacity is used as predictor the column
617615 ICU_Covid19Patients.
618-
616+
619617 Parameters
620618 ----------
621619 target_curve_name : str
@@ -630,7 +628,7 @@ def forecast_all_cantons(
630628 Determines from what day the forecast will be computed.
631629 path : str
632630 Indicates where the models trained are saved.
633-
631+
634632 Returns
635633 -------
636634 pd.DataFrame
0 commit comments