## R-squared (Coefficient of determination) ##
*(source: https://www.kaggle.com/code/marcinrutecki/regression-models-evaluation-metrics/notebook)*
1. **SST** (or TSS)

The Sum of Squares Total/Total Sum of Squares (SST or TSS) is the squared differences between the observed dependent variable and its mean.

2. **SSR** (or RSS)

Sum of Squares Regression (SSR or RSS) is the sum of the differences between the predicted value and the mean of the dependent variable.

3. **SSE** (or ESS)

Sum of Squares Error (SSE or ESS) is the difference between the observed value and the predicted value.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1913983%2Fbf229b1513468b0b4c37abc23bfe0f2a%2Fr2.png?generation=1698271669273656&alt=media)
The coefficient of determination or R-squared represents the proportion of the variance in the dependent variable which is explained by the linear regression model. When R² is high, it represents that the regression can capture much of variation in observed dependent variables. That’s why we can say the regression model performs well when R² is high.

$$R^2 = 1- \frac {SSR}{SST}$$

It is a scale-free score i.e. irrespective of the values being small or large, the value of R square will be less than one. One misconception about regression analysis is that a low R-squared value is always a bad thing. For example, some data sets or fields of study have an inherently greater amount of unexplained variation. In this case, R-squared values are naturally going to be lower. Investigators can make useful conclusions about the data even with a low R-squared value.

$$R^2=1$$ All the variation in the y values is accounted for by the x values.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1913983%2Fe45047a6eafd139015d20b13989cada0%2Fr_1.jfif?generation=1698271692751848&alt=media)

$$R^2=0.83$$
83 % of the variation in the y values is accounted for by the x values.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1913983%2F47fbbc255c27ab1f9e0588e42198b651%2Fr_08.jfif?generation=1698271718231135&alt=media)

$$R^2=0$$ None of the variation in the y values is accounted for by the x values.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1913983%2F10902e30c469f648ddc7e7f1a0b8d4c8%2Fr_0.jfif?generation=1698271732256478&alt=media)

## Файл с решением (Submission File)
Для каждой переменной "Date" в тестовом наборе данных (test.csv), Вы должны предсказать значение переменной "ST" . Файл с решением должен содержать заголовок и иметь следующий формат:

    Date,ST
    2021-09-30T21:00:00Z,122836.734924242
    2021-09-30T22:00:00Z,119301.41239899
    2021-09-30T23:00:00Z,120068.918679714
    2021-10-01T00:00:00Z,119034.844772727
    2021-10-01T01:00:00Z,119301.41239899
    и т.д.

Пример файла с решением Вы можете найти в разделе "Data", файл "sample.csv"