Skip to content

Instantly share code, notes, and snippets.

View saas-coder's full-sized avatar

Ninja saas-coder

  • Entrepreneur
  • Morocco
  • 05:22 (UTC -12:00)
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saas-coder
saas-coder / nasa.ipynb
Last active January 15, 2021 20:45
Nasa.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saas-coder
saas-coder / audit-data-notebook.ipynb
Last active January 2, 2021 12:43
Audit Data Notebook.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saas-coder
saas-coder / QuasiNewton.hpp
Created December 15, 2020 14:44
Quasi Newton : BFGS and BROYDEN and DFP and SR1 for regression
void quasinewton(const mat& X,
const mat& y,
mat& parameters,
double computeCost(const mat& X, const mat& y, const mat& parameters), // LeastSquaesCost or logisticCost
vec computeGradient(const mat& X, const mat& y, const mat& parameters), // LeastSquaesGradient or logisticGradient
mat computeHessian(const mat& X, const mat& y, const mat& parameters), // logisticHessian or
string method = "BFGS", // BFGS or BROYDEN or DFP or SR1
string costs_file = "costs.out",
string parameters_file = "parameters.out",
string step = "armijo", // double as string like "0.01" by default armijo rule
@saas-coder
saas-coder / GradientDescent.hpp
Last active December 13, 2020 14:14
Implementing Gradient Descent for linear and logistic regression
#include <armadillo>
#include <bits/stdc++.h>
#include <conio.h>
using namespace std;
double LeastSquaesCost(const mat& X, const mat& y, const mat& parameters)
{
vec tmp(X * parameters - y);
tmp = dot(tmp, tmp);
double s = sum(tmp);