Multi class logistic regression performs bad on certain classes












2












$begingroup$


I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?



    precision    recall  f1-score   support

0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765

avg / total 0.31 0.45 0.29 60000









share|improve this question









$endgroup$












  • $begingroup$
    your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
    $endgroup$
    – oW_
    Apr 24 '18 at 17:56










  • $begingroup$
    If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
    $endgroup$
    – Iyad Al aqel
    Apr 24 '18 at 18:28
















2












$begingroup$


I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?



    precision    recall  f1-score   support

0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765

avg / total 0.31 0.45 0.29 60000









share|improve this question









$endgroup$












  • $begingroup$
    your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
    $endgroup$
    – oW_
    Apr 24 '18 at 17:56










  • $begingroup$
    If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
    $endgroup$
    – Iyad Al aqel
    Apr 24 '18 at 18:28














2












2








2





$begingroup$


I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?



    precision    recall  f1-score   support

0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765

avg / total 0.31 0.45 0.29 60000









share|improve this question









$endgroup$




I'm trying to predict the day of the week for customers next visit from their previous visits (0 is they won't visit, 1 is Monday and so on). I have created some features like the visits days ratios, average duration between visits..etc.
My model performs really bad and i'm trying to diagnose it. I have used the classification report. How can interpret that some classes are completely misclassified?



    precision    recall  f1-score   support

0 0.45 0.98 0.62 26791
1 0.00 0.00 0.00 3771
2 0.00 0.00 0.00 2702
3 0.00 0.00 0.00 2744
4 0.00 0.00 0.00 2504
5 0.00 0.00 0.00 2735
6 0.35 0.06 0.10 9988
7 0.35 0.00 0.00 8765

avg / total 0.31 0.45 0.29 60000






logistic-regression performance






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 24 '18 at 17:50









Iyad Al aqelIyad Al aqel

1111




1111












  • $begingroup$
    your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
    $endgroup$
    – oW_
    Apr 24 '18 at 17:56










  • $begingroup$
    If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
    $endgroup$
    – Iyad Al aqel
    Apr 24 '18 at 18:28


















  • $begingroup$
    your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
    $endgroup$
    – oW_
    Apr 24 '18 at 17:56










  • $begingroup$
    If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
    $endgroup$
    – Iyad Al aqel
    Apr 24 '18 at 18:28
















$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56




$begingroup$
your features don't sound very predictive for the weekday of the visit... try predicting any visit (combining 1-7) and create additional features
$endgroup$
– oW_
Apr 24 '18 at 17:56












$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28




$begingroup$
If the goal is to predict the day not (any visit). How would i go from predicting any visit to predicting the day?
$endgroup$
– Iyad Al aqel
Apr 24 '18 at 18:28










1 Answer
1






active

oldest

votes


















0












$begingroup$

You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.



Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.



| customer_id | week | visit_day |

| 1 | 1 | 1 |

| 1 | 1 | 3 |


To account for non-visits, you need to have rows to mention 0 visits.



A couple of ways to look at the problem -



One, you have a customer and week level dataset and train a multinomial classifier.



Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.



Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).






share|improve this answer








New contributor




Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    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%2f30771%2fmulti-class-logistic-regression-performs-bad-on-certain-classes%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$

    You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.



    Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.



    | customer_id | week | visit_day |

    | 1 | 1 | 1 |

    | 1 | 1 | 3 |


    To account for non-visits, you need to have rows to mention 0 visits.



    A couple of ways to look at the problem -



    One, you have a customer and week level dataset and train a multinomial classifier.



    Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.



    Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).






    share|improve this answer








    New contributor




    Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    $endgroup$


















      0












      $begingroup$

      You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.



      Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.



      | customer_id | week | visit_day |

      | 1 | 1 | 1 |

      | 1 | 1 | 3 |


      To account for non-visits, you need to have rows to mention 0 visits.



      A couple of ways to look at the problem -



      One, you have a customer and week level dataset and train a multinomial classifier.



      Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.



      Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).






      share|improve this answer








      New contributor




      Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      $endgroup$
















        0












        0








        0





        $begingroup$

        You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.



        Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.



        | customer_id | week | visit_day |

        | 1 | 1 | 1 |

        | 1 | 1 | 3 |


        To account for non-visits, you need to have rows to mention 0 visits.



        A couple of ways to look at the problem -



        One, you have a customer and week level dataset and train a multinomial classifier.



        Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.



        Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).






        share|improve this answer








        New contributor




        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        $endgroup$



        You are not accounting for multiple visits within the same week. Say you have a customer visiting on a Monday and Wednesday of the same week, what will you have in your training set.



        Multiple visits per week. I'm not sure if you have done some feature engineering like below along with visit ratios, frequency, and average duration per visit.



        | customer_id | week | visit_day |

        | 1 | 1 | 1 |

        | 1 | 1 | 3 |


        To account for non-visits, you need to have rows to mention 0 visits.



        A couple of ways to look at the problem -



        One, you have a customer and week level dataset and train a multinomial classifier.



        Two, combine the results of eight binary classifiers, you can weight the proportions of the visit on a particular day to the probability of the predicted visit day.



        Since you are doing extensive feature engineering here, I suggest a tree-based approach for your classifier(s).







        share|improve this answer








        New contributor




        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 18 hours ago









        Next Door EngineerNext Door Engineer

        1011




        1011




        New contributor




        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Next Door Engineer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            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%2f30771%2fmulti-class-logistic-regression-performs-bad-on-certain-classes%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

            How to label and detect the document text images

            Vallis Paradisi

            Tabula Rosettana