class LinearModel():
def __init__(self, features, target):
self.X = features
self.y = target
def GradDesc(self, parameters, learningRate, cost):
self.a = learningRate
self.c = cost
self.p = parameters
return self.a, self.Cost(self.c), self.p
def Cost(self,c):
if c =='RMSE':
return self.y
elif c == 'MSE':
return self.X
X=1
y=0
a = LinearModel(5,4)
print(a.GradDesc(2,0.01,'MSE'))
print(a.Cost('RMSE'))