वेक्टर समानता क्या है?

वेक्टर समानता मापती है कि बहु-आयामी स्थान में दो वेक्टर कितने समान हैं। वेक्टर संख्याओं की क्रमबद्ध सूचियां हैं जो डेटा बिंदुओं का प्रतिनिधित्व करती हैं — ये machine learning embeddings, recommendation systems, natural language processing, image recognition, और scientific computing में दिखाई देते हैं। दो वेक्टर की तुलना करने से आप जान सकते हैं कि अंतर्निहित डेटा बिंदु कितने करीब या संबंधित हैं।

दो मुख्य अवधारणाएं उपयोग की जाती हैं:

  • समानता: एक स्कोर जो दर्शाता है कि दो वेक्टर कितने समान हैं। उच्च मान आमतौर पर अधिक समान होने का मतलब है (उदाहरण के लिए, cosine similarity 1 का मतलब समान दिशा है)।
  • दूरी: यह मापता है कि दो वेक्टर कितनी दूर हैं। निम्न मान आमतौर पर अधिक समान होने का मतलब है (उदाहरण के लिए, Euclidean distance 0 का मतलब समान वेक्टर है)।

उपकरण विवरण

यह उपकरण information theory, statistics, और geometry से 50 से अधिक प्रसिद्ध विधियों का उपयोग करके दो numeric vectors के बीच समानता या दूरी की गणना करता है। दो वेक्टर दर्ज करें, समानता या दूरी टैब से एक विधि चुनें, और परिणाम तुरंत आपके ब्राउज़र में गणना किया जाता है।

उदाहरण

इनपुट

Vector A: 1, 2, 3
Vector B: 4, 5, 6
विधि परिणाम
Cosine similarity 0.9746318461970762
Euclidean distance 5.196152422706632
Manhattan distance 16.5

स्वीकृत इनपुट प्रारूप

निम्नलिखित सभी समान हैं:

1, 2, 3
[1, 2, 3]
(1 2 3)
1;2;3

विशेषताएं

  • 50+ विधियां — दूरियों (Euclidean, Manhattan, Chebyshev, Cosine, Kullback-Leibler, Jensen-Shannon, और अधिक) या समानताओं (Cosine, Jaccard, Dice, Tanimoto, और अधिक) में से चुनें
  • लचीला इनपुट — comma-, space-, या semicolon-separated मानों को कोष्ठक के साथ या बिना स्वीकार करता है
  • तत्काल परिणाम — सभी गणना client-side पर चलती है, कोई डेटा सर्वर को नहीं भेजा जाता है

समर्थित विधियां

समानता विधियां

विधि विवरण
Cosine दो वेक्टर के बीच के कोण को मापता है; NLP और recommendation systems में व्यापक रूप से उपयोग किया जाता है
Kumar-Hassebrook Jaccard और cosine को जोड़ने वाली सामान्यीकृत समानता
Dice दो बार intersection को element counts के योग से विभाजित
Tanimoto continuous vectors के लिए विस्तारित Jaccard coefficient
Intersection element-wise minimums का योग
Czekanowski minimums के दो बार योग का कुल योग से अनुपात
Motyka intersection को सभी elements के योग से विभाजित
Kulczynski precision और recall-like अनुपातों का harmonic mean
Squared Chord element products के square roots पर आधारित
Pearson दो वेक्टर के बीच linear correlation coefficient

दूरी विधियां

विधि विवरण
Euclidean n-dimensional space में सीधी-रेखा दूरी
Squared Euclidean square root के बिना Euclidean distance
Manhattan (City Block) absolute element-wise differences का योग
Chebyshev सभी dimensions में अधिकतम absolute difference
Canberra शून्य के पास मानों के प्रति संवेदनशील weighted Manhattan distance
Sørensen absolute differences के योग को सभी मानों के योग से विभाजित
Gower absolute differences का normalized mean
Soergel absolute differences का element-wise maximums से अनुपात
Lorentzian absolute differences के natural logs का योग जमा एक
Clark absolute differences को sums पर weighted distance
Wave Hedges absolute differences के योग को element-wise maximums से विभाजित
Czekanowski Czekanowski coefficient का distance form
Motyka Motyka coefficient का distance form
Kulczynski Kulczynski coefficient का distance form
Tanimoto Tanimoto coefficient का distance form
Ruzicka Ruzicka similarity का complement
Inner Product distance measure के रूप में negative dot product
Harmonic Mean element pairs के harmonic means पर आधारित distance
Jaccard non-matching components का अनुपात
Dice Dice coefficient का distance form
Fidelity element products के square root पर आधारित (Bhattacharyya-related)
Bhattacharyya दो probability distributions के बीच overlap को मापता है
Hellinger Bhattacharyya distance का square root
Matusita square roots के squared differences के आधे योग का square root
Squared Chord Squared Chord coefficient का distance form
Pearson Pearson correlation coefficient का distance form
Neyman Chi-squared-type divergence
Squared Squared chi-squared distance
Probabilistic Symmetric chi-squared divergence का symmetric version
Divergence Doubly weighted squared distance
Additive Symmetric Neyman और Pearson chi-squared divergences का average
Kullback-Leibler distributions के बीच information-theoretic divergence
Jeffreys Symmetric Kullback-Leibler divergence
K Divergence average distribution पर आधारित asymmetric divergence
Topsøe दो बार Jensen-Shannon divergence
Jensen-Shannon Kullback-Leibler का smoothed, symmetric version
Jensen Difference convex functions के लिए Jensen inequality पर आधारित
Taneja Arithmetic-geometric mean divergence
Kumar-Johnson even powers के squared differences पर आधारित
Intersection intersection similarity का complement
Average (City Block + Chebyshev) Manhattan और Chebyshev distances का mean

यह कैसे काम करता है

यह उपकरण प्रत्येक वेक्टर इनपुट को संख्याओं के sequence में parse करता है, optional brackets को हटाता है, और commas, spaces, या semicolons पर split करता है। फिर यह दोनों arrays को ml-distance library से चयनित function को पास करता है, जो pure JavaScript में गणना करता है। दोनों वेक्टर के पास समान संख्या में dimensions होने चाहिए; अन्यथा उपकरण एक validation error दिखाता है।

सीमाएं

  • कुछ विधियां (उदाहरण के लिए, Kullback-Leibler, Bhattacharyya) को सभी मानों को strictly positive होना चाहिए और 1 तक योग होना चाहिए (probability distributions)। arbitrary vectors का उपयोग करने से Infinity या NaN हो सकता है, जिसे उपकरण computation error के रूप में मानता है।
  • बहुत बड़े वेक्टर (हजारों dimensions) समर्थित हैं लेकिन चयनित विधि के आधार पर एक brief delay का कारण बन सकते हैं।