You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experimental function. return not by aggregation, but by separate ensembles.
838
843
logit_agg:
839
-
Whether to use logit aggregation for the classification task. If True, the model is averaging the probability prediction estimated by all ensembles in logit scale, and then back-tranforms it to probability scale. It's recommended to be jointly used with the CalibratedClassifierCV class in sklearn as a wrapper of the classifier to estimate the calibrated probability. If False, the output is essentially the proportion of "1s" across the related ensembles; e.g., if 100 stixels covers this spatiotemporal points, and 90% of them predict that it is a "1", then the output probability is 0.9; Therefore it would be a probability estimated by the spatiotemporal neighborhood. Default is False, but can be set to truth for "real" probability averaging.
844
+
Whether to use logit aggregation for the classification task. Most likely only used when you are predicting "real" calibrated probability. If True, the model is averaging the probability prediction estimated by all ensembles in logit scale, and then back-tranforms it to probability scale. It's recommended to be jointly used with the CalibratedClassifierCV class in sklearn as a wrapper of the classifier to estimate the calibrated probability. Default is False, but can be set to true for "real" probability averaging.
845
+
base_model_method:
846
+
The name of the prediction method for base models. If None, `predict` or `predict_proba` will be used depending on the tasks. This argument is handy if you have a custom base model class that has a special prediction function. Notice that dummy model will still predict 0, so the ensemble-aggregated result is still an average of zeros and your special prediction function output. Therefore, it may only make sense if your special prediction function predicts 0 as the absense/control value. Defaults to None.
847
+
base_model_prediction_param:
848
+
Any other paramters to pass into the prediction method of the base models. e.g., base_model_prediction_param={'n_jobs':1}.
res_mean=res.mean(axis=1, skipna=True) # mean of all grid model that predicts this stixel
890
900
elifaggregation=="median":
891
901
res_mean=res.median(axis=1, skipna=True)
892
-
902
+
893
903
res_std=res.std(axis=1, skipna=True)
894
904
895
905
# Nan count
@@ -935,6 +945,7 @@ def predict(
935
945
aggregation: str="mean",
936
946
return_by_separate_ensembles: bool=False,
937
947
logit_agg: bool=False,
948
+
base_model_method: Union[None, str] =None,
938
949
**base_model_prediction_param
939
950
) ->Union[np.ndarray, Tuple[np.ndarray]]:
940
951
pass
@@ -1406,6 +1417,7 @@ def predict(
1406
1417
aggregation: str="mean",
1407
1418
return_by_separate_ensembles: bool=False,
1408
1419
logit_agg: bool=False,
1420
+
base_model_method: Union[None, str] =None,
1409
1421
**base_model_prediction_param
1410
1422
) ->Union[np.ndarray, Tuple[np.ndarray]]:
1411
1423
"""A rewrite of predict_proba adapted for Classifier
@@ -1431,10 +1443,12 @@ def predict(
1431
1443
'mean' or 'median' for aggregation method across ensembles.
1432
1444
return_by_separate_ensembles (bool, optional):
1433
1445
Experimental function. return not by aggregation, but by separate ensembles.
1434
-
base_model_prediction_param:
1435
-
Additional parameter passed to base_model.predict_proba or base_model.predict
1436
1446
logit_agg:
1437
-
Whether to use logit aggregation for the classification task. If True, the model is averaging the probability prediction estimated by all ensembles in logit scale, and then back-tranform it to probability scale. It's recommened to be combinedly used with the CalibratedClassifierCV class in sklearn as a wrapper of the classifier to estimate the calibrated probability. If False, the output is the essentially the proportion of "1s" acorss the related ensembles; e.g., if 100 stixels covers this spatiotemporal points, and 90% of them predict that it is a "1", then the ouput probability is 0.9; Therefore it would be a probability estimated by the spatiotemporal neiborhood.
1447
+
Whether to use logit aggregation for the classification task. If True, the model is averaging the probability prediction estimated by all ensembles in logit scale, and then back-tranform it to probability scale. It's recommened to be combinedly used with the CalibratedClassifierCV class in sklearn as a wrapper of the classifier to estimate the calibrated probability.
1448
+
base_model_method:
1449
+
The name of the prediction method for base models. If None, `predict` or `predict_proba` will be used depending on the tasks. This argument is handy if you have a custom base model class that has a special prediction function. Defaults to None.
1450
+
base_model_prediction_param:
1451
+
Any other paramters to pass into the prediction method of the base models. e.g., base_model_prediction_param={'n_jobs':1}.
'mean' or 'median' for aggregation method across ensembles.
1610
1627
return_by_separate_ensembles (bool, optional):
1611
1628
Experimental function. return not by aggregation, but by separate ensembles.
1629
+
base_model_method:
1630
+
The name of the prediction method for base models. If None, `predict` or `predict_proba` will be used depending on the tasks. This argument is handy if you have a custom base model class that has a special prediction function. Defaults to None.
1612
1631
base_model_prediction_param:
1613
-
Additional parameter passed to base_model.predict_proba or base_model.predict
1632
+
Any other paramters to pass into the prediction method of the base models. e.g., base_model_prediction_param={'n_jobs':1}.
task (str): One of 'regression', 'classification' and 'hurdle'
441
442
model_x_names_tuple (tuple[Union[None, BaseEstimator], list]): A tuple of (model, stixel_specific_x_names)
443
+
base_model_method (Union[None, str]): The name of the prediction method for base models. If None, `predict` or `predict_proba` will be used depending on the tasks. This argument is handy if you have a custom base model class that has a special prediction function.
442
444
base_model_prediction_param: Additional parameter passed to base_model.predict_proba or base_model.predict
0 commit comments