{"id":9618,"date":"2025-07-10T10:47:46","date_gmt":"2025-07-10T08:47:46","guid":{"rendered":"https:\/\/www.kubicek.ai\/?post_type=lexicon&#038;p=9618"},"modified":"2026-07-27T13:53:35","modified_gmt":"2026-07-27T11:53:35","slug":"regression","status":"publish","type":"lexicon","link":"https:\/\/www.kubicek.ai\/en\/lexicon\/regression\/","title":{"rendered":"Regression"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Regression<\/strong> is a fundamental task of machine learning and statistics whose goal is to model the relationship between variables and predict a continuous numerical value. Unlike classification, which assigns data to a category (&#8220;spam&#8221; or &#8220;not spam&#8221;), regression tries to answer the question &#8220;how much?&#8221; or &#8220;what will the value be?&#8221;.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How regression works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine wanting to predict the price of a house. You have data on houses sold containing their floor area (the input variable, or feature) and the sale price (the target value). Plot this data on a chart and you will probably see a trend \u2013 that price rises with floor area, for instance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The goal of regression is to find a mathematical function describing that trend as accurately as possible. In the simplest case we try to fit a straight line through the data (the line of best fit) that comes as close as possible to all the data points. Once we have that line (the model), we can use it to estimate the price of a new house for which we know only the floor area. We simply find the point on the line corresponding to that area, and its value on the vertical axis is our prediction.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Types of regression model<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are many types of regression, differing in the complexity of the relationship they can model.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Linear regression<\/strong>: the most basic type, assuming the relationship between the variables is linear (describable by a straight line). <em>Simple linear regression<\/em> works with a single input variable (house price as a function of floor area). <em>Multiple linear regression<\/em> uses several input variables at once (house price as a function of area, age and distance from the centre).<\/li>\n\n\n\n<li><strong>Polynomial regression<\/strong>: used when the relationship between variables is not a straight line but a curve. It allows more complex, non-linear trends in the data to be modelled. Example: the relationship between the amount of fertiliser and crop yield, which rises at first but may start to fall beyond a certain point.<\/li>\n\n\n\n<li><strong>Other advanced models<\/strong>: for very complex relationships, further algorithms are used, such as decision trees, random forests or neural networks adapted for regression tasks.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How regression performance is assessed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With regression we cannot simply say whether an answer is &#8220;right&#8221; or &#8220;wrong&#8221; as we can with classification. Instead we measure how close the prediction is to the actual value. Evaluation metrics serve this purpose:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Mean absolute error (MAE)<\/strong>: the average absolute deviation between predicted and actual values. It tells us by how much the model is wrong on average.<\/li>\n\n\n\n<li><strong>Mean squared error (MSE)<\/strong>: similar to MAE, but it squares the deviations before averaging. It therefore &#8220;punishes&#8221; large errors more and is more sensitive to outliers.<\/li>\n\n\n\n<li><strong>Coefficient of determination (R-squared, R\u00b2)<\/strong>: states what proportion of the variability in the data the model can explain. A value close to 1 means the model describes the data very well, while a value close to 0 indicates that it explains the data hardly at all.<\/li>\n<\/ul>\n","protected":false},"featured_media":0,"template":"","class_list":["post-9618","lexicon","type-lexicon","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kubicek.ai\/en\/wp-json\/wp\/v2\/lexicon\/9618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kubicek.ai\/en\/wp-json\/wp\/v2\/lexicon"}],"about":[{"href":"https:\/\/www.kubicek.ai\/en\/wp-json\/wp\/v2\/types\/lexicon"}],"wp:attachment":[{"href":"https:\/\/www.kubicek.ai\/en\/wp-json\/wp\/v2\/media?parent=9618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}