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 EEGNet(nb_classes, Chans = 64, Samples = 128, | |
dropoutRate = 0.5, kernLength = 64, F1 = 8, | |
D = 2, F2 = 16, norm_rate = 0.25, dropoutType = 'Dropout'): | |
""" Keras Implementation of EEGNet | |
http://iopscience.iop.org/article/10.1088/1741-2552/aace8c/meta | |
Inputs: | |
nb_classes : int, number of classes to classify | |
Chans, Samples : number of channels and time points in the EEG data |
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 pylab as plt | |
import numpy as np | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import keras | |
from keras.models import Sequential, Model | |
from keras.layers import Dense | |
from keras.optimizers import Adam |
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
# https://github.com/alik604/Notebooks/blob/master/Data%20Science-Datasets/MNIST/Where_to_add_GaussianNoise_MNIST_.ipynb | |
# data - MNIST | |
# note - test_size=0.98... ya... | |
model = Sequential() | |
model.add(Conv2D(filters=100, kernel_size=3)) # remove relu | |
# model.add(GaussianNoise(0.5)) # sandwich between | |
# GaussianNoise(0.5) here - accuracy: 0.9829 - val_loss: 0.4050 - val_accuracy: 0.9024 | |
model.add(Activation('relu')) # add relu | |
# GaussianNoise(0.5) here - accuracy: 0.9900 - val_loss: 1.4703 - val_accuracy: 0.8073 | |
model.add(MaxPooling2D(pool_size=(2, 2))) |
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
# @credit - kaggle.com/hanzh0420/image-augmentation-with-opencv | |
import os | |
print(os.listdir("../input")) | |
# Input data files are available in the "../input/" directory. | |
# Any results you write to the current directory are saved as output. | |
import numpy as np | |
#import pandas as pd # pd.read_csv | |
import cv2 | |
import random |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
%%capture | |
!pip install scikit-plot | |
!pip install catboost | |
!pip install mlxtend | |
!pip install yfinance | |
!pip install pyod | |
import pyod | |
import yfinance | |
import xgboost # xgboost.readthedocs.io/en/latest/python/python_api.html#xgboost.XGBClassifier |
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 urllib.parse as parse | |
url = "" | |
if 'url' not in globals(): | |
print("Enter URL to parse") | |
url = input() | |
def printDict(data): | |
for x in data: |
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
!pip install mnist | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from sklearn import metrics | |
import mnist | |
# from hmmlearn.hmm import GaussianHMM, MultinomialHMM | |
X_train = mnist.train_images() |
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
# make dataset to input | |
def build_dataset(time_series, seq_length): | |
dataX = [] | |
dataY = [] | |
for i in range(0, len(time_series) - seq_length): | |
_x = time_series[i:i + seq_length, :] | |
_y = time_series[i + seq_length, [-1]] # Next close price | |
print(_x, "->", _y) | |
dataX.append(_x) | |
dataY.append(_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
import numpy as np | |
import pylab as pl | |
from numpy import fft | |
def fourierExtrapolation(x, n_predict): | |
n = x.size | |
n_harm = 10 # number of harmonics in model | |
t = np.arange(0, n) | |
p = np.polyfit(t, x, 1) # find linear trend in x |
OlderNewer