Skip to content
Closed
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
dd270dd
save
jackx111 Aug 26, 2024
92570b0
save
jackx111 Aug 26, 2024
7cff986
save
jackx111 Aug 26, 2024
dcc1be7
save
jackx111 Aug 26, 2024
492ce3c
merge
jackx111 Aug 26, 2024
a9102ca
save
jackx111 Aug 28, 2024
cf44282
save
jackx111 Aug 28, 2024
4ee6765
save
jackx111 Aug 28, 2024
4dc4e90
Merge branch 'main' into 20486-shared-deviations
jackx111 Aug 28, 2024
8ee2548
save
jackx111 Aug 28, 2024
370d57c
save
jackx111 Aug 28, 2024
648a244
save
jackx111 Aug 28, 2024
5073c0d
save
jackx111 Aug 29, 2024
54dd203
Merge branch 'main' into 20486-shared-deviations
jackx111 Aug 29, 2024
8076098
save
jackx111 Aug 29, 2024
5fe0b76
cleans up naming and text
jackx111 Aug 30, 2024
922620a
save
jackx111 Aug 30, 2024
6475b59
Merge branch 'main' into 20486-shared-deviations
jackx111 Aug 30, 2024
c7753c4
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 4, 2024
712b682
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 4, 2024
62943ba
Merge branch '20486-shared-deviations' of https://github.com/howsoai/…
jackx111 Sep 4, 2024
19d2fed
make edits
jackx111 Sep 4, 2024
52ae0b3
remove a accum
jackx111 Sep 4, 2024
00301b4
smol fixes
jackx111 Sep 4, 2024
66137cd
update text
jackx111 Sep 4, 2024
9f059f2
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 5, 2024
4a0919d
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 5, 2024
81cb3e1
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 5, 2024
a6c4ecc
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 10, 2024
30f6bbd
address comments
jackx111 Sep 10, 2024
3a9f301
move calcs
jackx111 Sep 10, 2024
a07d9ac
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 10, 2024
690bb10
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 10, 2024
bb75240
add and simply tests
jackx111 Sep 10, 2024
f9e20f6
Merge branch '20486-shared-deviations' of https://github.com/howsoai/…
jackx111 Sep 10, 2024
c03e764
remove accums
jackx111 Sep 11, 2024
e9a705a
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 11, 2024
c56fa91
address some comments
jackx111 Sep 11, 2024
213cdc8
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 11, 2024
b31a245
formating
jackx111 Sep 11, 2024
dfd0af6
Merge branch '20486-shared-deviations' of https://github.com/howsoai/…
jackx111 Sep 11, 2024
46925de
more formatting
jackx111 Sep 11, 2024
34ffc0b
hook this bad boy up to time series
jackx111 Sep 11, 2024
ff9f788
save
jackx111 Sep 12, 2024
6db7503
fix
jackx111 Sep 12, 2024
548ba3b
update
jackx111 Sep 13, 2024
4a28877
save
jackx111 Sep 13, 2024
f94751d
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 16, 2024
5a52ce8
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 18, 2024
a1c10f6
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 18, 2024
627a6ec
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 19, 2024
151c4c8
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 20, 2024
9447cbf
Merge branch '20486-shared-deviations' of https://github.com/howsoai/…
jackx111 Sep 23, 2024
bc0a8ec
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 23, 2024
a9b33a4
21028: Reduces memory usage for S.D.M. computation
howsoRes Sep 25, 2024
e28f77f
Don't pull all classes if not needed
howsoRes Sep 25, 2024
b3ee2eb
code cleanup
howsoRes Sep 25, 2024
5a28bc2
fixes
howsoRes Sep 26, 2024
c0f94ba
improve performance
howsoRes Sep 26, 2024
f444d91
cleanup
howsoRes Sep 26, 2024
c811761
Merge branch '21028-sdm-performance-improvement' into 20486-shared-de…
howsoRes Sep 26, 2024
2a9814b
Merge branch 'main' into 20486-shared-deviations
howsoRes Sep 27, 2024
2e3b099
code cleanup
howsoRes Sep 27, 2024
8b90273
Merge branch 'main' into 20486-shared-deviations
jackx111 Sep 30, 2024
ea6bd2a
fix unit test
howsoRes Sep 30, 2024
ac28b8a
update
jackx111 Sep 30, 2024
81604f1
update typing
jackx111 Sep 30, 2024
3b09085
update typing
jackx111 Sep 30, 2024
a01d6d5
remove uncessary trunc in test
jackx111 Sep 30, 2024
7d5fa9a
turn off for regional residuals
jackx111 Sep 30, 2024
43f5e6c
adjust cm to sdm
jackx111 Oct 1, 2024
e49f39b
small fix
jackx111 Oct 1, 2024
d4969c1
code cleanup + comments
howsoRes Oct 1, 2024
11a9170
Merge branch 'main' into 20486-shared-deviations
jackx111 Oct 14, 2024
290c954
Merge branch 'main' into 20486-shared-deviations
howsoRes Oct 21, 2024
8ba9713
21775: Extra sampling for residuals
howsoRes Oct 22, 2024
8379cf9
fixes
howsoRes Oct 22, 2024
7f56cea
Merge branch 'main' into 21775-extrasampling-residuals
howsoRes Oct 23, 2024
5165714
fixed case case weights for nominals
howsoRes Oct 23, 2024
6a616d0
revert
howsoRes Oct 23, 2024
ce2150a
cleanup
howsoRes Oct 23, 2024
aa5dd6a
Merge branch 'main' into 20486-shared-deviations
howsoRes Oct 24, 2024
b932964
Merge branch '21775-extrasampling-residuals' into 20486-shared-deviat…
howsoRes Oct 24, 2024
cb4ee3b
Merge branch 'main' into 20486-shared-deviations
howsoRes Nov 8, 2024
3f04673
Merge branch 'main' into 20486-shared-deviations
cademack Nov 13, 2024
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
5 changes: 5 additions & 0 deletions howso.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
#!postProcessMap (null)
#!hasDependentFeatures (null)
#!dependentFeatureMap (null)
#!sharedDeviationsMap (null)
#!continuousToNominalDependenciesMap (null)
#!dependentsBoundaryMap (null)
#!dependentValuesCombinationsMap (null)
Expand Down Expand Up @@ -543,6 +544,10 @@
;assoc of feature -> { 'dependent_features' : [ list of dependent features ] }
!dependentFeatureMap (assoc)

