human
Solve the following python programming problem given the following code:
# Libraries
import pandas as pd
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import svds

class svd_engine:
    def __init__(self, data_all, k = 6):
        """Constructor for svd_engine class
        
        Args:
            k: The number of latent variables to fit
        """
        self.k = k
        
        # Create copy of data
        self.data_all = data_all.copy()
        
        # Now build a list of movies each you has seen
        self.seen = []
        for user in data_all.user_id.unique():
            cur_seen = {}
            cur_seen["user"] = user
            cur_seen["seen"] = self.data_all[data_all.user_id == user].item_id
            self.seen.append(cur_seen)
            
        
    def fit(self, data_train):
        """Performs SVD on a sparse matrix data_train
        
        Args:
            data_train: A pandas data frame data to estimate SVD
            
        Returns:
            Matricies u, s, and vt of SVD
        """
        # Save local copy of data
        self.data_train = data_train.copy()
        
        # Compute adjusted matrix
        self.user_means = self.data_train.replace(0, np.nan).mean(axis = 1)
        self.item_means = self.data_train.T.replace(0, np.nan).mean(axis = 1)
        self.data_train_adj = (self.data_train.replace(0, np.nan).T - self.user_means).fillna(0).T
        
        # Save the indices and column names
        self.users = data_train.index
        self.items = data_train.columns
        
        # Train the model
        self.u, self.s, self.vt = svds(self.data_train_adj, k = self.k)
        
        return(self.u, np.diag(self.s), self.vt)
        
    def predict(self):
        """Predicts using SVD
        
        Returns:
            A pandas dataframe containing the prediction values
        """
        # Store prediction locally and turn to dataframe, adding the mean back
        self.pred = pd.DataFrame(self.u @ np.diag(self.s) @ self.vt,
                                 index = self.users,
            ...
Given the above code, generate some markdown instructions for it.
assistant
#Here is Python code to compute adjusted matrix
.

SVD
Above we used Cosine Similarity to fill the holes in our sparse matrix.  Another, and much more popular, method for matrix completion is called a Singluar Value Decomposition.  SVD factors our data matrix into three smaller matricies, given by $$\textbf{M} = \textbf{U} \bf{\Sigma} \textbf{V}^*$$ where $\textbf{M}$ is our data matrix, $\textbf{U}$ is a unitary matrix containg the latent variables in the user space, $\bf{\Sigma}$ is diagonal matrix containing the singular values of $\textbf{M}$, and $\textbf{V}$ is a unitary matrix containing the latent variables in the item space.  For more information on the SVD see the Wikipedia article.
Numpy contains a package to estimate the SVD of a sparse matrix.  By making estimates of the matricies $\textbf{U}$, $\bf{\Sigma}$, and $\textbf{V}$, and then by multiplying them together, we can reconstruct an estimate for the matrix $\textbf{M}$ with all the holes filled in.
Use these ideas to construct a class svd_engine which can be used to recommend movies for a given user.  Be sure to also test your algorithm, reporting its accuracy.  Bonus: Tune any parameters.