Skip to content

Instantly share code, notes, and snippets.

View mustafa-qamaruddin's full-sized avatar

Mustafa Qamar-ud-Din mustafa-qamaruddin

View GitHub Profile
function [] = mqPCA()
global LOW_RES_INPUT_TEST_IMAGE;
global VISUALS;
dbl_lowres = double(LOW_RES_INPUT_TEST_IMAGE);
width = size(LOW_RES_INPUT_TEST_IMAGE,1);
height = size(LOW_RES_INPUT_TEST_IMAGE,2);
rshp_lowres = reshape(LOW_RES_INPUT_TEST_IMAGE, width*height, 3);
%% figure, imshow(rshp_lowres);
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
typedef unsigned long long ull;
const int MAX_SIZE = 100000;
int data[MAX_SIZE];
// pass by value
var y = 10;
function modify(x)
{
x = 5;
}
modify(y);
// pass by reference
var arr = [1,2,3];
function append(_arr)
{
_arr.push(90);
}
append(arr);
// pass by value ; date
var d = new Date('July 13, 2016');
console.log(d.getTime());
function mutate(_d)
{
_d = new Date('August 20, 1989');
console.log(_d.getTime());
}
@mustafa-qamaruddin
mustafa-qamaruddin / util.py
Created May 7, 2018 07:49
Script to Choose Baby Name
import matplotlib.pyplot as plt
import numpy as np
ls_names = ["Omar", "Zainuddin", "Yahya", "Malek"]
scores = {"Omar": 0, "Zainuddin": 0, "Yahya": 0, "Malek": 0}
for j in range(10):
print("{}/10".format(j), end="\r")
$ wget http://www.cryptodatadownload.com/cdd/Gemini_ETHUSD_d.csv
df = pd.read_csv('./Gemini_ETHUSD_d.csv', skiprows=1)
for i in range(1, STEPS):
col_name = 'd{}'.format(i)
df[col_name] = df['d0'].shift(periods=-1 * i)
df = df.dropna()
X = df.iloc[:, :TRAIN_STEPS]
y = df.iloc[:, TRAIN_STEPS:]
X_train = X.iloc[:SPLIT_IDX, :]
y_train = y.iloc[:SPLIT_IDX, :]
X_test = X.iloc[SPLIT_IDX:, :]
y_test = y.iloc[SPLIT_IDX:, :]
def build_model(_alpha, _l1_ratio):
estimator = ElasticNet(
alpha=_alpha,
l1_ratio=_l1_ratio,
fit_intercept=True,
normalize=False,
precompute=False,
max_iter=16,
copy_X=True,
tol=0.1,