# A Predictive Analytics Infrastructure to Support a Trustworthy Early Warning System
## 4 The Predictive Analytics Infrastructure and the Early Warning System
### The Predictive Analytics Infrastructure
#### 4.1.3 UOC Predictive Analytics Infrastructure  
This section describes the development of the infrastructure for UOC on the basis of the previous four-tier architecture. The infrastructure with the internal microservices is depicted in Figure 2. The client tier is the only access point to the system by accessing the public web service. This service is responsible for visualizing the information to the users, and there is a view for each role. Currently, five roles are available:  
* The learner can see the warning level of failing a course, and they have access to personalized recommendations. * The instructor teacher guides and monitors the learner's learning process throughout a specific online classroom in a course. They can also send recommendations and see the assigned warning levels in their classroom. * The coordinating teacher designs the course and is ultimately responsible for guaranteeing that the learners receive the highest quality teaching. They can configure the system for the course, manage recommendations, and have a full view of the learners' progress. * The administrator manages the whole system. They can configure available models for courses and can access the logs and monitoring tools of the system. * The developer manages the low-level details of the infrastructure. They can run specific operations on the DI tier, schedule tasks, check models, and access the logging information of the system. Additionally, Traefik [71] is used as a reverse proxy to create a namespace for the web client. Moreover, Traefik can be used as a load balancer when high traffic demand is expected by running multiple containers for the web service. The DD tier is responsible for forwarding all operational requests related to gathering the data from the university SIS and serving data on the public web service. Currently, the tier has embedded three services. The loader service gathers the data from the university SIS on the basis of the specification file that describes the view to be created (a complete description of the custom query language can be found in Section 4.1.4). Such a view is created through Pentaho Data Integration jobs [72] by reading the data from the UOC data mart and storing the view as a collection on a MongoDB instance. Note that the service also performs a validation step for cleaning inconsistent and incomplete data because such validation is not currently performed on the UOC data mart and it highly affects the models' accuracy. The DD tier also provides a service to run statistical analysis operations with R language [73] and a service to send messages to learners. Although the R service is not crucial for learners and teachers, it is a valuable resource to perform statistical analysis for administrators and developers. Currently, R-based scripts are hardcoded in the system, but it is expected to run specific scripts from the web client in the future. As we will explain in Section 4.2, the EWS provides a warning level to learners on the basis of the likelihood of failing the course and an intervention mechanism to help the learners succeed in the course. This intervention mechanism is crucial to effectively provide learners explanations, information, and recommendations about passing the course. The intervention mechanism is implemented as a recommender service that sends messages to learners using GMAIL API (the institution has G Suite support). The sending process can be performed manually by the teacher or automatically by the system using the teachers' email account. This decision design aims to increase the message's effectiveness since a learner will take into more consideration a message received from her teacher than a message received from a generic email account. Note that the teacher must grant access rights to the recommender service to use her email account. We can observe that the DD tier has only an endpoint to access data, and it is controlled by a Restful API [74].