This document provides an overview of the forecasting process using the Random Forest algorithm. The dataset used for this analysis comprises 1100 entries, collected over a period of 2 weeks, between 8.00 and 20.00.
The Random Forest algorithm was implemented having a fixed number of estimators (decision trees). In order to start with the forecasting, we need to connect to the MongoDB database, specifically to the collection Bike_Count, which stores the processed information from the pictures taken of the rack (timestamp, busy_slots and free_slots).

Up to the 2/05/2023, there are around 2600 documents in the Bike Count collection.
The objective of the forecasting is to predict three exact moments after the last document in the Bike Count collection, this document, in essence, is the last known state of the rack, thus, is our most recent real source of information.
The predictions, with respect to the last document, are going to be performed by these times:
last timestamp + 30 minutes
last timestamp + 60 minutes
last timestamp + 90 minutes
Actually, by inspecting the information present in the Bike Count collection, it was discovered that the average time in which a change in the state of the rack, e.g. a difference in the number of bikes between documents, is about 3 hours and 15 minutes. Considering only changes in the same day.
The decision of predicting 2 hours is entirely based on the team's intuition, following the idea of what a regular student would find useful if he or she is planning to use a bike to arrive at the university’s campus. Even though longer prediction periods were considered in the past (around 10 hours and such), they were dismissed based on the previous premise, since they may be useless and a shorter period would benefit the behavior of the algorithm, explained later in this document.
As explained before, the data is retrieved from the bike count collection. After this, there is a stage of data processing in which the features selected for the training of the random forest are created or taken from the data of the original collection (bike count).
Unprocessed data: