from sklearn.cluster import KMeans from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import GradientBoostingClassifier from sklearn.linear_model import LinearRegression import random %matplotlib inline random.seed(100) dataloader = Dataloader('Bike-Sharing-Dataset/hour.csv') train, val, test = dataloader.getData() fullData = dataloader.getFullData() category_features = ['season', 'holiday', 'mnth', 'hr', 'weekday', 'workingday', 'weathersit'] number_features = ['temp', 'atemp', 'hum', 'windspeed'] features= category_features + number_features target = ['cnt'] sns.set(font_scale=1.0) fig, axes = plt.subplots(nrows=3,ncols=2) fig.set_size_inches(15, 15) sns.boxplot(data=train,y="cnt",orient="v",ax=axes[0][0]) sns.boxplot(data=train,y="cnt",x="mnth",orient="v",ax=axes[0][1]) sns.boxplot(data=train,y="cnt",x="weathersit",orient="v",ax=axes[1][0]) sns.boxplot(data=train,y="cnt",x="workingday",orient="v",ax=axes[1][1]) sns.boxplot(data=train,y="cnt",x="hr",orient="v",ax=axes[2][0])
from dataloader import Dataloader from kalman import Kalman from nengo.processes import Piecewise dt = 0.02 # simulation time step t_rc = 0.01 # membrane RC time constant t_ref = 0.001 # refractory period tau = 0.009 # synapse time constant for standard first-order lowpass filter synapse N_A = 1000 # number of neurons in first population rate_A = 200, 400 # range of maximum firing rates for population A pool = 0 dataloader = Dataloader() kalman = Kalman() trainX, trainY, testX, testY = dataloader.getData() ChN = np.where(np.sum(trainX, axis=1) != 0) trainX = np.squeeze(trainX[ChN, :]) testX = np.squeeze(testX[ChN, :]) A_0, B_0 = kalman.calculate(trainX, trainY, pool=pool, dt=dt, tau=tau) # A_1, B_1 = kalman.calculate(trainX, trainY, pool=1, dt=dt, tau=tau) # kalman.Kalman_Filter(testX, testY) # kalman.standard_Kalman_Filter(testX, testY) #