When to use Standard Scaler and when Normalizer? The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsCan I fine tune the xgboost model instead of re-training it?Scikit Learn Missing Data - Categorical valuesIs GridSearchCV computing SVC with rbf kernel and different degrees?time series forecasting - sliding window methodScaling multiple time series dataMultivariate outlier detection with isolation forest..How to detect most effective features?sklearn.neighbors.NearestNeighbors - knn for unsupervised learning?Why is Local Outlier Factor classified as Unsupervised if it requires training data with no outliers?Online vs Batch Learning in Latent Dirichlet Allocation using Scikit Learntarget in cluster analisys (PCA)

Working through Single Responsibility Principle in Python when Calls are Expensive

How to fill page vertically?

Can the DM override racial traits?

Define a list range inside a list

Pretty sure I'm over complicating my loops but unsure how to simplify

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Can withdrawing asylum be illegal?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

different output for groups and groups USERNAME after adding a username to a group

How to type a long/em dash `—`

Can we generate random numbers using irrational numbers like π and e?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Word for: a synonym with a positive connotation?

Variety of transposing instruments

Make it rain characters

Do ℕ, mathbbN, BbbN, symbbN effectively differ, and is there a "canonical" specification of the naturals?

How to make Illustrator type tool selection automatically adapt with text length

Is 'stolen' appropriate word?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Why not take a picture of a closer black hole?

how can a perfect fourth interval be considered either consonant or dissonant?

What options are there, if any, to get information from an enemy's familiar?

Match Roman Numerals

What aspect of planet earth must be changed to prevent the industrial revolution?



When to use Standard Scaler and when Normalizer?



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsCan I fine tune the xgboost model instead of re-training it?Scikit Learn Missing Data - Categorical valuesIs GridSearchCV computing SVC with rbf kernel and different degrees?time series forecasting - sliding window methodScaling multiple time series dataMultivariate outlier detection with isolation forest..How to detect most effective features?sklearn.neighbors.NearestNeighbors - knn for unsupervised learning?Why is Local Outlier Factor classified as Unsupervised if it requires training data with no outliers?Online vs Batch Learning in Latent Dirichlet Allocation using Scikit Learntarget in cluster analisys (PCA)










6












$begingroup$


I understand what Standard Scalar does and what Normalizer does as per the Sci-Kit documentation.
Normalizer - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Normalizer.html#sklearn.preprocessing.Normalizer



Standard Scaler - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler



I know when Standard Scaler is applied. But in which scenario is Normalizer applied? Are there scenarios where one is preferred over the other?










share|improve this question











