Machine learning
Regression
🧩 What is it?
Regression is a type of algorithm in supervised Machine Learning used to predict continuous numeric values. Unlike classification, where the result is a category (for example: normal, critical, off), in regression the goal is to estimate a quantity, such as energy consumption, future temperature, or expected production.
The regression model learns from a historical data set in which both the input variables (for example: time of day, humidity, outdoor temperature) and the value to be predicted (for example: kilowatts consumed) are known. Once trained, the model can receive new data and predict the expected output value.
🔧 How it works
The regression model works by identifying a mathematical relationship between the input (predictor) variables and the output variable (target) that needs to be estimated. This relationship can be linear, as in the case where electrical consumption increases proportionally with outdoor temperature, or non-linear, if complex factors with combined effects are involved.
During the training process, the algorithm analyzes how the target variable behaves based on historical input values. For example, if it tries to predict the production of an assembly line, the model may learn that this production depends not only on the shift (morning/afternoon/night), but also on ambient humidity, operation time, and the presence of experienced operators.
Depending on the type of regression used, the model can:
Fit a straight line to the data (Linear Regression),
Apply penalties to avoid overfitting (Ridge Regression, Lasso),
Build more complex relationships using trees (Regression Trees, Boosting),
Or even capture subtle interactions using neural networks.
Once trained, the model can predict numeric values based on new input data.
🧠 When is it used?
Regression is ideal when the goal is to anticipate a number rather than a category. Some examples applied in industrial or monitoring environments with TOKII could be:
Predicting the energy consumption of a building based on environmental variables.
Estimating the expected temperature in an HVAC system.
Calculating the expected daily production of a manufacturing line.
Foreseeing the remaining lifespan of a component.
📦 Practical example: Prediction of electrical consumption
Suppose a building wants to anticipate the hourly electrical consumption. To do this, it has a historical data set that includes variables such as:
Outdoor temperature
Day of the week
Time of day
Estimated occupancy
Use of the HVAC system
With this data, a regression model is trained to learn how these variables relate to the actual recorded consumption (for example, in kWh).
During training, the model detects patterns like that consumption increases on Monday mornings with high occupancy and high temperatures, or that it decreases during cold nights. Based on that knowledge, it can predict the expected consumption under future conditions.
For example:
If tomorrow at 14:00 there are 28°C, it's a workday and high occupancy → the model can predict 42 kWh.
If on Sunday at 6:00 there are 18°C and low occupancy → it could predict 12 kWh.
These predictions can be used to adjust energy loads, optimize HVAC scheduling, or trigger alerts if consumption deviates from what is expected, all within the TOKII ecosystem.