Logistic Regression

logistic regression here the predicted outputs are binary, either a 0 or a 1, therefore the challenge is finding an equation that can translate the input features to either of the choices. To do this, they use the sigmoid function,viz: f(x)=11+e−z f(x)= \frac{1}{1+e^{-z}} where z is w⃗.x⃗+b\vec{w}.\vec{x} + b . This means if z is high or simply +ve, e−ze^{-z} is very small and f(x) approaches 1 - thus, it is approximated as 1. And for the erverse, it is approximately 0. This way all the data is transformed. ...

February 12, 2025 · 2 min

Z Score Normalization

z-score normalization: This is a way to make all features in the dataset have the same unit (the σ\sigma ). Z=X−μσ Z = \frac{X - \mu}{\sigma} steps are: get mean of feature from all examples ( μ\mu ) get deviation from mean for each item square values from (2) and sum them all Take average of (3), i.e. (3) / m where m is no. of examples Get (4)\sqrt{(4)} ( σ\sigma ) When you do this for each sample feature in a feature set, the range will hence be from +b σ\sigma (gotten from the z norm for number highest from mean) to -b σ\sigma (gotten from the z norm for number lowest from mean) with 0 in the middle (i.e. the mean), where b is a scalar. so cool to understand why they are called “scalar”, because they literally scale what they multiply. ...

February 5, 2025 · 2 min

Multifeature Linear Regression

the math: Logically same as univariate here, just instead of single ww and xx there are multiple. It isalso more efficient to express all weights and features as vectors w⃗\vec{w} and x⃗\vec{x} . This way their dot product ( w⃗\vec{w} ⋅\cdot x⃗\vec{x} )is efficiently handled. thus the equation becomes: fw⃗,b(x⃗(i))=w⃗⋅x⃗(i)+b f_{\vec{w},b}(\vec{x}^{(i)}) = \vec w\cdot \vec{x}^{(i)} + b And the cost function J(w,b)=12m∑i=0m−1(fw,b(x(i))−y(i))2J(w,b) = \frac{1}{2m} \sum\limits_{i = 0}^{m-1} (f_{w,b}(x^{(i)}) - y^{(i)})^2 would be changed to: J(w⃗,b)=12m∑i=0m−1(fw⃗,b(x⃗(i))−y(i))2 J(\vec{w},b) = \frac{1}{2m} \sum\limits_{i = 0}^{m-1} (f_{\vec{w},b}(\vec{x}^{(i)}) - y^{(i)})^2 For gradient descent and the derivatives: ...

January 25, 2025 · 6 min

Numpy and Tensors

this is a summary of my understanding of the optional lab on covered numpy, arrays, vectors and matrices. because we will be working with huge sets of data and we’ll be manipulating weights, properties and biases repeatedly, we need to do these operations efficiently. Thus, the numpy package can help as it has vectors and matrix properties, which are faster and less memory intensive compared to hardcoded calculations. to create both matrices and vectors the np.array syntax is typically used as such: ...

January 25, 2025 · 3 min

linear regression and gradient descent

This is a short summary of the first week of the machine learning course by Andrew Ng. First thing he covered was the difference between supervised and unsupervised learning, but I currently care about the former. supervised ml: Giving the computer a data set with sample answers of interest and telling it “find the correlation between the dataset and the answers of interest” or more simply, “learn how to get me the answers I care about given this dataset”. ...

January 20, 2025 · 6 min

ml start

i want to continue posting online regularly. hence this first post. i started learning ml with andrew ng’s ml specialization. notes: last week, i took a hpc course from uc boulder and took some notes. i am going to make a post about it. i learned qchem prints S0 -> SX transition energies at SX optimized geometry, so this is technically not adiabatic excitation energy. at the back of my mind, i am going “why would they do that instead of SX energy at SX optimized geometry - S0 energy at S0 optimized geometry?”, which is indeed what i typically need when doing calculations. apparently, S2 energy at S2 energy - S0 energy at S2 minimum is called the vertical emission energy, while, the adiabatic excitation energy (AEE) is instead the S2 energy at the S2 minimum - S0 energy at the S0 geometry and i didn’t know the difference. i learned a trick to color the files and folders differently in the terminal - ls --color. added this as an ls alias in my .bashrc and i like the view.

January 9, 2025 · 1 min