This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
typedef unsigned long long ull; | |
const int MAX_SIZE = 100000; | |
int data[MAX_SIZE]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pass by value | |
var y = 10; | |
function modify(x) | |
{ | |
x = 5; | |
} | |
modify(y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pass by reference | |
var arr = [1,2,3]; | |
function append(_arr) | |
{ | |
_arr.push(90); | |
} | |
append(arr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget http://www.cryptodatadownload.com/cdd/Gemini_ETHUSD_d.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:, :] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
OlderNewer