R2 metric dynamics for k-nearest neighbors regression model trained on series of different sizes

Loading...
Thumbnail Image

Journal Title

Journal ISSN

Volume Title

Publisher

Видавництво Львівської політехніки
Lviv Politechnic Publishing House

Abstract

R2 або коефіцієнт детермінації часто використовується як метрика для оцінювання регресійних моделей. Її можна застосовувати окремо, але зазвичай її поєднують з іншими метриками, щоб підвищити точність оцінки моделі. Метою роботи є дослідження динаміки метрики R2 регресійної моделі к-найближчих сусідів, навченої на серіях різного розміру, щоб запропонувати новий підхід для підвищення надійності та точності оцінки моделі, коли метрика R2 використовується самостійно, без застосування інших метрик. Як правило, значення метрики R2 понад 0,8 вважається прийнятним, а оцінювана модель достатньо точною. Однак такий спосіб інтерпретації оцінки R2 може призвести до невправильної оцінки точності моделі, що і показано в запропонованій статті. Отримані результати свідчать, що значення метрики R2 можуть істотно відрізнятися в деяких випадках залежно від конкретних значень ознак, відібраних до тестової частини вибірки, використовуваної для оцінювання моделі. Зазначене відхилення може спричиняти завищення точності моделі,а це – призвести до некоректних результатів її застосування. Відомі методи підвищення точності оцінювання моделі передбачають використання інших метрик додатково. Натомість ця стаття зосереджена на підвищенні оцінки точності моделі без необхідності використання інших метрик. Динаміку метрики R2 досліджено за допомогою 25000 циклів навчання та оцінки регресійної моделі к-найближчих сусідів. До навчальної та тестової частин вибірки відібрано випадкові значення. Для всіх експериментів кількість сусідів фіксована та дорівнює значенню за замовчуванням n_neighbors=5 методу Kneighbors Regressor, наданого бібліотекою Sklearn. У роботі сформульовано та підтверджено гіпотезу про те, що варіація метрики R2, як очікується, збільшиться зі зменшенням розміру серії, і передбачено, що варіація буде спостерігатися для моделей, навчених на тій самій вибірці, через випадковість відбирання навчальних / тестових значень. Експерименти дали змогу запропонувати альтернативний підхід, який не потребує додаткових метрик. Цей підхід передбачає застосування метрики R2 разом із її варіацією, яка не повинна перевищувати 0,2 для регресійної моделі к-найближчих сусідів.
An R2 score or a coefficient of determination is used often as a metric to evaluate regression models. It can be applied solely but usually it is combined with other metrics in order to increase accuracy of a model evaluation. The goal of the work is to research the dynamics of the R2 score of a K-Nearest Neighbors regression model trained on series of different sizes in order to propose a new approach to increase the robustness and accuracy of the model evaluation when the R2 score metric is used solely. Typically, a value of the R2 score metric above 0.8 is considered to be sufficient while an evaluated model is considered to be accurate enough. However, such a way of R2 score interpretation to may lead to model’s accuracy misevaluation, which is shown in the proposed paper. The results obtained clearly display that R2 score can vary significantly in some cases depending on the samples selected to test part of a series used for model evaluation. The mentioned variation can contribute to model’s accuracy overestimation, which, in turn can lead to incorrect results of model application. The known methods to make model estimation more accurate involve use of other metrics. Instead, this paper focuses on increase of model’s accuracy estimation without the necessity of using other metrics. The R2 score dynamics is examined using 25000 cycles of the K-Nearest Neighbors regression model training and evaluation. Selection of samples to a training or test part of a series has been done randomly. For all the experiments quantity of neighbors is fixed and equals to the default value of n_neighbors=5 of the KNeighborsRegressor method provided by the Sklearn library. The paper both states and proves a hypothesis that the R2 score variation is expected to increase with series size reduction and the variation is supposed to be observed for models trained on the same series because of training/test samples selection randomness. The experiments carried out allowed to propose an alternative approach that did not require any supplementary metrics. The proposed approach considers application of the R2 score along with its variation that must not exceed 0.2 for the K-Nearest Neighbors regression model.

Description

Citation

R2 metric dynamics for k-nearest neighbors regression model trained on series of different sizes / Y. Babich, L. Hlazunova, T. Kalinina, Y. Petrovych // Infocommunication technologies and electronic engineering. — Lviv : Lviv Politechnic Publishing House, 2024. — Vol 4. — No 2. — P. 10–18.

Endorsement

Review

Supplemented By

Referenced By