np.linalg.eig() से Eigenvalues
Eigenvalues और eigenvectors वे directions reveal करते हैं जहाँ एक matrix सिर्फ stretch करता है, और कितना।
In this page:
Syntax
eigenvalues, eigenvectors = np.linalg.eig(matrix)
np.linalg.eig()
np.linalg.eig एक pair return करता है: eigenvalues का एक array और एक matrix जिसके columns matching eigenvectors हैं। ये A v = lambda v satisfy करते हैं। Eigen-decomposition PCA और कई physics और data-science methods का आधार है।
Note:
Symmetric matrices के लिए np.linalg.eigh इस्तेमाल करें; यह faster है और real values return करता है।
उदाहरण: np.linalg.eig()
import numpy as np
A = np.array([[2, 0], [0, 3]])
vals, vecs = np.linalg.eig(A)
print(sorted(vals))
v = vecs[:, 0]
print(np.allclose(A @ v, vals[0] * v))
# Output:
# [2.0, 3.0]
# True
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- Columns की बजाय rows से eigenvectors पढ़ना
- यह मान लेना कि eigenvalues sorted आते हैं
- non-symmetric matrices के लिए complex results ignore करना
चैप्टर सारांश
- eig eigenvalues और eigenvectors return करता है
- Eigenvectors columns हैं
- Order guaranteed नहीं है
- eigh symmetric matrices के लिए suit करता है
🔒
Chapter Quiz — Complete all 6 topics to unlock
0/6 topics done
Complete these topics first: