Suppose $m$ data points belonging to a class represented by matrix $A$. Therefore, the size of matrix $A$ is $m\times n$. In addition, suppose $w\cdot x + b=0$ be equation of a plane in $\mathbb{R}^n$.
The aim is to find the closest plane to set of these points.
Is this equivalent to following problem? $$\min_{w,b} \frac{\Vert Aw+eb\Vert^2}{\left\Vert \begin{bmatrix}w \\b\end{bmatrix}\right\Vert^2}$$ where $e$ is a vector of ones.
Hint: In 3-D coordinate system, the distance between a given point $(x_0, y_0, z_0)$ & the plane: $ax+by+cz+d=0$ $$=\frac{|ax_0+by_0+cz_0+d|}{\sqrt{a^2+b^2+c^2}}$$