From f5faa2ef095f035110f83e17da0b35d3a34d6b97 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sat, 17 Feb 2024 19:52:53 -0700 Subject: bump --- docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index 1f3cfbc..7057815 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -26,7 +26,7 @@ - + @@ -35,6 +35,7 @@ home | about/links | posts | +3D designs | RSS Feed | -- cgit v1.2.3 From f6d2141a480dd6b5b8ee0e48d43bb64773232791 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 26 Mar 2024 23:38:14 -0600 Subject: add header ids --- ...019-12-16-TensorFlow-Polynomial-Regression.html | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index 7057815..e432792 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -6,13 +6,13 @@ - Polynomial Regression Using TensorFlow + id="polynomial-regression-using-tensorflow">Polynomial Regression Using TensorFlow - - + Polynomial Regression Using TensorFlow" /> + Polynomial Regression Using TensorFlow" /> @@ -44,7 +44,7 @@
-

Polynomial Regression Using TensorFlow

+

Polynomial Regression Using TensorFlow

In this tutorial you will learn about polynomial regression and how you can implement it in Tensorflow.

@@ -58,19 +58,19 @@
  • Quintic
  • -

    Regression

    +

    Regression

    -

    What is Regression?

    +

    What is Regression?

    Regression is a statistical measurement that is used to try to determine the relationship between a dependent variable (often denoted by Y), and series of varying variables (called independent variables, often denoted by X ).

    -

    What is Polynomial Regression

    +

    What is Polynomial Regression

    This is a form of Regression Analysis where the relationship between Y and X is denoted as the nth degree/power of X. Polynomial regression even fits a non-linear relationship (e.g when the points don't form a straight line).

    -

    Imports

    +

    Imports

    import tensorflow.compat.v1 as tf
    @@ -81,9 +81,9 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d
     
    -

    Dataset

    +

    Dataset

    -

    Creating Random Data

    +

    Creating Random Data

    Even though in this tutorial we will use a Position Vs Salary dataset, it is important to know how to create synthetic data

    @@ -105,7 +105,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d -

    Position vs Salary Dataset

    +

    Position vs Salary Dataset

    We will be using https://drive.google.com/file/d/1tNL4jxZEfpaP4oflfSn6pIHJX7Pachm9/view (Salary vs Position Dataset)

    @@ -160,7 +160,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d

    -

    Defining Stuff

    +

    Defining Stuff

    X = tf.placeholder("float")
    @@ -168,7 +168,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d
     
    -

    Defining Variables

    +

    Defining Variables

    We first define all the coefficients and constant as tensorflow variables having a random initial value

    @@ -182,7 +182,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d -

    Model Configuration

    +

    Model Configuration

    learning_rate = 0.2
    @@ -190,7 +190,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d
     
    -

    Equations

    +

    Equations

    deg1 = a*X + b
    @@ -201,7 +201,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d
     
    -

    Cost Function

    +

    Cost Function

    We use the Mean Squared Error Function

    @@ -214,7 +214,7 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d -

    Optimizer

    +

    Optimizer

    We use the AdamOptimizer for the polynomial functions and GradientDescentOptimizer for the linear function

    @@ -232,12 +232,12 @@ Polynomial regression even fits a non-linear relationship (e.g when the points d -

    Model Predictions

    +

    Model Predictions

    For each type of equation first we make the model predict the values of the coefficient(s) and constant, once we get these values we use it to predict the Y values using the X values. We then plot it to compare the actual data and predicted line.

    -

    Linear Equation

    +

    Linear Equation

    with tf.Session() as sess:
    @@ -301,7 +301,7 @@ values using the X values. We then plot it to compare the actual data and predic
     
     

    -

    Quadratic Equation

    +

    Quadratic Equation

    with tf.Session() as sess:
    @@ -366,7 +366,7 @@ values using the X values. We then plot it to compare the actual data and predic
     
     

    -

    Cubic

    +

    Cubic

    with tf.Session() as sess:
    @@ -432,7 +432,7 @@ values using the X values. We then plot it to compare the actual data and predic
     
     

    -

    Quartic

    +

    Quartic

    with tf.Session() as sess:
    @@ -499,7 +499,7 @@ values using the X values. We then plot it to compare the actual data and predic
     
     

    -

    Quintic

    +

    Quintic

    with tf.Session() as sess:
    @@ -565,13 +565,13 @@ values using the X values. We then plot it to compare the actual data and predic
     
     

    -

    Results and Conclusion

    +

    Results and Conclusion

    You just learnt Polynomial Regression using TensorFlow!

    -

    Notes

    +

    Notes

    -

    Overfitting

    +

    Overfitting

    -- cgit v1.2.3 From 9e620084e57378952c1a7f8e0a772ebebd18932b Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 20:35:09 -0600 Subject: quick fix --- docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index e432792..3f3a399 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -6,13 +6,13 @@ - id="polynomial-regression-using-tensorflow">Polynomial Regression Using TensorFlow + Polynomial Regression Using TensorFlow - Polynomial Regression Using TensorFlow" /> - Polynomial Regression Using TensorFlow" /> + + -- cgit v1.2.3 From 01ff93c9c16867216f2d249664803860e1d6d5eb Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 22:49:40 -0600 Subject: generate new theme --- ...019-12-16-TensorFlow-Polynomial-Regression.html | 55 +++++++++++++++------- 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index 3f3a399..ecb1920 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -2,14 +2,26 @@ - + + + + + Polynomial Regression Using TensorFlow + + + + + + + - Polynomial Regression Using TensorFlow - @@ -29,21 +41,27 @@ - -
    -
    + + +
    -
    - +

    Polynomial Regression Using TensorFlow

    In this tutorial you will learn about polynomial regression and how you can implement it in Tensorflow.

    @@ -586,14 +604,15 @@ values using the X values. We then plot it to compare the actual data and predic

    Basically if you train your machine learning model on a small dataset for a really large number of epochs, the model will learn all the deformities/noise in the data and will actually think that it is a normal part. Therefore when it will see some new data, it will discard that new data as noise and will impact the accuracy of the model in a negative manner

    +
    If you have scrolled this far, consider subscribing to my mailing list here. You can subscribe to either a specific type of post you are interested in, or subscribe to everything with the "Everything" list.
    -
    +
    -- cgit v1.2.3 From de19543d7fb44d343b052dc9b34ede78620c4a46 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 23:36:55 -0600 Subject: Generate --- .../2019-12-16-TensorFlow-Polynomial-Regression.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index ecb1920..15c0cc4 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -46,7 +46,7 @@
    + +
    -- cgit v1.2.3 From a982ceab0b45609991179b3020a00260eed6f798 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 27 Mar 2024 23:45:59 -0600 Subject: css --- docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html') diff --git a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html index 15c0cc4..86a1954 100644 --- a/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html +++ b/docs/posts/2019-12-16-TensorFlow-Polynomial-Regression.html @@ -5,6 +5,7 @@ + Polynomial Regression Using TensorFlow -- cgit v1.2.3