{"id":"robust_stats_embedding_similarity","title":"Robust statistics embedding similarity","family":"embedding","definition":"reference","intro_en":"Replace extrema and moments with the lower quartile, median, upper quartile and median absolute deviation. This explicit descriptor emphasizes the central distribution and reduces the influence of isolated extreme values. It does not preserve the timing of those values. Cosine compares vector direction and is defined here for nonzero feature vectors.","intro_zh":"使用下四分位数、中位数、上四分位数和中位绝对偏差构成明确的描述向量。它强调分布的中心部分，降低孤立极端值的影响，同时舍弃这些数值出现的时刻。 余弦比较向量方向，本例特征向量均非零。","steps_en":["Calculate Q25, median, Q75 and unscaled median absolute deviation.","Collect the computed coordinates in the same fixed order for both inputs.","Normalize by both vector lengths and sum coordinate products to obtain cosine similarity.","Interpret the score in this representation, accounting for the information it discards."],"steps_zh":["计算 Q25、中位数、Q75 和未经常数缩放的中位绝对偏差。","把计算得到的坐标按同一个固定顺序组成两个向量。","用两个向量的长度归一化坐标乘积之和，得到余弦相似度。","结合表示所舍弃的信息，在该表示空间中解释分数。"],"animation_steps_en":["Compute quartiles, median and unscaled median absolute deviation.","Collect matching coordinates in the same vector order.","Normalize vector products to obtain cosine similarity.","Read the score in this feature space, with its stated information loss."],"formula":"s(x,y) = dot(phi(x),phi(y)) / (norm(phi(x))*norm(phi(y)))","caveats_en":["Robustness concerns these particular statistics, not immunity to arbitrary contamination or distribution shift.","Quantiles use linear interpolation and MAD is unscaled; alternative conventions produce different vectors.","Cosine ignores positive rescaling of the entire feature vector; 1-cosine is generally not a metric, and zero vectors require an explicit policy."],"caveats_zh":["稳健性针对所选统计量，并不表示可抵抗任意污染或分布变化。","本例分位数采用线性插值，MAD 不乘缩放常数；其他约定会产生不同向量。","余弦忽略整个特征向量的正比例缩放；1-cosine 通常不满足度量公理，零向量还需明确处理规则。"],"sources":[{"label":"NumPy: summary-statistic definitions","url":"https://numpy.org/doc/stable/reference/routines.statistics.html"},{"label":"Imported registry: named feature and comparison conventions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"},{"label":"Exact illustrative inputs and encoder definitions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/tools/method_animation_data/feature_model_embedding.py"}],"x":[0.0,0.8769216919004693,0.8094744111674236,0.7863961030678929,0.3905255888325767,-0.5769216919004693,-0.6000000000000001,-0.09587051423531628,0.2094744111674235,1.0863961030678926,1.5905255888325764,0.9958705142353173,0.6000000000000002,0.20412948576468337,-0.39052558883257615,0.11360389693210537],"y":[-0.2003300858899106,0.185,0.5703300858899106,1.005,1.0003300858899107,0.3250000000000002,-0.35033008588991066,-0.3550000000000001,0.07966991411008931,0.46499999999999997,0.8503300858899105,1.2849999999999995,1.2803300858899114,0.6050000000000002,-0.07033008588991083,-0.07500000000000043],"input_label":"Deterministic synthetic teaching signals, 16 samples each","parameters":{"features":["q25","median","q75","unscaled_MAD"],"quantile_method":"linear","comparison":"cosine"},"result":{"label":"similarity","value":0.9949376962483398,"detail":"Computed from the explicitly defined illustrative encoder; no learned weights."},"frames":[{"phase":0,"caption":"Summarize the first 4 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 4 samples","a":[0.5897970773009197,0.7979352571176582,0.826336231350685,0.04526279441628822],"a_label":"x features","b":[0.08866747852752235,0.3776650429449553,0.678997564417433,0.38533008588991063],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3]},{"phase":0,"caption":"Summarize the first 6 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 6 samples","a":[0.09763139720814418,0.5884608459502347,0.8037048341425409,0.2547372055837117],"a_label":"x features","b":[0.22000000000000003,0.4476650429449554,0.8928300858899106,0.40766504294495537],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3,4,5]},{"phase":0,"caption":"Summarize the first 8 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 8 samples","a":[-0.21613330865160452,0.19526279441628835,0.7921656800927755,0.6026724627013699],"a_label":"x features","b":[-0.23783008588991061,0.2550000000000001,0.6778300858899107,0.5303300858899107],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3,4,5,6,7]},{"phase":0,"caption":"Summarize the first 10 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 10 samples","a":[-0.07190288567648721,0.3000000000000001,0.8037048341425409,0.49793525711765807],"a_label":"x features","b":[-0.13033008588991063,0.2550000000000001,0.543997564417433,0.38533008588991063],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9]},{"phase":0,"caption":"Summarize the first 12 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 12 samples","a":[-0.02396762855882907,0.5884608459502347,0.9066588974841813,0.4526724627013702],"a_label":"x features","b":[0.009669914110089328,0.3950000000000001,0.8878300858899106,0.5253300858899106],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9,10,11]},{"phase":0,"caption":"Summarize the first 16 observations using the stated descriptor.","panel":{"kind":"bars","title":"Descriptor from first 16 samples","a":[-0.02396762855882907,0.3000000000000001,0.826336231350685,0.49793525711765807],"a_label":"x features","b":[-0.07149756441743323,0.3950000000000001,0.8878300858899106,0.4676650429449557],"b_label":"y features","labels":["Q25","median","Q75","MAD"]},"input_highlight":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]},{"phase":1,"caption":"Expose 1 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907],"a_label":"x features","b":[-0.07149756441743323],"b_label":"y features","labels":["Q25"],"marker":0}},{"phase":1,"caption":"Expose 1 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907],"a_label":"x features","b":[-0.07149756441743323],"b_label":"y features","labels":["Q25"],"marker":0}},{"phase":1,"caption":"Expose 2 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907,0.3000000000000001],"a_label":"x features","b":[-0.07149756441743323,0.3950000000000001],"b_label":"y features","labels":["Q25","median"],"marker":1}},{"phase":1,"caption":"Expose 2 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907,0.3000000000000001],"a_label":"x features","b":[-0.07149756441743323,0.3950000000000001],"b_label":"y features","labels":["Q25","median"],"marker":1}},{"phase":1,"caption":"Expose 3 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907,0.3000000000000001,0.826336231350685],"a_label":"x features","b":[-0.07149756441743323,0.3950000000000001,0.8878300858899106],"b_label":"y features","labels":["Q25","median","Q75"],"marker":2}},{"phase":1,"caption":"Expose 4 of 4 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Feature vectors","a":[-0.02396762855882907,0.3000000000000001,0.826336231350685,0.49793525711765807],"a_label":"x features","b":[-0.07149756441743323,0.3950000000000001,0.8878300858899106,0.4676650429449557],"b_label":"y features","labels":["Q25","median","Q75","MAD"],"marker":3}},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688],"a_label":"contributions","labels":["Q25"],"marker":0},"value":0.0015688877009920688,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688],"a_label":"contributions","labels":["Q25"],"marker":0},"value":0.0015688877009920688,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472],"a_label":"contributions","labels":["Q25","median"],"marker":1},"value":0.11005993348773928,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472],"a_label":"contributions","labels":["Q25","median"],"marker":1},"value":0.11005993348773928,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156],"a_label":"contributions","labels":["Q25","median","Q75"],"marker":2},"value":0.7817395952837548,"value_label":"partial dot sum"},{"phase":2,"caption":"Sum normalized dot-product contributions from the displayed coordinates.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156,0.213198100964585],"a_label":"contributions","labels":["Q25","median","Q75","MAD"],"marker":3},"value":0.9949376962483398,"value_label":"partial dot sum"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156,0.213198100964585],"a_label":"contributions","labels":["Q25","median","Q75","MAD"],"marker":0},"value":0.9949376962483398,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156,0.213198100964585],"a_label":"contributions","labels":["Q25","median","Q75","MAD"],"marker":1},"value":0.9949376962483398,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156,0.213198100964585],"a_label":"contributions","labels":["Q25","median","Q75","MAD"],"marker":2},"value":0.9949376962483398,"value_label":"final similarity"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Dot-product terms / fixed full-vector norms","a":[0.0015688877009920688,0.1084910457867472,0.6716796617960156,0.213198100964585],"a_label":"contributions","labels":["Q25","median","Q75","MAD"],"marker":3},"value":0.9949376962483398,"value_label":"final similarity"}],"echotime_status":"Low-priority addition","echotime_api":""}
