29/12/25

At the beginning of our third week of development, we went further into our EDA and started making progress on our final web app using React.

A big part of week 3 was building our API to start scraping and connecting the backend to the frontend. We started with simple schemas for Driver and Vehicle as Pydantic models which mirror the same features that we will feed to our model in the future to make predictions. When first started building the Driver and Vehicle Pydantic models we added the core attributes we needed to collect in order to use it for our predictions.

We started replicating our original jinja template in react and laying the foundations for our finished application. We replicated the home page and forms page and on top of this we created simple designs for both pages using tailwind css as well as adding simple error checking for the forms page using javascript. This made it so certain fields will be highlighted red if entered with an invalid value.

Machine Learning

We started by applying feature engineering to some of the variables in our dataset in preparation for the machine learning processes in the future. This came in the form of removing the date_birth variable that was originally a date object into an age column that consists of integers calculated using the python datetime library. In the same way, we also changed the date_driving_lisence variable, that shows the date in which the person got their driving licence into a driving_experience column that shows how many years they have had their licence as an integer. The final feature we engineered was the “Type_fuel” variable that was originally either “P” for petrol or “D” for diesel. Since there are only 2 options we changed this to a simple binary value of 0 for diesel and 1 for petrol. These changes made it so all the variables in the dataset are now able to be understood when performing machine learning.

On top of this, after a meeting with our mentor we were advised to make a correlation matrix to help us in finding correlations between different features.

References

We used a mix of documentation and youtube tutorials to help us get familiar with using FastAPI as it is something neither of us have worked with before

https://fastapi.tiangolo.com/#sponsors

This video in particular was a huge help in understanding the fundementals.