Skip to content

Instantly share code, notes, and snippets.

@coreyauger
Created May 9, 2018 21:03
Show Gist options
  • Save coreyauger/cb09b13f4915ea4eeadb74a60f51c3c1 to your computer and use it in GitHub Desktop.
Save coreyauger/cb09b13f4915ea4eeadb74a60f51c3c1 to your computer and use it in GitHub Desktop.
Visualise label distribution
import numpy as np
import os
import dtdata as dt
from sklearn.neighbors import NearestNeighbors
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
plt.rcParams['interactive'] == True
# fix random seed for reproducibility
np.random.seed(90210)
subset = -1
path =r'/home/suroot/Documents/train/daytrader/ema-crossover' # path to data
data = dt.loadData(path, subset)
(data, labels) = dt.centerAroundEntry(data)
print("min: " + str(labels.min()) )
print("max: " + str(labels.max()) )
sns.distplot(labels)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment