Kmeans clustering with multiple columns containing strings Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsScikit Learn: KMeans Clustering 3D data over a time period (dimentionality reduction?)Combining K-means clustering with Agglomerative clusteringKMeans clustering to help label Multi-class Supervised modelConfused about how to apply KMeans on my a dataset with features extractedImplementation of kmeans clustering using RClustering for multiple variableClustering with multiple distance measureshow to convert multiple columns into single columns in pandas?Accuracy for Kmeans clusteringHow can I perform clustering on a list of words and ratings as columns?

Time to Settle Down!

How do I find out the mythology and history of my Fortress?

How does light 'choose' between wave and particle behaviour?

How fail-safe is nr as stop bytes?

Performance gap between bool std:vector and array

Why is it faster to reheat something than it is to cook it?

Sum letters are not two different

Drawing without replacement: why the order of draw is irrelevant?

Project Euler #1 in C++

Can a new player join a group only when a new campaign starts?

Modified Intersection Puzzle

How come Sam didn't become Lord of Horn Hill?

Can an alien society believe that their star system is the universe?

Did Krishna said in BG that I am in every living being

Do wooden building fires get hotter than 600°C?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

What is the effect of altitude on true airspeed?

Is there a kind of relay only consumes power when switching?

How could we fake a moon landing now?

Benefits of using sObject.clone versus creating a new record

Does lack of seasonality imply random time series?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Maximum summed subsequences with non-adjacent items

Physics no longer uses mechanical models to describe phenomena



Kmeans clustering with multiple columns containing strings



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsScikit Learn: KMeans Clustering 3D data over a time period (dimentionality reduction?)Combining K-means clustering with Agglomerative clusteringKMeans clustering to help label Multi-class Supervised modelConfused about how to apply KMeans on my a dataset with features extractedImplementation of kmeans clustering using RClustering for multiple variableClustering with multiple distance measureshow to convert multiple columns into single columns in pandas?Accuracy for Kmeans clusteringHow can I perform clustering on a list of words and ratings as columns?










0












$begingroup$


I have the following dataset:
https://www.kaggle.com/carolzhangdc/imdb-5000-movie-dataset



What I want to find is clusters based on imdb score per genre per country. I have created a pandas data frame that contains per country for every unique genre the average imdb rating.



The dataframe looks like this:



country object
genre object
avgRating float64
dtype: object


Since the columns country and genre contain strings, I can't use Kmeans for this.



Is there anyway I can achieve what I want?



Ps: This is the first question I have asked. Tips on how I can improve my question are appreciated.










share|improve this question









$endgroup$
















    0












    $begingroup$


    I have the following dataset:
    https://www.kaggle.com/carolzhangdc/imdb-5000-movie-dataset



    What I want to find is clusters based on imdb score per genre per country. I have created a pandas data frame that contains per country for every unique genre the average imdb rating.



    The dataframe looks like this:



    country object
    genre object
    avgRating float64
    dtype: object


    Since the columns country and genre contain strings, I can't use Kmeans for this.



    Is there anyway I can achieve what I want?



    Ps: This is the first question I have asked. Tips on how I can improve my question are appreciated.










    share|improve this question









    $endgroup$














      0












      0








      0





      $begingroup$


      I have the following dataset:
      https://www.kaggle.com/carolzhangdc/imdb-5000-movie-dataset



      What I want to find is clusters based on imdb score per genre per country. I have created a pandas data frame that contains per country for every unique genre the average imdb rating.



      The dataframe looks like this:



      country object
      genre object
      avgRating float64
      dtype: object


      Since the columns country and genre contain strings, I can't use Kmeans for this.



      Is there anyway I can achieve what I want?



      Ps: This is the first question I have asked. Tips on how I can improve my question are appreciated.










      share|improve this question









      $endgroup$




      I have the following dataset:
      https://www.kaggle.com/carolzhangdc/imdb-5000-movie-dataset



      What I want to find is clusters based on imdb score per genre per country. I have created a pandas data frame that contains per country for every unique genre the average imdb rating.



      The dataframe looks like this:



      country object
      genre object
      avgRating float64
      dtype: object


      Since the columns country and genre contain strings, I can't use Kmeans for this.



      Is there anyway I can achieve what I want?



      Ps: This is the first question I have asked. Tips on how I can improve my question are appreciated.







      python k-means unsupervised-learning






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 2 at 21:58









      DonCappieDonCappie

      14




      14




















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          After some more research we found this library: https://github.com/nicodv/kmodes.



          The library k-modes is used for clustering categorical variables. It defines clusters based on the number of matching categories between data points. (This is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance.) The k-prototypes algorithm combines k-modes and k-means and is able to cluster mixed numerical / categorical data.



          Because the dataframe contains categorical data we can't visualize it in a scatterplot. So I added the number representing the cluster the row was assigned to, for every row to get some form of visualization.



          Normally you can only cluster ordinal data, because clustering happens based on distance. So I don't know to what extent this is reliable.






          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%2f48473%2fkmeans-clustering-with-multiple-columns-containing-strings%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0












            $begingroup$

            After some more research we found this library: https://github.com/nicodv/kmodes.



            The library k-modes is used for clustering categorical variables. It defines clusters based on the number of matching categories between data points. (This is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance.) The k-prototypes algorithm combines k-modes and k-means and is able to cluster mixed numerical / categorical data.



            Because the dataframe contains categorical data we can't visualize it in a scatterplot. So I added the number representing the cluster the row was assigned to, for every row to get some form of visualization.



            Normally you can only cluster ordinal data, because clustering happens based on distance. So I don't know to what extent this is reliable.






            share|improve this answer









            $endgroup$

















              0












              $begingroup$

              After some more research we found this library: https://github.com/nicodv/kmodes.



              The library k-modes is used for clustering categorical variables. It defines clusters based on the number of matching categories between data points. (This is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance.) The k-prototypes algorithm combines k-modes and k-means and is able to cluster mixed numerical / categorical data.



              Because the dataframe contains categorical data we can't visualize it in a scatterplot. So I added the number representing the cluster the row was assigned to, for every row to get some form of visualization.



              Normally you can only cluster ordinal data, because clustering happens based on distance. So I don't know to what extent this is reliable.






              share|improve this answer









              $endgroup$















                0












                0








                0





                $begingroup$

                After some more research we found this library: https://github.com/nicodv/kmodes.



                The library k-modes is used for clustering categorical variables. It defines clusters based on the number of matching categories between data points. (This is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance.) The k-prototypes algorithm combines k-modes and k-means and is able to cluster mixed numerical / categorical data.



                Because the dataframe contains categorical data we can't visualize it in a scatterplot. So I added the number representing the cluster the row was assigned to, for every row to get some form of visualization.



                Normally you can only cluster ordinal data, because clustering happens based on distance. So I don't know to what extent this is reliable.






                share|improve this answer









                $endgroup$



                After some more research we found this library: https://github.com/nicodv/kmodes.



                The library k-modes is used for clustering categorical variables. It defines clusters based on the number of matching categories between data points. (This is in contrast to the more well-known k-means algorithm, which clusters numerical data based on Euclidean distance.) The k-prototypes algorithm combines k-modes and k-means and is able to cluster mixed numerical / categorical data.



                Because the dataframe contains categorical data we can't visualize it in a scatterplot. So I added the number representing the cluster the row was assigned to, for every row to get some form of visualization.



                Normally you can only cluster ordinal data, because clustering happens based on distance. So I don't know to what extent this is reliable.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 11 at 8:56









                DonCappieDonCappie

                14




                14



























                    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%2f48473%2fkmeans-clustering-with-multiple-columns-containing-strings%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

                    Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

                    Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?