Machine Learning, Optimization, Logistic Regression, Data Science, Convex Optimization.
Logistic Regression from Scratch Generate Dataset X and Y import numpy as np X = np.matrix(np.ones(2484)).T X = np.append(X,np.matrix([0]*1379+[2]*638+[4]*213+[5]*254).T,axis=1) Y = np.matrix([1]*24+[0]*1355+[1]*35+[0]*603+[1]*21+[0]*192+[1]*30+[0]*224).T Define f(β), ∇f(β), and ∇²f(β) def f(beta):