WEBVTT

00:00.040 --> 00:01.120
Welcome back.

00:01.160 --> 00:09.680
We imported NumPy, pandas, and matplotlib libraries, and we used numpy and TensorFlow random seeds,

00:09.720 --> 00:12.560
setting them to 42.

00:12.760 --> 00:16.760
And here we are controlling the randomness from numpy.

00:16.760 --> 00:21.440
And here we are controlling randomness from TensorFlow.

00:21.480 --> 00:25.960
Now let's generate the same random data.

00:26.280 --> 00:40.920
So here random data size equals to two times NP dot random dot random from 101 plus one, and the price

00:40.920 --> 00:46.520
three times size plus two plus MP random times 0.5.

00:46.560 --> 00:54.040
This is what we've done in the previous notebooks, but don't worry, I'll clarify everything.

00:54.160 --> 00:56.040
Let me start with the size.

00:56.040 --> 01:05.480
At first we are generating 100 rows times one column array of random numbers between 0 and 1.

01:05.480 --> 01:08.480
So np.random.rand.

01:08.640 --> 01:16.830
Here we are generating one array that contains 100 rows With one colon.

01:16.830 --> 01:28.550
For example, this is the generated array 0.30.950.73, and so on multiplies all values by two.

01:28.590 --> 01:34.110
So this size times two all values will be multiplied by two.

01:34.150 --> 01:36.510
The range becomes from 0 to 2.

01:36.630 --> 01:38.150
It was 0 to 1.

01:38.190 --> 01:40.030
The range between 0 and 1.

01:40.230 --> 01:43.150
Now the range becomes 0 to 2.

01:43.430 --> 01:55.510
Then we added one to make the range becomes 1 to 3, representing 1000 to 3000ft² houses.

01:55.510 --> 02:04.150
So the size of houses would range from 1000 to 3000ft² houses.

02:04.190 --> 02:06.550
Now let's move to the prices.

02:06.550 --> 02:11.430
So here we are creating a true linear relationship.

02:11.430 --> 02:23.030
As we learned before in mathematics we have a linear equation y equals w x plus b w or a.

02:23.510 --> 02:30.780
We can replace it by a ax plus b or w x plus b a is the slope.

02:31.020 --> 02:36.580
X is the variable and b is the coefficient or the intercept.

02:36.620 --> 02:40.460
The slope a which here represents number three.

02:40.740 --> 02:42.300
The slope equals to three.

02:42.340 --> 02:50.300
For every 1000ft² increase, price increased by $3,000.

02:50.420 --> 02:52.500
Intercept equals to two.

02:52.540 --> 02:53.980
So B equals to two.

02:54.020 --> 03:04.940
Here base price of $2,000 and NP dot random dot random and 100 to 1.

03:04.980 --> 03:13.260
This generates random numbers from a standard normal distribution mean equal to zero and standard deviation

03:13.260 --> 03:14.140
equals to one.

03:14.180 --> 03:17.820
I'm not gonna make it, uh, complicated and complex.

03:17.820 --> 03:25.420
I just want from you to understand that here we are generating random numbers based on size and price.

03:25.420 --> 03:28.420
And the linear equation is based on the price.

03:28.420 --> 03:34.020
So y equals to three times x plus two plus MP random.

03:34.020 --> 03:36.580
And this is the coefficient b.

03:36.620 --> 03:38.940
Run the cell and here we go.

03:39.300 --> 03:42.140
We get the size and the price okay.
