Tensorflow Linear Regression
In this part, we will zero in on the fundamental illustration of straight relapse execution utilizing TensorFlow. Strategic relapse or direct relapse is an administered AI approach for the arrangement of request discrete classes. Our objective in this section is to fabricate a model by which a client can foresee the connection between indicator factors and at least one autonomous factors.
The connection between these two factors is cons −idered direct. Assuming that y is the reliant variable and x is considered as the free factor, then the straight relapse relationship of two factors will seem to be the accompanying condition −
Y = Ax+b
We will plan a calculation for direct relapse. This will permit us to grasp the accompanying two significant ideas −
Cost Function
Gradient descent algorithms
The schematic portrayal of direct relapse is referenced beneath −
The complete code for logistic regression is as follows −
import numpy as np
import matplotlib.pyplot as plt
number_of_points = 500
x_point = []
y_point = []
a = 0.22
b = 0.78
for i in range(number_of_points>
:
x = np.random.normal(0.0,0.5>
y = a*x + b +np.random.normal(0.0,0.1>
x_point.append([x]>
y_point.append([y]>
plt.plot(x_point,y_point, 'o', label = 'Input Data'>
plt.legend(>
plt.show(>
TensorFlow.js models here