Skip to content

Commit

Permalink
22397: Fixes missing path in SDM logic
Browse files Browse the repository at this point in the history
  • Loading branch information
howsohazard committed Dec 12, 2024
1 parent d0351b4 commit 1455e96
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 70 deletions.
9 changes: 9 additions & 0 deletions src/Amalgam/GeneralizedDistance.h
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ class RepeatedGeneralizedDistanceEvaluator
distEvaluator->ComputeDistanceTermNominalNonmatchFromMatchProbabilities(
index, prob_class_given_match, prob_class_given_nonmatch, high_accuracy);
}
return;
}
}
else if(feature_data.targetValue.nodeType == ENIVT_STRING_ID)
Expand Down Expand Up @@ -1203,8 +1204,16 @@ class RepeatedGeneralizedDistanceEvaluator
= distEvaluator->ComputeDistanceTermNominalNonmatchFromMatchProbabilities(
index, prob_class_given_match, prob_class_given_nonmatch, high_accuracy);
}
return;
}
}

//made it here, so didn't find anything in the SDM. use fallback for default nominal terms
feature_data.defaultNominalMatchDistanceTerm =
distEvaluator->ComputeDistanceTermNominalUniversallySymmetricExactMatch(index, high_accuracy);

feature_data.defaultNominalNonMatchDistanceTerm =
distEvaluator->ComputeDistanceTermNominalUniversallySymmetricNonMatch(index, high_accuracy);
}

//for the feature index, computes and stores the distance terms as measured from value to each interned value
Expand Down
6 changes: 3 additions & 3 deletions src/Amalgam/amlg_code/full_test.amlg
Original file line number Diff line number Diff line change
Expand Up @@ -3918,10 +3918,10 @@

