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

                    Marja Vauras Lähteet | Aiheesta muualla | NavigointivalikkoMarja Vauras Turun yliopiston tutkimusportaalissaInfobox OKSuomalaisen Tiedeakatemian varsinaiset jäsenetKasvatustieteiden tiedekunnan dekaanit ja muu johtoMarja VaurasKoulutusvienti on kestävyys- ja ketteryyslaji (2.5.2017)laajentamallaWorldCat Identities0000 0001 0855 9405n86069603utb201588738523620927

                    Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

                    Is this part of the description of the Archfey warlock's Misty Escape feature redundant?When is entropic ward considered “used”?How does the reaction timing work for Wrath of the Storm? Can it potentially prevent the damage from the triggering attack?Does the Dark Arts Archlich warlock patrons's Arcane Invisibility activate every time you cast a level 1+ spell?When attacking while invisible, when exactly does invisibility break?Can I cast Hellish Rebuke on my turn?Do I have to “pre-cast” a reaction spell in order for it to be triggered?What happens if a Player Misty Escapes into an Invisible CreatureCan a reaction interrupt multiattack?Does the Fiend-patron warlock's Hurl Through Hell feature dispel effects that require the target to be on the same plane as the caster?What are you allowed to do while using the Warlock's Eldritch Master feature?