operator: similar-input
description:
similar-input[op] seq
returns the similarity of seq with all kets that have op defined
the back-end to this operator uses simm
examples:
-- learn the noises of cats and dogs:
sounds-it-makes |cat> => |purring> + |miaowing> + |scratching at the door>
sounds-it-makes |dog> => |panting> + |sniffing> + |scratching at the door>
-- which animal is at the door, given the input noise:
which-animal-given (*) #=> normalize[100] similar-input[sounds-it-makes] words-to-list |_self>
-- now ask some questions:
which-animal-given |panting>
100.0|dog>
which-animal-given |purring>
100.0|cat>
which-animal-given |scratching at the door>
50.0|cat> + 50.0|dog>
which-animal-given |sniffing and scratching at the door>
66.667|dog> + 33.333|cat>
-- predict which noises you will hear next, given the input noise:
predict-noise-given (*) #=> normalize[100] sounds-it-makes similar-input[sounds-it-makes] words-to-list |_self>
-- now ask some questions:
predict-noise-given |panting>
33.333|panting> + 33.333|sniffing> + 33.333|scratching at the door>
predict-noise-given |purring>
33.333|purring> + 33.333|miaowing> + 33.333|scratching at the door>
predict-noise-given |sniffing and scratching at the door>
22.222|panting> + 22.222|sniffing> + 33.333|scratching at the door> + 11.111|purring> + 11.111|miaowing>
bar-chart[40] predict-noise-given |sniffing and scratching at the door>
----------
panting : ||||||||||||||||||||||||||
sniffing : ||||||||||||||||||||||||||
scratching at the door : ||||||||||||||||||||||||||||||||||||||||
purring : |||||||||||||
miaowing : |||||||||||||
----------
see also:
find-topic, simm, map
Home