In the so-called society 4.0, Artificial Intelligence (AI) is being widely used in many areas of life. Machine learning uses mathematical algorithms based on "training data", which are able to make predictions or take decisions with the ability to change their behavior through a self-training approach. Furthermore, thanks to AI, a large volume of data can be now processed with the overall goal to extract patterns and transform the information into a comprehensible structure for further utilization, which manually done by humans would easily take several years. In this framework, this article explores the potential of AI and machine learning to empower flipped classroom with just-in-time teaching (JiTT). JiTT is a pedagogical method that can be easily combined with the reverse teaching. It allows professors to receive feedback from students before class, so they may be able to adapt the lesson flow, as well as preparing strategies and activities focused on the student deficiencies. This research explores the application of AI in high education as a tool to analyze the key variables involved in the learning process of students and to integrate JiTT within the flipped classroom. Finally, a case of application of this methodology is presented, applied to the course of Industrial Refrigeration taught at the Polytechnic University of Valencia.