Skip to content

Instantly share code, notes, and snippets.

View hhl60492's full-sized avatar

Haihan hhl60492

View GitHub Profile
# A simple Tensorflow 2 layer dense network example
import tensorflow as tf
from sklearn.gaussian_process import GaussianProcessClassifier
import numpy as np
from sklearn import datasets
from sklearn.preprocessing import MinMaxScaler
from sklearn.decomposition import PCA
from sklearn.preprocessing import LabelBinarizer
import matplotlib.pyplot as plt
# A simple Tensorflow 2 layer dense network example
import tensorflow as tf
import numpy as np
from sklearn import datasets
from sklearn.preprocessing import MinMaxScaler
from sklearn.decomposition import PCA
from sklearn.preprocessing import LabelBinarizer
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
require(extRemes)
# Sometimes R can be a bit tricky...
df <- read.csv('crimes_daily.csv')
# convert Date field in CSV to R date format
df$DATE <- as.Date(df$DATE)
# Get months
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
### Data Wrangling code adapted from https://www.kaggle.com/wosaku/eda-of-crime-in-vancouver-2003-2017
# import csv
df = pd.read_csv('crime.csv')
df.head()
import math
import requests
import json
import os
from .color_dicts import mpl_color_map, html_color_codes
def safe_iter(var):
try:
@hhl60492
hhl60492 / main.py
Last active February 4, 2018 07:58
import numpy as np
from sompy.sompy import SOMFactory
import pandas as pd
import glob
import os
# read in all csvs from folder
path = '..\\..\\data\\'
all_files = glob.glob(os.path.join(path, "*.csv"))
import numpy as np
import pandas as pd
import nolds
from fbm import FBM
import matplotlib.pyplot as plt
# number of time steps (days) to predict ahead
n = 30
# number of FBMs to realize
c = 1000
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# read in the csv
df = pd.read_csv("eth-cad-max.csv")
# get the prices col slice from df
prices = np.array(df['price'])
H = 0.55
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# read in the csv
df = pd.read_csv("eth-cad-max.csv")
# get the prices col slice from df
prices = np.array(df['price'])
foo = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.