Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23065: Adds new_case_sensitivity_bandwidth parameter, MINOR #379

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions howso/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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".
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions howso/engine/trainee.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1675,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.

Expand Down Expand Up @@ -1747,6 +1752,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,
Expand Down Expand Up @@ -1782,6 +1788,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,
Expand Down Expand Up @@ -1883,6 +1890,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
Expand Down Expand Up @@ -1978,6 +1987,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,
Expand Down
Loading