;assoc of feature -> { 'shared_deviations_features' : primary feature key from group of shared deviations features }
; This primary feature key is the first sorted feature in the group of features
!sharedDeviationsMap (assoc)

;assoc of continuous feature -> [ list of sorted nominal dependents ]
!continuousToNominalDependenciesMap (assoc)

Expand Down
1 change: 1 addition & 0 deletions howso/analysis.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
weight_feature weight_feature
use_case_weights use_case_weights
compute_null_uncertainties (false)
use_shared_deviations (true)
))
)

Expand Down
6 changes: 4 additions & 2 deletions howso/analysis_weights.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(while (< iteration num_iterations)
(assign (assoc
residuals_map
(call !ExpandResidualValuesToUncertainty (assoc
(call !ExpandResidualValuesToUncertainty (assoc
feature_residuals_map
(call !CalculateFeatureResiduals (assoc
features features
Expand All @@ -51,6 +51,7 @@
compute_all_statistics use_deviations
;don't sparsify the confusion matrix so that SDM can be computed using full counts
confusion_matrix_min_count 0
use_shared_deviations (true)
))
))
))
Expand Down Expand Up @@ -208,7 +209,7 @@
)

;updates analyzed_hp_map
;run multiple iterations of grid search and resdiuals to either use with the inverse_residuals_as_weights flow
;run multiple iterations of grid search and residuals to either use with the inverse_residuals_as_weights flow
#!ConvergeIRW
(declare
(assoc
Expand Down Expand Up @@ -338,6 +339,7 @@
compute_all_statistics use_deviations
;don't sparsify the confusion matrix so that SDM can be computed using full counts
confusion_matrix_min_count 0
use_shared_deviations (true)
))
))
)
Expand Down
188 changes: 188 additions & 0 deletions howso/attribute_maps.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,194 @@
full_dependents_map
)

;Creates two assocs where
; shared_deviations_key_map <- mapping of shared deviations where the keys are each feature within a group of shared deviations, and the values are the feature names in
; which their deviations are stored under. For each group of shared deviations, they are stored under the first sorted feature in their group.
; e.g., a group of features with shared devations is [A, B, C], creates an mapping of A -> A, B -> A, C -> A
#!ProcessSharedDeviationsMap
(seq
(assign (assoc
shared_deviations_map
(append
(map
(lambda
(or
(get shared_deviations_map (current_index))
[(current_index 1)]
)
)
(zip (apply "append" (values shared_deviations_map)))
)
shared_deviations_map
)
))

;create lists of referenced features for each shared feature
(declare (assoc
shared_sets
(map
(lambda (let
(assoc
shared_features (current_value 1)
feature (current_index 1)
)
(append
feature
;keep lists of shared features that reference either this feature or any of its shared_features
(indices (filter
(lambda
(or
(contains_value shared_features (current_index))
(contains_value (current_value) feature)
(!=
(size shared_features)
(size (remove (zip shared_features) (current_value)) )
)
)
)
(remove shared_deviations_map feature)
))
)
))
shared_deviations_map
)
))


(declare (assoc
combined_shared_sets
(map
(lambda (let
(assoc
shared_set (zip (current_value 1))
num_features_in_set (size (current_value 1))
feature (current_index 1)
)

;append all the overlapping shared sets and make them unique by zipping up the appended features
(zip
(apply "append"
;if there's any overlap between shared_set and any other feature's shared_set, combine them
(values (filter
(lambda
(if (!= num_features_in_set (size (remove shared_set (current_value))))
(append shared_set (zip (current_value)))
)
)
(remove shared_sets feature)
))
)
)

))
shared_sets
)

))

(declare (assoc
unique_sets (values combined_shared_sets (true))
))

(declare (assoc
shared_deviations_key_map
(map
(lambda (let
(assoc feature (current_index 1))
;find the the shared set that this feature belongs to and output the first feature from that set
(first (indices
(first (filter
(lambda (contains_index (current_value) feature))
unique_sets
))
))
))
combined_shared_sets
)
))

(assoc
"shared_deviations_key_map" shared_deviations_key_map
"shared_deviations_groupings" unique_sets
)
)

