fmpr / deepjmqr Goto Github PK
View Code? Open in Web Editor NEWDeep joint mean and quantile regression for spatio-temporal problems
License: GNU General Public License v3.0
Deep joint mean and quantile regression for spatio-temporal problems
License: GNU General Public License v3.0
Hi professor,
I have used this method to compute the 'removed_trend' and 'removed_std', but the result was not same as you. Can you tell me your method.
my method:
df['mean'] =( df.groupby(['day_of_week','hour','minute'])['pickups'].transform('mean'))
My email: [email protected]
Hi, Professor, when i read your paper, i have an idea that is to add weather(eg precipitation) into the model, then I have done something to the DeepJMQR model as following:
weather_feats = weather['precipitation'].values[:,np.newaxis]
weather_feats[:-NUM_LAGS,:] = weather_feats[NUM_LAGS:,:]
weather_feats_train = weather_feats[:i_train,:]
weather_feats_val = weather_feats[i_train:i_val,:]
weather_feats_test = weather_feats[i_val:i_test,:]
#深度学习模型for mean
def tilted_loss(q,y,f):
e = (y-f)
# The term inside k.mean is a one line simplification of the first equation
return K.mean(q*e + K.clip(-e, K.epsilon(), np.inf), axis=-1)
def build_model(loss="mse", num_outputs=1):
model = Sequential()
model.add(ConvLSTM2D(filters=100, kernel_size=(3, 3),
input_shape=(None, nx, ny, 1),
padding='same', return_sequences=False))
model.add(BatchNormalization())
model.add(Dropout(0.75))
model.add(Dense(units=num_outputs,
kernel_regularizer=regularizers.l2(0.0001),
))
model.add(Activation("linear"))
model.compile(loss=loss, optimizer='nadam')
return model
print ("\nTraining NN for mean...")
checkpoint = ModelCheckpoint("weights_mean.best.hdf5", monitor='val_loss', verbose=1, save_best_only=True, mode='min')
model_mean = build_model(loss="mse", num_outputs=1)
model_mean.summary()
model_mean.fit(
[X_train[:,:,:,:,np.newaxis],weather_feats_train[:,:]],
y_train[:,:,:,np.newaxis],
batch_size=128,
epochs=N_EPOCHS, #100
validation_data=([X_val[:,:,:,:,np.newaxis],weather_feats_val[:,:]],y_val[:,:,:,np.newaxis]),
callbacks=[checkpoint],
verbose=0)
But there is a error:ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 2 arrays
I have tried to solve this problem, but failed. Could you give me a good idea?
Thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.