Does the RMSE formula have a $k$ in the denominator? In what circumstances does the RMSE formula have a $k$ in the denominator?
StackOverflow's What does RMS stand for? shows this formula for RMSE:
$$RMSE=\sqrt{\frac1{n-k}\sum_i(y_i-\hat{y}_i)^2}$$
But most other sources don't have the "k"  For example, https://www.statisticshowto.datasciencecentral.com/rmse/ or http://statweb.stanford.edu/~susan/courses/s60/split/node60.html
$$RMSE=\sqrt{\frac{\sum_{i=1}^n(\hat{y}_i-y_i)^2}{n}}$$
 A: Look at wikipedia, since it's a sample and not population, you need to subtract number of variables being estimated (including constant) to remove the bias. As whuber noted, most of the time number of variables being estimated is small as compared to n, and hence some implementations might be ignoring it.
A: This may be confusing, as two different definitions are used depending on the context. In statistics, in the context of regression modelling we use $n-k$ in denominator. This is discussed in Wikipedia:

In regression analysis, the term mean squared error is sometimes used
  to refer to the unbiased estimate of error variance: the residual sum
  of squares divided by the number of degrees of freedom . . .

On another hand, in machine learning by RMSE people usually mean square root of averaged squared errors (i.e. $n$ in denominator). This is how it is implemented in every major machine learning software including scikit-learn, TensorFlow & others.
A: I just want to elaborate a bit on the answer that behold gave. 
The $k$ parameter is typically used when you have limited observations, relative to the number of parameters used. As $n \rightarrow \infty$, then $k$ becomes negligible and the increase in magnitude in your error due to parameterisation becomes negligible.
In simple terms, you're "acknowledging" that you have a limited amount of data and you've used extensive parameterisation to describe your model.
Since it's really not difficult to implement the $k$ parameter, I'd say that you should always use it.