(create_entities (list "DistanceTestContainer" "point2")
(lambda (null
##a 1.1
##b 2
##a 2
##b 1
##c 1
##d 100
##d 120
##e 1
##f 50.1
))
Expand Down
143 changes: 76 additions & 67 deletions src/Amalgam/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ hello world: 12 and 2
(print "hello")
[(null) (null) .infinity -.infinity]

{b 2 c ["alpha" "beta" "gamma"] a 1}
{b 2 a 1 c ["alpha" "beta" "gamma"]}
{
b 2
c ["alpha" "beta" "gamma"]
a 1
c ["alpha" "beta" "gamma"]
}

(apply "6")
Expand Down Expand Up @@ -651,15 +651,15 @@ a
a 1
b 2
c 3
d 4
e 5
f 6
}
{a 1 c 3}
{c 3 d 4}
{
a 1
b 2
c 3
f 6
d 4
}
{
a 1
Expand Down Expand Up @@ -702,15 +702,15 @@ c
a 1
b 2
c 3
d 4
e 5
f 6
}
{a 1 c 3}
{c 3 d 4}
{
a 1
b 2
c 3
f 6
d 4
}
{
a 1
Expand Down Expand Up @@ -1061,7 +1061,7 @@ abcdef
[1 3]
[9 5]
--indices--
[4 "b" "c" "a"]
["b" "a" "c" 4]
[
0
1
Expand All @@ -1073,10 +1073,10 @@ abcdef
7
]
[0 1 2 3]
[3 1 2 0]
[3 1 2 0]
[1 3 0 2]
[1 3 0 2]
--values--
["d" 2 3 1]
[2 1 3 "d"]
[
"a"
1
Expand All @@ -1097,7 +1097,7 @@ abcdef
4
"d"
]
[1 "d" 2 3]
[1 2 3 "d"]
[
1
2
Expand Down Expand Up @@ -1249,10 +1249,10 @@ string
list
assoc
[
4
"4"
{4 4}
[4]
{4 4}
"4"
4
]
--set--
{
Expand Down Expand Up @@ -1337,7 +1337,7 @@ current_index: 2
rmfile "del /s /q "
rwww 1
slash "\\"
start_time 1733974731.086413
start_time 1734020363.436025
www 1
x 12
zz 10
Expand Down Expand Up @@ -1383,7 +1383,7 @@ current_index: 2
rmfile "del /s /q "
rwww 1
slash "\\"
start_time 1733974731.086413
start_time 1734020363.436025
www 1
x 12
zz 10
Expand Down Expand Up @@ -1428,7 +1428,7 @@ current_index: 2
rmfile "del /s /q "
rwww 1
slash "\\"
start_time 1733974731.086413
start_time 1734020363.436025
www 1
x 12
zz 10
Expand Down Expand Up @@ -1568,15 +1568,15 @@ b

["b" @(get (target 2) 0) @(get (target 2) 0) "a"]

infinity test c or d: ["d" "d" "c" "d"]
infinity test c or d: ["c" "c" "d" "c"]

infinity test c or d: ["c" "d" @(get (target 2) 1) @(get (target 2) 0)]

{a 23 b 43 c 34}
{a 34 b 43 c 23}

{a 30 b 50 c 20}

[3 2 6]
[1 9 7]

--get_rand_seed--
0R����'`�!�c�l�
Expand Down Expand Up @@ -1672,17 +1672,17 @@ string
{a 3 b 4}
{c "c"}
]
21: [{"b":4,"a":3},{"d":null,"c":"c"}]
21: [{"a":3,"b":4},{"c":"c","d":null}]
22: [{"a":3,"b":4},{"c":"c","d":null}]
23: d: 4
b: 2
c: 3
a: 1
e:
23: e:
- a
- b
-
- .inf
a: 1
b: 2
c: 3
d: 4

24: a: 1
b: 2
Expand All @@ -1695,7 +1695,7 @@ e:
- .inf

25: {a 1}
current date-time in epoch: 2024-12-11-22.38.51.1413040
current date-time in epoch: 2024-12-12-11.19.23.4932550
2020-06-07 00:22:59
1391230800
1391230800
Expand Down Expand Up @@ -2861,18 +2861,16 @@ flatten restore with parallel
19.264241099357605
--intersect_entities--
(associate "b" 4)
MergeEntityChild1
(associate "x" 3 "y" 4)
MergeEntityChild2
(associate "p" 3 "q" 4)
_1651806471
(associate "e" 3 "f" 4)
MergeEntityChild1
(associate "x" 3 "y" 4)
_3130331116
(associate "E" 3 "F" 4)
_1651806471
(associate "e" 3 "f" 4)
--union_entities--
(associate "b" 4 "a" 3 "c" 3)
MergeEntityChild1
(associate "x" 3 "y" 4 "z" 5)
MergeEntityChild2
(associate
"p"
Expand All @@ -2886,17 +2884,8 @@ MergeEntityChild2
"w"
7
)
_1651806471
(associate
"e"
3
"f"
4
"g"
5
"h"
6
)
MergeEntityChild1
(associate "x" 3 "y" 4 "z" 5)
_3130331116
(associate
"E"
Expand All @@ -2908,21 +2897,21 @@ _3130331116
"H"
6
)
(parallel
##p
["_2325275497" "_2973704165" "_2325275497" "_2973704165"]
)
_2325275497
_1651806471
(associate
"E"
"e"
3
"F"
"f"
4
"G"
"g"
5
"H"
"h"
6
)
(parallel
##p
["_2325275497" "_2973704165" "_2325275497" "_2973704165"]
)
_2973704165
(associate
"e"
Expand All @@ -2934,6 +2923,17 @@ _2973704165
"h"
6
)
_2325275497
(associate
"E"
3
"F"
4
"G"
5
"H"
6
)
--difference_entities--
(declare
{_ (null) new_entity (null)}
Expand Down Expand Up @@ -3638,14 +3638,23 @@ difference between DiffContainer and DiffEntity2:
)
--mix_entities--
(associate "b" 4)
MergeEntityChild2
(associate
"p"
3
"q"
4
"v"
6
"w"
7
)
MergeEntityChild1
(associate "x" 3 "y" 4)
MergeEntityChild2
(associate "p" 3 "q" 4)
_1651806471
(associate "e" 3 "f" 4)
_3130331116
(associate "E" 3 "F" 4 "H" 6)
(associate "E" 3 "F" 4)
_1651806471
(associate "e" 3 "f" 4 "h" 6)
--get_entity_comments--
Full test
This is a suite of unit tests.
Expand Down Expand Up @@ -3724,7 +3733,7 @@ deep sets

--set_entity_root_permission--
RootTest
1733974731.301378
1734020363.651827
(true)

RootTest
Expand Down Expand Up @@ -4373,7 +4382,7 @@ test code and string distances
["Child2" "Child4" "Child7"]
["Child2" "Child4" "Child7"]
assoc-based: ["Child2" "Child4" "Child7"]
["Child2" "Child4" "Child7"]
["Child2" "Child4" "Child6"]
--contained_entities caching and permissions--
(false)

Expand Down Expand Up @@ -4565,15 +4574,15 @@ case conviction:{
}
cyclic feature nearest neighbors: {cyclic1 1 cyclic5 0.5}
cyclic test expected: 155, 200, 190 ... deg values of 0 8 and 12:
155: 0.1 (null
##deg 0
)
200: 0.05555555555555555 (null
##deg 8
)
190: 0.045454545454545456 (null
##deg 12
)
155: 0.1 (null
##deg 0
)
--contains_label--
(true)

Expand Down Expand Up @@ -4843,7 +4852,7 @@ cyclic lookup test 2:
1036.1581794564518
24.769501899470985
4.3464184709105573e-45
{point1 1036.1581794564518 point2 1525.8270525882294 point3 1036.1581794564518}
{point1 1036.1581794564518 point2 978.5569789822398 point3 1036.1581794564518}
distance symmetry tests
[
[
Expand Down Expand Up @@ -5074,4 +5083,4 @@ rmdir /s /q amlg_code\persistent_tree_test_root
del /s /q amlg_code\persist_module_test\psm.mdam
del /s /q amlg_code\persist_module_test.mdam
--total execution time--
1.1423790454864502
1.4070382118225098

0 comments on commit 1455e96

Please sign in to comment.