# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# Libraries for this section 
import numpy as np
import pandas as pd
import altair as alt
alt.themes.enable('dark')

# +
# https://pabloinsente.github.io/intro-linear-algebra

### special vectors

# zero vector: vectors comprised of zero only
zeroV = np.array([[0],[0],[0]])
print(zeroV)
print('')

# unit vectors: comprised of single element equal to 1
x1 = np.array([[1,0,0]])
print(x1)
print('')

# sparse vectors: comprised mostly of zeros 
# -

# vector addition is an element-wise operation
v1 = np.array([[1],[2],[3]])
v2 = np.array([[2],[4],[6]])
v1 + v2

# vector scalar multiplication is element-wise
2*v1

# +
# linear combinations: combining addition and multipication 
# gives us linear combinations
# ax + by
# everything in linear algebra results from linear combinations
# linear regression is a linear combination of vectors

a,b = 2,3
x,y = np.array([[2],[3]]), np.array([[4],[5]])
a*x + b*y
# -

# vector vector multiplication, aka dot product, aka inner product
print(x.T@y)
print('or')
print(np.dot(x.T,y))

# +
# vector space is a vector and all possible linear combinations
# of the vector set

# vector span
# overlapping vectors span a line
# similar to multicolinearity/colinear
# non overlapping vectors span a plane 
# if x and y point in diff directions than span(x,y) is equal
# to whole 2d plane - you can reach any point taking 
# combinations of ax and by

# vector subspaces
# vector space/linear subspace that lies within larger vector space
# must include zero vecot
# must have closure - can't "jump out" of 2d into 3d..nd 
# by either adding or multiplying


# +
# linear dependence
# redudant info

# linear indpendence
# non-redudant info

# -

# vector null-space
# norms
# vector inner product, length, distance
# vector angles and orthoganilty
# systems of linear equations


StarcoderdataJupyterScriptsDedupFiltered