Numerical aspects are of central importance in identification and control. Many computations in these fields involve approximations using polynomial or rational functions that are obtained using orthogonal or oblique projections. The aim of this paper is to develop a new and general theoretical framework to solve a large class of relevant problems. The proposed method is built on the introduction of bi-orthonormal polynomials with respect to a data-dependent bi-linear form. This bi-linear form generalises the conventional inner product and allows for asymmetric and indefinite problems. The proposed approach is shown to lead to optimal numerical conditioning (κ = 1) in a recent frequency-domain instrumental variable system identification algorithm. In comparison, it is shown that these recent algorithms exhibit extremely poor numerical properties when solved using traditional approaches.