howso-engine 67.2.0__tar.gz → 68.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {howso_engine-67.2.0 → howso_engine-68.0.0}/LICENSE-3RD-PARTY.txt +2 -2
- {howso_engine-67.2.0/howso_engine.egg-info → howso_engine-68.0.0}/PKG-INFO +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/base.py +22 -1
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/group_reaction.py +8 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/typing.py +45 -29
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/engine/trainee.py +10 -0
- howso_engine-68.0.0/howso/howso-engine/howso.caml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/howso-engine/migrations/migrations.caml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/howso-engine/version.json +4 -4
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/__init__.py +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/abstract_data.py +2 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/base.py +929 -160
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/infer_feature_attributes.py +47 -25
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/pandas.py +2 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/suggestions.py +205 -53
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/time_series.py +48 -26
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/internals.py +20 -4
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/utilities.py +35 -33
- {howso_engine-67.2.0 → howso_engine-68.0.0/howso_engine.egg-info}/PKG-INFO +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/requires.txt +1 -1
- {howso_engine-67.2.0 → howso_engine-68.0.0}/pyproject.toml +1 -1
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.11-dev.txt +7 -7
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.11.txt +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.12-dev.txt +7 -7
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.12.txt +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.13-dev.txt +7 -7
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.13.txt +2 -2
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.14-dev.txt +7 -7
- {howso_engine-67.2.0 → howso_engine-68.0.0}/requirements-3.14.txt +2 -2
- howso_engine-68.0.0/version.json +5 -0
- howso_engine-67.2.0/howso/howso-engine/howso.caml +0 -0
- howso_engine-67.2.0/version.json +0 -5
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.coveragerc +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.flake8 +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/CODEOWNERS +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/templates/version_summary.md +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/workflows/build-pr.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/workflows/build-release.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/workflows/build.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/workflows/rebuild-requirements.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.github/workflows/version-update.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.gitignore +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.gitmodules +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/.pylintrc +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/CONTRIBUTING.md +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/LICENSE.txt +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/MANIFEST.in +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/Makefile +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/README.md +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/bin/build.sh +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-mt-debug-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-mt-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-mt-noavx-traces-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-mt-traces-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-st-debug-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-st-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/latest-st-traces-howso.yml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/powershell/Download-Tzdata.ps1 +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/config/powershell/Helper-Functions.ps1 +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/hatch.toml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/__main__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/api.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/cache.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/client.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/configuration.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/exceptions.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/feature_flags.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/pandas/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/pandas/client.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/protocols.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/aggregate_reaction.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/base.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/project.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/reaction.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/session.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/trainee.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/client/schemas/version.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/direct/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/direct/_utilities.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/direct/client.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/direct/schemas/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/direct/schemas/trainee.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/engine/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/engine/client.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/engine/project.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/engine/session.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/scikit/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/scikit/scikit.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/decorators.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/fanout_features.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/protocols.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/relational.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/serializers.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/warnings.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/features.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/__init__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/__main__.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/_constants.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/_helpers.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/_output.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/_probes.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/_types.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/checks_cpu.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/checks_engine.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/checks_environment.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/checks_optional.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/main.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/installation_verification/registry.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/json_wrapper.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/locale.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/monitors.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/posix.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/progress.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/random.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/reaction.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/testing.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/tokenizing.py +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/SOURCES.txt +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/dependency_links.txt +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/entry_points.txt +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/scm_file_list.json +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/howso_engine.egg-info/top_level.txt +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/pyrightconfig.json +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/ruff.toml +0 -0
- {howso_engine-67.2.0 → howso_engine-68.0.0}/setup.cfg +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Faker
|
|
2
|
-
40.
|
|
2
|
+
40.42.0
|
|
3
3
|
MIT License
|
|
4
4
|
joke2k
|
|
5
5
|
https://github.com/joke2k/faker
|
|
6
6
|
Faker is a Python package that generates fake data for you.
|
|
7
|
-
/home/runner/.pyenv/versions/3.14.8/lib/python3.14/site-packages/faker-40.
|
|
7
|
+
/home/runner/.pyenv/versions/3.14.8/lib/python3.14/site-packages/faker-40.42.0.dist-info/licenses/LICENSE.txt
|
|
8
8
|
Copyright (c) 2012 Daniele Faraglia
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: howso-engine
|
|
3
|
-
Version:
|
|
3
|
+
Version: 68.0.0
|
|
4
4
|
Summary: The Howso Engine™ is a natively and fully explainable ML engine, serving as an alternative to black box AI neural networks.
|
|
5
5
|
Author: Howso Incorporated
|
|
6
6
|
Author-email: support@howso.com
|
|
@@ -705,7 +705,7 @@ Requires-Dist: sacremoses
|
|
|
705
705
|
Requires-Dist: semantic-version~=2.0
|
|
706
706
|
Requires-Dist: typing-extensions~=4.9
|
|
707
707
|
Requires-Dist: urllib3>=2.6.3
|
|
708
|
-
Requires-Dist: amalgam-lang==35.1.
|
|
708
|
+
Requires-Dist: amalgam-lang==35.1.1
|
|
709
709
|
Provides-Extra: dev
|
|
710
710
|
Requires-Dist: dill~=0.0; extra == "dev"
|
|
711
711
|
Requires-Dist: flake8-docstrings; extra == "dev"
|
|
@@ -4425,6 +4425,7 @@ class AbstractHowsoClient(ABC):
|
|
|
4425
4425
|
action_features: Collection[str] | None = None,
|
|
4426
4426
|
case_indices: Collection[CaseIndices] | None = None,
|
|
4427
4427
|
conditions: list[Mapping] | None = None,
|
|
4428
|
+
context_features: Collection[str] | None = None,
|
|
4428
4429
|
details: Mapping[str, bool] | None = None,
|
|
4429
4430
|
distance_contributions: bool = False,
|
|
4430
4431
|
familiarity_conviction_addition: bool = False,
|
|
@@ -4482,6 +4483,10 @@ class AbstractHowsoClient(ABC):
|
|
|
4482
4483
|
- An array of string values, must match any of these values
|
|
4483
4484
|
exactly. Only applicable to nominal and string ordinal
|
|
4484
4485
|
features.
|
|
4486
|
+
context_features : Collection of str, optional
|
|
4487
|
+
List of features names to use as contexts in queries. If unspecified,
|
|
4488
|
+
the default is all trained features when using trained cases and
|
|
4489
|
+
all given features and their derived features when using new_cases.
|
|
4485
4490
|
details : dict of str to bool, optional
|
|
4486
4491
|
Ignored if action features are not specified.
|
|
4487
4492
|
If details are specified, the response will contain the requested
|
|
@@ -4532,6 +4537,10 @@ class AbstractHowsoClient(ABC):
|
|
|
4532
4537
|
parameter. Only one of ``case_indices``, ``conditions``, or
|
|
4533
4538
|
``new_cases`` may be specified.
|
|
4534
4539
|
|
|
4540
|
+
When using a time-series Trainee, derived feature values will be
|
|
4541
|
+
computed for the given data for each group if no derived feature
|
|
4542
|
+
values are given.
|
|
4543
|
+
|
|
4535
4544
|
>>> [ [[1, 2, 3], [4, 5, 6], [7, 8, 9]], # Group 1
|
|
4536
4545
|
>>> [[1, 2, 3]] ] # Group 2
|
|
4537
4546
|
p_value_of_addition : bool, default False
|
|
@@ -4572,16 +4581,28 @@ class AbstractHowsoClient(ABC):
|
|
|
4572
4581
|
serialized_cases = []
|
|
4573
4582
|
for group in new_cases:
|
|
4574
4583
|
if features is None:
|
|
4575
|
-
features = internals.get_features_from_data(group)
|
|
4584
|
+
features = internals.get_features_from_data(group, data_parameter="new_cases")
|
|
4576
4585
|
serialized_cases.append(serialize_cases(group, features, feature_attributes,
|
|
4577
4586
|
tokenizer=self._tokenizer)) # pyright: ignore[reportAttributeAccessIssue]
|
|
4578
4587
|
|
|
4588
|
+
if (
|
|
4589
|
+
features is None
|
|
4590
|
+
or not isinstance(serialized_cases[0][0], Sized)
|
|
4591
|
+
or len(features) != len(serialized_cases[0][0])
|
|
4592
|
+
):
|
|
4593
|
+
raise HowsoError(
|
|
4594
|
+
"The number of provided values in `new_cases` "
|
|
4595
|
+
"does not match the number of features in "
|
|
4596
|
+
"`features`."
|
|
4597
|
+
)
|
|
4598
|
+
|
|
4579
4599
|
if self.configuration.verbose:
|
|
4580
4600
|
print(f"Reacting to a set of cases on Trainee with id: {trainee_id}")
|
|
4581
4601
|
result = self.execute(trainee_id, "react_group", {
|
|
4582
4602
|
"action_features": action_features,
|
|
4583
4603
|
"case_indices": case_indices,
|
|
4584
4604
|
"conditions": conditions,
|
|
4605
|
+
"context_features": context_features,
|
|
4585
4606
|
"details": details,
|
|
4586
4607
|
"distance_contributions": distance_contributions,
|
|
4587
4608
|
"residual_contributions": residual_contributions,
|
|
@@ -16,6 +16,7 @@ _VT = TypeVar("_VT")
|
|
|
16
16
|
|
|
17
17
|
GroupDetail: TypeAlias = Literal[
|
|
18
18
|
"categorical_action_probabilities", # A dict of feature name to dict of class to probability for each group
|
|
19
|
+
"context_features", # a list of the context feature names
|
|
19
20
|
"influential_cases", # a list of dicts for each group
|
|
20
21
|
"feature_full_residuals", # a map of residuals for each action feature for each group
|
|
21
22
|
]
|
|
@@ -42,6 +43,9 @@ class GroupDetails(TypedDict, total=False):
|
|
|
42
43
|
categorical_action_probabilities: list[dict[str, dict[Any, float]]]
|
|
43
44
|
"""The categorical action probabilities for each nominal action feature for each group."""
|
|
44
45
|
|
|
46
|
+
context_features: list[str]
|
|
47
|
+
"""The list of context features used in the GroupReaction."""
|
|
48
|
+
|
|
45
49
|
influential_cases: list[pd.DataFrame]
|
|
46
50
|
"""The collection of influential cases to each group."""
|
|
47
51
|
|
|
@@ -110,6 +114,10 @@ class GroupReaction(Mapping[GroupProperty, PropertyValue]):
|
|
|
110
114
|
self._details.update(
|
|
111
115
|
{"categorical_action_probabilities": internals.update_caps_maps(data[computed_detail], attributes)}
|
|
112
116
|
)
|
|
117
|
+
elif computed_detail == "context_features":
|
|
118
|
+
self._details.update(
|
|
119
|
+
{"context_features": data["context_features"]}
|
|
120
|
+
)
|
|
113
121
|
else:
|
|
114
122
|
# Currently the only possible detail here is feature_full_residuals
|
|
115
123
|
self._details.update({computed_detail: pd.DataFrame(data[computed_detail])})
|
|
@@ -246,37 +246,26 @@ class FeatureTimeSeries(TypedDict, total=False):
|
|
|
246
246
|
"""
|
|
247
247
|
|
|
248
248
|
class ProtectedValueMultiplier(TypedDict):
|
|
249
|
-
"""A single
|
|
249
|
+
"""A single feature value paired with its case-weight multiplier."""
|
|
250
250
|
|
|
251
251
|
value: Any
|
|
252
|
-
"""The feature value
|
|
252
|
+
"""The feature value whose cases are reweighted during data distillation."""
|
|
253
253
|
|
|
254
254
|
multiplier: float
|
|
255
255
|
"""The case-weight multiplier applied to cases holding this value."""
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
class FeatureRareValueConfig(TypedDict):
|
|
259
|
-
"""A rare-value preservation configuration for a single feature."""
|
|
259
|
+
"""A computed rare-value preservation configuration for a single feature."""
|
|
260
260
|
|
|
261
|
-
|
|
262
|
-
"""The protected values and their individual case-weight multipliers."""
|
|
263
|
-
|
|
264
|
-
unprotected_multiplier: NotRequired[float]
|
|
265
|
-
"""The case-weight multiplier applied to all non-protected values of the feature."""
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
class DeferredFeatureValueConfig(TypedDict):
|
|
261
|
+
value_weight_multipliers: list[ProtectedValueMultiplier]
|
|
269
262
|
"""
|
|
270
|
-
|
|
263
|
+
The case-weight multipliers of the feature's values, as written to the feature's attributes.
|
|
271
264
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
in the stack.
|
|
265
|
+
Rare values are listed with multipliers above 1 and the values that fund them with
|
|
266
|
+
multipliers below 1. A value that is not listed keeps a multiplier of 1.
|
|
275
267
|
"""
|
|
276
268
|
|
|
277
|
-
protected_values: list[Any]
|
|
278
|
-
"""The feature values to protect during data distillation."""
|
|
279
|
-
|
|
280
269
|
|
|
281
270
|
class FeatureAttributes(TypedDict):
|
|
282
271
|
"""
|
|
@@ -507,14 +496,6 @@ class FeatureAttributes(TypedDict):
|
|
|
507
496
|
post_process: NotRequired[str]
|
|
508
497
|
"""Custom Amalgam code that is called on resulting values of this feature during react operations."""
|
|
509
498
|
|
|
510
|
-
preserve_rare_values: NotRequired[FeatureRareValueConfig | DeferredFeatureValueConfig]
|
|
511
|
-
"""
|
|
512
|
-
Configuration for preserving rare values during data distillation.
|
|
513
|
-
|
|
514
|
-
Either a fully-computed config with case-weight multipliers, or a deferred config
|
|
515
|
-
listing only the protected values (when multipliers have not yet been computed).
|
|
516
|
-
"""
|
|
517
|
-
|
|
518
499
|
recursive_matching: NotRequired[bool]
|
|
519
500
|
"""
|
|
520
501
|
Whether operations work recursively on feature values.
|
|
@@ -564,6 +545,15 @@ class FeatureAttributes(TypedDict):
|
|
|
564
545
|
unique: NotRequired[bool]
|
|
565
546
|
"""Flag feature as only having unique values. Only applicable to nominal features."""
|
|
566
547
|
|
|
548
|
+
value_weight_multipliers: NotRequired[list[ProtectedValueMultiplier]]
|
|
549
|
+
"""
|
|
550
|
+
Case-weight multipliers applied at train time to cases holding the listed values of this feature.
|
|
551
|
+
|
|
552
|
+
A value that is not listed keeps a multiplier of 1. Rare value preservation writes multipliers
|
|
553
|
+
above 1 for the rare values and below 1 for the values that fund them, so that the total case
|
|
554
|
+
weight of the feature is unchanged.
|
|
555
|
+
"""
|
|
556
|
+
|
|
567
557
|
|
|
568
558
|
class TaskProgress(TypedDict):
|
|
569
559
|
details: str
|
|
@@ -609,13 +599,39 @@ Persistence: TypeAlias = Literal["allow", "always", "never"]
|
|
|
609
599
|
"""Valid values for ``persistence`` parameters."""
|
|
610
600
|
|
|
611
601
|
PreserveRareValuesMap: TypeAlias = dict[str, list[Any]]
|
|
612
|
-
"""Map of feature name to a list of values to protect during data distillation."""
|
|
602
|
+
"""Map of feature name to a list of values to protect during data distillation, their multipliers to be computed."""
|
|
603
|
+
|
|
604
|
+
PreserveRareValuesCaps: TypeAlias = Union[Sequence[str], Mapping[str, float]]
|
|
605
|
+
"""
|
|
606
|
+
Features whose significant values keep part of their case weight when funding rare value preservation.
|
|
607
|
+
|
|
608
|
+
A sequence of feature names applies the default cap to each; a mapping gives each feature the largest
|
|
609
|
+
share of its weight a significant value may give up.
|
|
610
|
+
"""
|
|
613
611
|
|
|
614
612
|
PreserveRareValuesConfig: TypeAlias = dict[str, list[ProtectedValueMultiplier]]
|
|
615
|
-
"""Map of feature name to a list of
|
|
613
|
+
"""Map of feature name to a list of rare values with the case-weight multipliers they should receive."""
|
|
616
614
|
|
|
617
615
|
FullPreserveRareValuesConfig: TypeAlias = dict[str, FeatureRareValueConfig]
|
|
618
|
-
"""Map of feature name to a complete rare-value configuration
|
|
616
|
+
"""Map of feature name to a complete rare-value configuration, with every multiplier computed."""
|
|
617
|
+
|
|
618
|
+
FeatureRareValues: TypeAlias = Union[Sequence[Any], Sequence[ProtectedValueMultiplier], FeatureRareValueConfig]
|
|
619
|
+
"""
|
|
620
|
+
The rare value specification of one feature in ``preserve_rare_values``.
|
|
621
|
+
|
|
622
|
+
A sequence of values to protect, whose multipliers are computed; a sequence of values paired with
|
|
623
|
+
the multipliers they should receive, with the multipliers of the feature's other values computed to
|
|
624
|
+
fund them; or a complete configuration with a ``value_weight_multipliers`` list, used as given.
|
|
625
|
+
"""
|
|
626
|
+
|
|
627
|
+
PreserveRareValues: TypeAlias = Union[Mapping[str, FeatureRareValues], Sequence[str], Literal["all", "off"]]
|
|
628
|
+
"""
|
|
629
|
+
The accepted forms of ``preserve_rare_values``.
|
|
630
|
+
|
|
631
|
+
A mapping specifies the rare values of each feature; a sequence of feature names protects every
|
|
632
|
+
rare value candidate of those features; "all" does so for every nominal feature; "off" disables
|
|
633
|
+
rare value preservation, including its suggestion.
|
|
634
|
+
"""
|
|
619
635
|
|
|
620
636
|
Precision: TypeAlias = Literal["exact", "similar"]
|
|
621
637
|
"""Valid values for ``precision`` parameters."""
|
|
@@ -3388,6 +3388,7 @@ class Trainee(BaseTrainee):
|
|
|
3388
3388
|
action_features: Collection[str] | None = None,
|
|
3389
3389
|
case_indices: Collection[CaseIndices] | None = None,
|
|
3390
3390
|
conditions: list[Mapping] | None = None,
|
|
3391
|
+
context_features: Collection[str] | None = None,
|
|
3391
3392
|
details: Mapping[str, bool] | None = None,
|
|
3392
3393
|
distance_contributions: bool = False,
|
|
3393
3394
|
familiarity_conviction_addition: bool = False,
|
|
@@ -3445,6 +3446,10 @@ class Trainee(BaseTrainee):
|
|
|
3445
3446
|
- An array of string values, must match any of these values
|
|
3446
3447
|
exactly. Only applicable to nominal and string ordinal
|
|
3447
3448
|
features.
|
|
3449
|
+
context_features : Collection of str, optional
|
|
3450
|
+
List of features names to use as contexts in queries. If unspecified,
|
|
3451
|
+
the default is all trained features when using trained cases and
|
|
3452
|
+
all given features and their derived features when using new_cases.
|
|
3448
3453
|
details : dict of str to bool, optional
|
|
3449
3454
|
Ignored if action features are not specified.
|
|
3450
3455
|
If details are specified, the response will contain the requested
|
|
@@ -3495,6 +3500,10 @@ class Trainee(BaseTrainee):
|
|
|
3495
3500
|
parameter. Only one of ``case_indices``, ``conditions``, or
|
|
3496
3501
|
``new_cases`` may be specified.
|
|
3497
3502
|
|
|
3503
|
+
When using a time-series Trainee, derived feature values will be
|
|
3504
|
+
computed for the given data for each group if no derived feature
|
|
3505
|
+
values are given.
|
|
3506
|
+
|
|
3498
3507
|
Example::
|
|
3499
3508
|
|
|
3500
3509
|
new_cases = [
|
|
@@ -3533,6 +3542,7 @@ class Trainee(BaseTrainee):
|
|
|
3533
3542
|
action_features=action_features,
|
|
3534
3543
|
case_indices=case_indices,
|
|
3535
3544
|
conditions=conditions,
|
|
3545
|
+
context_features=context_features,
|
|
3536
3546
|
details=details,
|
|
3537
3547
|
features=features,
|
|
3538
3548
|
filter_fanout_values=filter_fanout_values,
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "121.0.2",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"amalgam": "82.
|
|
4
|
+
"amalgam": "82.1.1"
|
|
5
5
|
},
|
|
6
6
|
"display_title": "",
|
|
7
7
|
"build_date": "",
|
|
8
|
-
"sha": "
|
|
9
|
-
"url": "https://github.com/howsoai/howso-engine/releases/tag/
|
|
8
|
+
"sha": "6956725209ccdee206cbb68d964436c0e31d9358",
|
|
9
|
+
"url": "https://github.com/howsoai/howso-engine/releases/tag/121.0.2"
|
|
10
10
|
}
|
|
@@ -57,7 +57,7 @@ from howso.utilities.utilities import ( # noqa: F401
|
|
|
57
57
|
format_confusion_matrix,
|
|
58
58
|
get_hash,
|
|
59
59
|
get_kwargs,
|
|
60
|
-
|
|
60
|
+
get_optimized_partition_size,
|
|
61
61
|
is_null_value,
|
|
62
62
|
is_valid_datetime_format,
|
|
63
63
|
is_valid_uuid,
|
|
@@ -130,7 +130,7 @@ __all__ = [
|
|
|
130
130
|
"format_dataframe",
|
|
131
131
|
"get_hash",
|
|
132
132
|
"get_kwargs",
|
|
133
|
-
"
|
|
133
|
+
"get_optimized_partition_size",
|
|
134
134
|
"infer_fanout_feature_config",
|
|
135
135
|
"infer_feature_attributes",
|
|
136
136
|
"is_null_value",
|
{howso_engine-67.2.0 → howso_engine-68.0.0}/howso/utilities/feature_attributes/abstract_data.py
RENAMED
|
@@ -78,6 +78,8 @@ class InferFeatureAttributesAbstractData(InferFeatureAttributesBase):
|
|
|
78
78
|
|
|
79
79
|
def __call__(self, **kwargs) -> SingleTableFeatureAttributes:
|
|
80
80
|
"""Process and return feature attributes."""
|
|
81
|
+
self._validate_rare_value_parameters(kwargs.get("preserve_rare_values"),
|
|
82
|
+
kwargs.get("preserve_rare_values_caps"))
|
|
81
83
|
# For Spark compute types, multiprocessing is less-performant.
|
|
82
84
|
# If we're working with the SparkDataFrameData ADC, unless the user
|
|
83
85
|
# specifically sets `max_workers`, we want "sharding" disabled.
|