From 8e27848fa3a54412d76513b47705b1decb612a1d Mon Sep 17 00:00:00 2001 From: Jacob Beel <54082169+jdbeel@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:41:36 -0500 Subject: [PATCH 1/2] Prep for docstring feedback --- howso/client/base.py | 12 ++++++++++++ howso/engine/trainee.py | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/howso/client/base.py b/howso/client/base.py index 2b3f0529..ae27cbbd 100644 --- a/howso/client/base.py +++ b/howso/client/base.py @@ -1470,6 +1470,7 @@ def react( # noqa: C901 input_is_substituted: bool = False, into_series_store: t.Optional[str] = None, leave_case_out: bool = False, + new_case_sensitivity_bandwidth: int = 0, new_case_threshold: NewCaseThreshold = "min", num_cases_to_generate: int = 1, ordered_by_specified_features: bool = False, @@ -1808,6 +1809,8 @@ def react( # noqa: C901 'num_most_similar_cases' is not specified) relevant number of similar cases, which will first include the influential cases. Uses only the context features of the reacted case. + - new_case_sensitivity_bandwidth : int, optional + TODO - num_boundary_cases : int, optional Outputs this manually specified number of boundary cases. - num_most_similar_cases : int, optional @@ -2009,6 +2012,8 @@ def react( # noqa: C901 batched call to react and at the end of reacting. The method is given a ProgressTimer containing metrics on the progress and timing of the react operation, and the batch result. + new_case_sensitivity_bandwidth : int, default 0 + TODO new_case_threshold : str, optional Distance to determine the privacy cutoff. If None, will default to "min". @@ -2180,6 +2185,7 @@ def react( # noqa: C901 "use_case_weights": use_case_weights, "leave_case_out": leave_case_out, "preserve_feature_values": preserve_feature_values, + "new_case_sensitivity_bandwidth": new_case_sensitivity_bandwidth, "new_case_threshold": new_case_threshold, "details": details, } @@ -2220,6 +2226,7 @@ def react( # noqa: C901 "goal_features_map": goal_features_map, "ordered_by_specified_features": ordered_by_specified_features, "preserve_feature_values": preserve_feature_values, + "new_case_sensitivity_bandwidth": new_case_sensitivity_bandwidth, "new_case_threshold": new_case_threshold, "into_series_store": into_series_store, "input_is_substituted": input_is_substituted, @@ -2616,6 +2623,7 @@ def react_series( # noqa: C901 input_is_substituted: bool = False, leave_series_out: bool = False, max_series_lengths: t.Optional[list[int]] = None, + new_case_sensitivity_bandwidth: int = 0, new_case_threshold: NewCaseThreshold = "min", num_series_to_generate: int = 1, ordered_by_specified_features: bool = False, @@ -2783,6 +2791,8 @@ def react_series( # noqa: C901 See parameter ``use_case_weights`` in :meth:`AbstractHowsoClient.react`. preserve_feature_values : iterable of str See parameter ``preserve_feature_values`` in :meth:`AbstractHowsoClient.react`. + new_case_sensitivity_bandwidth : int + See parameter ``new_case_sensitivity_bandwidth` in :meth:`AbstractHowsoClient.react`. new_case_threshold : str See parameter ``new_case_threshold`` in :meth:`AbstractHowsoClient.react`. use_regional_residuals : bool @@ -2901,6 +2911,7 @@ def react_series( # noqa: C901 "goal_features_map": goal_features_map, "leave_series_out": leave_series_out, "preserve_feature_values": preserve_feature_values, + "new_case_sensitivity_bandwidth": new_case_sensitivity_bandwidth, "new_case_threshold": new_case_threshold, "input_is_substituted": input_is_substituted, "substitute_output": substitute_output, @@ -2961,6 +2972,7 @@ def react_series( # noqa: C901 "weight_feature": weight_feature, "use_case_weights": use_case_weights, "preserve_feature_values": preserve_feature_values, + "new_case_sensitivity_bandwidth": new_case_sensitivity_bandwidth, "new_case_threshold": new_case_threshold, "details": details, "series_id_tracking": series_id_tracking, diff --git a/howso/engine/trainee.py b/howso/engine/trainee.py index c5b47ffa..d1a24c0d 100644 --- a/howso/engine/trainee.py +++ b/howso/engine/trainee.py @@ -1195,6 +1195,7 @@ def react( input_is_substituted: bool = False, into_series_store: t.Optional[str] = None, leave_case_out: bool = False, + new_case_sensitivity_bandwidth: int = 0, new_case_threshold: NewCaseThreshold = "min", num_cases_to_generate: int = 1, ordered_by_specified_features: bool = False, @@ -1524,6 +1525,8 @@ def react( 'num_most_similar_cases' is not specified) relevant number of similar cases, which will first include the influential cases. Uses only the context features of the reacted case. + - new_case_sensitivity_bandwidth : int, optional + TODO - num_boundary_cases : int, optional Outputs this manually specified number of boundary cases. - num_most_similar_cases : int, optional @@ -1747,6 +1750,7 @@ def react( input_is_substituted=input_is_substituted, into_series_store=into_series_store, leave_case_out=leave_case_out, + new_case_sensitivity_bandwidth=new_case_sensitivity_bandwidth, new_case_threshold=new_case_threshold, num_cases_to_generate=num_cases_to_generate, ordered_by_specified_features=ordered_by_specified_features, @@ -1782,6 +1786,7 @@ def react_series( input_is_substituted: bool = False, leave_series_out: bool = False, max_series_lengths: t.Optional[list[int]] = None, + new_case_sensitivity_bandwidth: int = 0, new_case_threshold: NewCaseThreshold = "min", num_series_to_generate: int = 1, ordered_by_specified_features: bool = False, @@ -1883,6 +1888,8 @@ def react_series( with ``continue_series``, this defines the maximum length of the forecast. Must provide either one for all series, or exactly one per series. + new_case_sensitivity_bandwidth : int, default 0 + See parameter ``new_case_sensitivity_bandwidth`` in :meth:`react`. new_case_threshold : str, optional See parameter ``new_case_threshold`` in :meth:`react`. num_series_to_generate : int, default 1 @@ -1978,6 +1985,7 @@ def react_series( initial_batch_size=initial_batch_size, input_is_substituted=input_is_substituted, max_series_lengths=max_series_lengths, + new_case_sensitivity_bandwidth=new_case_sensitivity_bandwidth, new_case_threshold=new_case_threshold, num_series_to_generate=num_series_to_generate, ordered_by_specified_features=ordered_by_specified_features, From 26eab8851e055ff2ed14e5877cb6f26b22fcacc5 Mon Sep 17 00:00:00 2001 From: Jacob Beel <54082169+jdbeel@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:04:51 -0500 Subject: [PATCH 2/2] Add TODO docstring --- howso/engine/trainee.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/howso/engine/trainee.py b/howso/engine/trainee.py index d1a24c0d..472a30af 100644 --- a/howso/engine/trainee.py +++ b/howso/engine/trainee.py @@ -1678,6 +1678,8 @@ def react( When True and specified along with ``case_indices``, each individual react will respectively ignore the corresponding case specified by ``case_indices`` by leaving it out. + new_case_sensitivity_bandwidth : int, default 0 + TODO new_case_threshold : {"max", "min", "most_similar"}, default "min" Distance to determine the privacy cutoff.