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 −

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