Sequences, Time Series and Prediction Course

Sequences, Time Series and Prediction Course
Week 4: Using real world data Exercise

I tried all my skills and combinations but I can’t reach MSE is under 6 and MAE is under 2. Is there any problem in these case?

Please click my name and message your notebook as an attachment.

Thank you but I solved the problem.

@sr00

Here’s one row of train data where the model accepts 1 feature per timestep as input and emits 1 numeric output feature.

tf.Tensor(
[311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321. 322. 323. 324.
 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335. 336. 337. 338.
 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349. 350. 351. 352.
 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363. 364. 365. 366.
 367. 368. 369. 370. 371. 372. 373. 374.], shape=(64,), dtype=float64)
tf.Tensor(375.0, shape=(), dtype=float64)

Your uncompiled_model takes 1 feature per timestep as input and emits 10 numeric values.
Please fix it keeping in mind that output shape should be (None, 1)

@Kamila_Myslinska

  1. The learning rate seems really low. Might want to pick an optimizer like adam for better performance out of the box.
  2. The output shape should be (None, 1)
    a. None = batch size
    b. 1 = output feature
  3. Pay attention to the batch size. Typical batch size is around 32
  4. Use tf.keras.callbacks.EarlyStopping to restore best weights after training.
  5. There are layers like Bidirectional, Dropout which can be used to improve performance.
  6. Choice of loss function matters. mae is a loss function to consider as well.
  7. When monitoring metrics, you might want to see both mae and mse since the grader requires good performance on both metrics.
  8. Use tf.random.set_seed before you kick off your experiment for reproducibility.

Solved! Thank you for hints and tips. Using Bidirectional, Dropout, and Adam has helped. Result - MAE - 1,84