Gradient Descent, Data Science, Data Visualization, Deep Learning, Machine Learning.
range(X_train.shape[0]): idx = np.random.randint(0,X_train.shape[0]) y_hat = np.dot(X_train[idx],self.coef_) + self.intercept_ intercept_der = -2 * (y_train[idx] - y_hat) self.intercept_ = self.intercept_ - (self.lr * intercept_der) coef_der = -2 * np.dot((y_train[idx] - y_hat),X_train[idx])