<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Minimum-length least squares
This notebook shows how to solve a minimum-length least squares problem, which finds a minimum-length vector $x \in \mathbf{R}^n$ achieving small mean-square error (MSE) for a particular least squares problem
Step1:  The below cell constructs the problem data.
Step2:  And the next cell constructs and solves the QCP.
<ASSISTANT_TASK:>
Python Code:
!pip install --upgrade cvxpy
import cvxpy as cp
import numpy as np
Explanation: Minimum-length least squares
This notebook shows how to solve a minimum-length least squares problem, which finds a minimum-length vector $x \in \mathbf{R}^n$ achieving small mean-square error (MSE) for a particular least squares problem:
\begin{equation}
\begin{array}{ll}
\mbox{minimize} & \mathrm{len}(x) \
\mbox{subject to} & \frac{1}{n}\|Ax - b\|_2^2 \leq \epsilon,
\end{array}
\end{equation}
where the variable is $x$ and the problem data are $n$, $A$, $b$, and $\epsilon$.
This is a quasiconvex program (QCP). It can be specified using disciplined quasiconvex programming (DQCP), and it can therefore be solved using CVXPY.
End of explanation
n = 10
np.random.seed(1)
A = np.random.randn(n, n)
x_star = np.random.randn(n)
b = A @ x_star
epsilon = 1e-2
Explanation: The below cell constructs the problem data.
End of explanation
x = cp.Variable(n)
mse = cp.sum_squares(A @ x - b)/n
problem = cp.Problem(cp.Minimize(cp.length(x)), [mse <= epsilon])
print("Is problem DQCP?: ", problem.is_dqcp())
problem.solve(qcp=True)
print("Found a solution, with length: ", problem.value)
print("MSE: ", mse.value)
print("x: ", x.value)
print("x_star: ", x_star)
Explanation: And the next cell constructs and solves the QCP.
End of explanation
<END_TASK>