<jupyter_start><jupyter_text>Linear Algebra practiceBased on Intro to Linear Algebra for ML from ML Mastery<jupyter_code>import numpy as np
v = np.array([1,2,3])
print(v)
b = np.array([4,5,6])
print(v*b)
print(v+b)
print(v-b)
print(v/b)
print(b % v)
print(np.dot(v,b))
print(np.cross(v,b))<jupyter_output>[-3  6 -3]<jupyter_text>Matrices<jupyter_code>matrix_a = np.array([[1,2,3], [4,5,6]])
print(matrix_a)
matrix_b = np.array([[5,6,7], [7,8,9]])
print(matrix_b)
print(matrix_a + matrix_b)
print(matrix_a.dot(matrix_b))
matrix_c = np.array([[1,2], [3,4], [5,6]])
print(matrix_a.dot(matrix_c))
print(np.dot(matrix_a, matrix_c))
print(np.cross(matrix_a, matrix_b))
P = np.array([[8,2], [3,9], [5,6]])
print(P)
Q = P.T
print(Q)
R = np.array([[1.0,2.0], [3.0,4.0]])
S = np.linalg.inv(R)
print(S)
# determinant
print(np.linalg.det(R))
# trace
print(np.trace(P))
# rank
print(np.linalg.matrix_rank(R))<jupyter_output>2
{'fraction_non_alphanumeric': 0.22587719298245615, 'fraction_numerical': 0.046052631578947366, 'mean_word_length': 7.008771929824562, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '666901', 'license': 'MIT', 'n_tokens_mistral': 454, 'n_tokens_neox': 454, 'n_words': 70, 'path': 'Linear Algebra practice.ipynb', 'repo_name': 'joshfuchs/IntroDataScience', 'size': '912'}