Note, last week is missing. Most of what I did is included in the prior week, and the rest is included here. It wasn’t enough to merit its own week, because I was too busy traveling and preparing my residency permit application (so I don’t get deported when my travel VISA expires in 7 weeks).

What I did

What I learned

class Person:
  def __init__(self):
      self.name = 'Sarah'
      self._age = 26
      self.__id = 30

>>> p = Person()
>>> dir(p)
['_Person__id', ..., '_age', 'name']

>>> p.name
Sarah

>>> p._age
26

>>> p.__id
AttributeError: 'Person' object has no attribute '__id'

>>> p._Person__id
30

#check out how you can still override __id with a subclass
class Friend(Person):
  def __init__(self):
    self.name = 'Sarah'
    self._age = 26
    self.__id = 25

>>> fr = Friend()

>>> fr._Person__id
30
>>> fr._Friend__id
25

-

class Teacher():
  __init__(self, name, class_):
    self.name
    self.class_

-

for i, _ in enumerate(np.zeros(3)):
  print(i)
>>> 0
>>> 1
>>> 2

Random Stats Review

\[z = \frac{x- \mu}{\sigma}\] \[t = \frac{x- \bar{x}}{s/\sqrt{n}}\] \[P(a \cap b \cap c) = P(a \mid b \cap c) * P(b \mid c) * P(c)\]

or this is can also be written as:

\[P(a, b, c) = P(a \mid b, c) * P(b \mid c)* P(c)\]

Correlation Coefficients and Regression

\[\overbrace{\hat\beta_1=\frac{\text{Cov}(x,y)}{\text{Var}(x)}}^{y\text{ on } x}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\overbrace{\hat\beta_1=\frac{\text{Cov}(y,x)}{\text{Var}(y)}}^{x\text{ on }y}\] \[r = \frac{\text{Cov}(x,y)}{\sigma_x \sigma_y} = \frac{\sum((x-\mu_x)(y-\mu_y))}{\sqrt{\sum(x-\mu_x)}\sqrt{\sum(y-\mu_y)}}\]

So you can kind of think of r as the slope of the best fit curve when both the independent and dependent variables are standardized.

NLP

\[\frac{A \cdot B}{||A|| * ||B||} = \frac{\sum(A_i *B_i)}{\sqrt{\sum A_i^2}\sqrt{\sum B_i^2}}\]

An Overlooked Python Basic

What I will do next