;Validates the necessary parameters for shared deviations, making sure that no shared deviations features are unique nominals.
#!ValidateSharedDeviations
(let
(assoc error_messages (list))
;check to see if any features in a shared deviations group is a unique nominal
(if (size unique_nominals_set)
(declare (assoc
invalid_unique_shared_deviations_features
(filter
(lambda
(contains_value (indices unique_nominals_set) (current_index))
)
(get shared_deviations_map "shared_deviations_key_map")
)
))
)

(if (size invalid_unique_shared_deviations_features)
(accum (assoc
error_messages
(list (concat
"Features with shared deviations may not be unique nominals, as they have null deviations. "
"The following features are in a shared deviations group and is a unique nominal: "
(apply "concat" (trunc (weave (indices invalid_unique_shared_deviations_features) ", ")))
"."
))
))
)

;check to see if nominal features has a shared deviations with non-nominal features
(if (size nominals)
(declare (assoc
invalid_nominals_non_nominals_shared_deviations
(filter
(lambda
(let
(assoc
contains_nominals (false)
contains_non_nominals (false)
)
(map
(lambda
(if (contains_value nominals (current_value))
(assign (assoc contains_nominals (true)) )
(assign (assoc contains_non_nominals (true)) )
)
)
;indices of an assoc of shared deviations groups, i.e. {"a" (null) "b" (null)} -> ["a", "b"]
(indices (current_value))
)
(and
(= (true) contains_nominals)
(= (true) contains_non_nominals)
)
)
)
;list of assocs of shared deviations groups, i.e. [{"a" (null) "b" (null)} {"c" (null) "d" (null)}]
(get shared_deviations_map "shared_deviations_groupings")
)
))
)

(if (size invalid_nominals_non_nominals_shared_deviations)
(accum (assoc
error_messages
(list "Nominal features may not share deviations with non-nominal features.")
))
)

;warns if errors are present
(if (size error_messages)
(conclude (call !Return (assoc errors error_messages)))
)
)


#!ComposeContinuousToNominalDependenciesMap
(let
(assoc
Expand Down
14 changes: 14 additions & 0 deletions howso/attributes.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,17 @@
continuous_to_nominal_dependents_map (null)
nominal_to_nominal_dependents_map (null)
novel_substition_feature_set (null)
shared_deviations_map (null)
))

(call !UpdateAttributesForDateTimeDataTypes)

(assign (assoc
shared_deviations_map
(filter (map
(lambda (get (current_value) "shared_deviations") )
feature_attributes
))
ordinals_map
(filter
(lambda (= "ordinal" (get (current_value) "type")))
Expand Down Expand Up @@ -411,6 +417,13 @@
))
)

(if (size shared_deviations_map)
(seq
(assign (assoc shared_deviations_map (call !ProcessSharedDeviationsMap)))
(call !ValidateSharedDeviations)
)
)

(if (size post_process_map)
(assign (assoc has_post_processing (true)))
)
Expand Down Expand Up @@ -544,6 +557,7 @@

!queryDistanceTypeMap query_distance_type_map
!tsTimeFeature time_series_feature
!sharedDeviationsMap (get shared_deviations_map "shared_deviations_key_map")
))

(call !SetOrdinalFeatures (assoc ordinal_features ordinals))
Expand Down
1 change: 1 addition & 0 deletions howso/details_residuals.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
local_feature_metrics
(if (>= model_size 2)
(call !ExpandResidualValuesToUncertainty (assoc
expand_shared_deviations (false)
feature_residuals_map
(call !CalculateFeatureResiduals (assoc
;only the features from the details
Expand Down
Loading