Anonymous Anonymous - 1 year ago
473 0

No description


LR Q3 p1

def __init__(self, X, y):
        """ Initialize the linear regression model by computing the estimate of the weights parameter
                X (array-like) : feature matrix of training data where each row corresponds to an example
                y (array like) : vector of training data outputs 
        self.beta = la.cho_solve(la.cho_factor(np.add(, np.identity(X.shape[1])*(10**-4))),,y))
        #you have to do this in one line otherwise youg et memory errors
    def predict(self, X_p): 
        """ Predict the output of X_p using this linear model. 
                X_p (array_like) feature matrix of predictive data where each row corresponds to an example
                (array_like) vector of predicted outputs for the X_p
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download