$endgroup$
















    6












    $begingroup$


    I understand what Standard Scalar does and what Normalizer does as per the Sci-Kit documentation.
    Normalizer - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Normalizer.html#sklearn.preprocessing.Normalizer



    Standard Scaler - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler



    I know when Standard Scaler is applied. But in which scenario is Normalizer applied? Are there scenarios where one is preferred over the other?










    share|improve this question











    $endgroup$














      6












      6








      6


      1



      $begingroup$


      I understand what Standard Scalar does and what Normalizer does as per the Sci-Kit documentation.
      Normalizer - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Normalizer.html#sklearn.preprocessing.Normalizer



      Standard Scaler - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler



      I know when Standard Scaler is applied. But in which scenario is Normalizer applied? Are there scenarios where one is preferred over the other?










      share|improve this question











      $endgroup$




      I understand what Standard Scalar does and what Normalizer does as per the Sci-Kit documentation.
      Normalizer - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Normalizer.html#sklearn.preprocessing.Normalizer



      Standard Scaler - https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler



      I know when Standard Scaler is applied. But in which scenario is Normalizer applied? Are there scenarios where one is preferred over the other?







      python scikit-learn data-cleaning normalization






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 31 at 21:44







      Heisenbug

















      asked Feb 20 at 16:38









      HeisenbugHeisenbug

      462




      462




















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$

          • StandardScaler : It transforms the data in such a manner that it has mean as 0 and standard deviation as 1. In short, it standardizes the data. Standardization is useful for data which has negative values. It arranges the data in normal distribution. It is more useful in classification than regression.
            You can read this blog of mine.


          • Normalizer : It squeezes the data between 0 and 1. It performs normalization. Due to the decreased range and magnitude, the gradients in the training process do not explode and you do not get higher values of loss. Is more useful in regression than classification.
            You can read this blog of mine.






          share|improve this answer









          $endgroup$












          • $begingroup$
            The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
            $endgroup$
            – Heisenbug
            Feb 21 at 5:53










          • $begingroup$
            This answer may help you.
            $endgroup$
            – Shubham Panchal
            Feb 21 at 6:42






          • 3




            $begingroup$
            -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
            $endgroup$
            – Artem Mavrin
            Feb 25 at 18:37


















          2












          $begingroup$

          They are used for two different purposes.



          StandardScaler changes each feature column $f_:,i$ to $$f'_:,i = fracf_:,i - mean(f_:,i)std(f_:,i).$$



          Normalizer changes each sample $x_n=(f_n,1,...,f_n,d)$ to $$x'_n = fracx_nsize(x_n),$$ where $size(x_n)$ for




          1. l1 norm is $left | x_n right |_1=|f_n,1|+...+|f_n,d|$,


          2. l2 norm is $left | x_n right |_2=sqrtf^2_n,1+...+f^2_n,d$,


          3. max norm is $left | x_n right |_infty=maxf_n,d$.

          To illustrate the contrast, consider data set $1, 2, 3, 4, 5$ which is one dimensional (each data point has one feature),

          After applying StandardScaler, data set becomes $-1.41, -0.71, 0. ,0.71, 1.41$.

          After applying any type of Normalizer, data set becomes $1., 1., 1., 1., 1.$, since the only feature is divided by itself. So Normalizer has no use for this case. It also has no use when features have different units, e.g. $(height, age, income)$.



          As mentioned in this answer, Normalizer is mostly useful for controlling the size of a vector in an iterative process, e.g. a parameter vector during training, to avoid numerical instabilities due to large values.






          share|improve this answer











          $endgroup$













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "557"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f45900%2fwhen-to-use-standard-scaler-and-when-normalizer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3












            $begingroup$

            • StandardScaler : It transforms the data in such a manner that it has mean as 0 and standard deviation as 1. In short, it standardizes the data. Standardization is useful for data which has negative values. It arranges the data in normal distribution. It is more useful in classification than regression.
              You can read this blog of mine.


            • Normalizer : It squeezes the data between 0 and 1. It performs normalization. Due to the decreased range and magnitude, the gradients in the training process do not explode and you do not get higher values of loss. Is more useful in regression than classification.
              You can read this blog of mine.






            share|improve this answer









            $endgroup$












            • $begingroup$
              The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
              $endgroup$
              – Heisenbug
              Feb 21 at 5:53










            • $begingroup$
              This answer may help you.
              $endgroup$
              – Shubham Panchal
              Feb 21 at 6:42






            • 3




              $begingroup$
              -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
              $endgroup$
              – Artem Mavrin
              Feb 25 at 18:37















            3












            $begingroup$

            • StandardScaler : It transforms the data in such a manner that it has mean as 0 and standard deviation as 1. In short, it standardizes the data. Standardization is useful for data which has negative values. It arranges the data in normal distribution. It is more useful in classification than regression.
              You can read this blog of mine.


            • Normalizer : It squeezes the data between 0 and 1. It performs normalization. Due to the decreased range and magnitude, the gradients in the training process do not explode and you do not get higher values of loss. Is more useful in regression than classification.
              You can read this blog of mine.






            share|improve this answer









            $endgroup$












            • $begingroup$
              The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
              $endgroup$
              – Heisenbug
              Feb 21 at 5:53










            • $begingroup$
              This answer may help you.
              $endgroup$
              – Shubham Panchal
              Feb 21 at 6:42






            • 3




              $begingroup$
              -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
              $endgroup$
              – Artem Mavrin
              Feb 25 at 18:37













            3












            3








            3





            $begingroup$

            • StandardScaler : It transforms the data in such a manner that it has mean as 0 and standard deviation as 1. In short, it standardizes the data. Standardization is useful for data which has negative values. It arranges the data in normal distribution. It is more useful in classification than regression.
              You can read this blog of mine.


            • Normalizer : It squeezes the data between 0 and 1. It performs normalization. Due to the decreased range and magnitude, the gradients in the training process do not explode and you do not get higher values of loss. Is more useful in regression than classification.
              You can read this blog of mine.






            share|improve this answer









            $endgroup$



            • StandardScaler : It transforms the data in such a manner that it has mean as 0 and standard deviation as 1. In short, it standardizes the data. Standardization is useful for data which has negative values. It arranges the data in normal distribution. It is more useful in classification than regression.
              You can read this blog of mine.


            • Normalizer : It squeezes the data between 0 and 1. It performs normalization. Due to the decreased range and magnitude, the gradients in the training process do not explode and you do not get higher values of loss. Is more useful in regression than classification.
              You can read this blog of mine.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 21 at 2:20









            Shubham PanchalShubham Panchal

            37118




            37118











            • $begingroup$
              The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
              $endgroup$
              – Heisenbug
              Feb 21 at 5:53










            • $begingroup$
              This answer may help you.
              $endgroup$
              – Shubham Panchal
              Feb 21 at 6:42






            • 3




              $begingroup$
              -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
              $endgroup$
              – Artem Mavrin
              Feb 25 at 18:37
















            • $begingroup$
              The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
              $endgroup$
              – Heisenbug
              Feb 21 at 5:53










            • $begingroup$
              This answer may help you.
              $endgroup$
              – Shubham Panchal
              Feb 21 at 6:42






            • 3




              $begingroup$
              -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
              $endgroup$
              – Artem Mavrin
              Feb 25 at 18:37















            $begingroup$
            The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
            $endgroup$
            – Heisenbug
            Feb 21 at 5:53




            $begingroup$
            The normalizer you have defined in your blog is MinMax scaler. The link which I have put for normalization is different. It makes the l2 norm of each data row equal to 1.
            $endgroup$
            – Heisenbug
            Feb 21 at 5:53












            $begingroup$
            This answer may help you.
            $endgroup$
            – Shubham Panchal
            Feb 21 at 6:42




            $begingroup$
            This answer may help you.
            $endgroup$
            – Shubham Panchal
            Feb 21 at 6:42




            3




            3




            $begingroup$
            -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
            $endgroup$
            – Artem Mavrin
            Feb 25 at 18:37




            $begingroup$
            -1: "[standardization] arranges the data in normal distribution." you should clarify what you mean by this. I read this as "standardization transforms data to have the normal distribution", which is not true. You should also explain why standardization is more useful in classification than regression (and vice versa for normalization); I doubt that claim.
            $endgroup$
            – Artem Mavrin
            Feb 25 at 18:37











            2












            $begingroup$

            They are used for two different purposes.



            StandardScaler changes each feature column $f_:,i$ to $$f'_:,i = fracf_:,i - mean(f_:,i)std(f_:,i).$$



            Normalizer changes each sample $x_n=(f_n,1,...,f_n,d)$ to $$x'_n = fracx_nsize(x_n),$$ where $size(x_n)$ for




            1. l1 norm is $left | x_n right |_1=|f_n,1|+...+|f_n,d|$,


            2. l2 norm is $left | x_n right |_2=sqrtf^2_n,1+...+f^2_n,d$,


            3. max norm is $left | x_n right |_infty=maxf_n,d$.

            To illustrate the contrast, consider data set $1, 2, 3, 4, 5$ which is one dimensional (each data point has one feature),

            After applying StandardScaler, data set becomes $-1.41, -0.71, 0. ,0.71, 1.41$.

            After applying any type of Normalizer, data set becomes $1., 1., 1., 1., 1.$, since the only feature is divided by itself. So Normalizer has no use for this case. It also has no use when features have different units, e.g. $(height, age, income)$.



            As mentioned in this answer, Normalizer is mostly useful for controlling the size of a vector in an iterative process, e.g. a parameter vector during training, to avoid numerical instabilities due to large values.






            share|improve this answer











            $endgroup$

















              2












              $begingroup$

              They are used for two different purposes.



              StandardScaler changes each feature column $f_:,i$ to $$f'_:,i = fracf_:,i - mean(f_:,i)std(f_:,i).$$



              Normalizer changes each sample $x_n=(f_n,1,...,f_n,d)$ to $$x'_n = fracx_nsize(x_n),$$ where $size(x_n)$ for




              1. l1 norm is $left | x_n right |_1=|f_n,1|+...+|f_n,d|$,


              2. l2 norm is $left | x_n right |_2=sqrtf^2_n,1+...+f^2_n,d$,


              3. max norm is $left | x_n right |_infty=maxf_n,d$.

              To illustrate the contrast, consider data set $1, 2, 3, 4, 5$ which is one dimensional (each data point has one feature),

              After applying StandardScaler, data set becomes $-1.41, -0.71, 0. ,0.71, 1.41$.

              After applying any type of Normalizer, data set becomes $1., 1., 1., 1., 1.$, since the only feature is divided by itself. So Normalizer has no use for this case. It also has no use when features have different units, e.g. $(height, age, income)$.



              As mentioned in this answer, Normalizer is mostly useful for controlling the size of a vector in an iterative process, e.g. a parameter vector during training, to avoid numerical instabilities due to large values.






              share|improve this answer











              $endgroup$















                2












                2








                2





                $begingroup$

                They are used for two different purposes.



                StandardScaler changes each feature column $f_:,i$ to $$f'_:,i = fracf_:,i - mean(f_:,i)std(f_:,i).$$



                Normalizer changes each sample $x_n=(f_n,1,...,f_n,d)$ to $$x'_n = fracx_nsize(x_n),$$ where $size(x_n)$ for




                1. l1 norm is $left | x_n right |_1=|f_n,1|+...+|f_n,d|$,


                2. l2 norm is $left | x_n right |_2=sqrtf^2_n,1+...+f^2_n,d$,


                3. max norm is $left | x_n right |_infty=maxf_n,d$.

                To illustrate the contrast, consider data set $1, 2, 3, 4, 5$ which is one dimensional (each data point has one feature),

                After applying StandardScaler, data set becomes $-1.41, -0.71, 0. ,0.71, 1.41$.

                After applying any type of Normalizer, data set becomes $1., 1., 1., 1., 1.$, since the only feature is divided by itself. So Normalizer has no use for this case. It also has no use when features have different units, e.g. $(height, age, income)$.



                As mentioned in this answer, Normalizer is mostly useful for controlling the size of a vector in an iterative process, e.g. a parameter vector during training, to avoid numerical instabilities due to large values.






                share|improve this answer











                $endgroup$



                They are used for two different purposes.



                StandardScaler changes each feature column $f_:,i$ to $$f'_:,i = fracf_:,i - mean(f_:,i)std(f_:,i).$$



                Normalizer changes each sample $x_n=(f_n,1,...,f_n,d)$ to $$x'_n = fracx_nsize(x_n),$$ where $size(x_n)$ for




                1. l1 norm is $left | x_n right |_1=|f_n,1|+...+|f_n,d|$,


                2. l2 norm is $left | x_n right |_2=sqrtf^2_n,1+...+f^2_n,d$,


                3. max norm is $left | x_n right |_infty=maxf_n,d$.

                To illustrate the contrast, consider data set $1, 2, 3, 4, 5$ which is one dimensional (each data point has one feature),

                After applying StandardScaler, data set becomes $-1.41, -0.71, 0. ,0.71, 1.41$.

                After applying any type of Normalizer, data set becomes $1., 1., 1., 1., 1.$, since the only feature is divided by itself. So Normalizer has no use for this case. It also has no use when features have different units, e.g. $(height, age, income)$.



                As mentioned in this answer, Normalizer is mostly useful for controlling the size of a vector in an iterative process, e.g. a parameter vector during training, to avoid numerical instabilities due to large values.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 13 at 18:32

























                answered Mar 9 at 13:36









                EsmailianEsmailian

                3,156320




                3,156320



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Data Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f45900%2fwhen-to-use-standard-scaler-and-when-normalizer%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

                    Luettelo Yhdysvaltain laivaston lentotukialuksista Lähteet | Navigointivalikko

                    Gary (muusikko) Sisällysluettelo Historia | Rockin' High | Lähteet | Aiheesta muualla | NavigointivalikkoInfobox OKTuomas "Gary" Keskinen Ancaran kitaristiksiProjekti Rockin' High