How to compare paired count data?Can machine learning algorithms predict sports scores or plays?How to create Self learning data productPython: Handling imbalance Classes in python Machine LearningHow does one deploy a model, after building it in Python or Matlab?Predicting a Continuous output in a dataset with categoriesDifferent approaches of creating the test setPoor performance of SVM after training for rare eventsBest ML model for predicting yearly data with many blocks?Improving population weightingMulti-input Convolutional Neural Network for Images Classification

My bank got bought out, am I now going to have to start filing tax returns in a different state?

Is it acceptable to use working hours to read general interest books?

How can I practically buy stocks?

Why did C use the -> operator instead of reusing the . operator?

How bug prioritization works in agile projects vs non agile

Contradiction proof for inequality of P and NP?

Why do distances seem to matter in the Foundation world?

Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?

Injection into a proper class and choice without regularity

Can I criticise the more senior developers around me for not writing clean code?

Combinatorics problem, right solution?

Check if a string is entirely made of the same substring

Was Dennis Ritchie being too modest in this quote about C and Pascal?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

What does "function" actually mean in music?

Von Neumann Extractor - Which bit is retained?

What is the term for a person whose job is to place products on shelves in stores?

How do I check if a string is entirely made of the same substring?

Why is the underscore command _ useful?

Philosophical question on logistic regression: why isn't the optimal threshold value trained?

How long after the last departure shall the airport stay open for an emergency return?

How much of a wave function must reside inside event horizon for it to be consumed by the black hole?

SFDX - Create Objects with Custom Properties

Nails holding drywall



How to compare paired count data?


Can machine learning algorithms predict sports scores or plays?How to create Self learning data productPython: Handling imbalance Classes in python Machine LearningHow does one deploy a model, after building it in Python or Matlab?Predicting a Continuous output in a dataset with categoriesDifferent approaches of creating the test setPoor performance of SVM after training for rare eventsBest ML model for predicting yearly data with many blocks?Improving population weightingMulti-input Convolutional Neural Network for Images Classification













0












$begingroup$


I am working with a machine learning approach that counts cars in images. I have a predicted dataset, which is the predicted output from the machine learning approach and a paired "true" dataset, which is the result of a human going through each image and counting the number of cars.



The following is a sample of what the datasets look like (note that the actual dataset has 2500 paired samples):



import pandas as pd

d = 'true': [0,0,0,1,1,0,1,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
'predicted': [0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]
df = pd.DataFrame(data=d)



 true predicted
0 0 0
1 0 0
2 0 0
3 1 0
4 1 0
5 0 0
6 1 1
7 0 0
8 0 0
9 0 0
10 0 0
11 0 0
12 0 0
13 0 0
14 4 2
15 2 2
16 0 0
17 0 0
18 0 0
19 0 0
20 0 0
21 0 0
22 0 0
23 0 0
24 0 1
25 0 0
26 0 0
27 0 0
28 0 0
29 0 0
30 0 0
31 0 0
32 1 1


I am looking for a way to present the predicted approach to an audience so that they see if the predictions are statistically the same as the true observations and visualize any trends in the data (e.g. the predicted approach has a tendency to over or under predict). If these were categorical data, I would use a confusion matrix, however, I am not sure how to deal with these paired, discrete datasets that are heavily weighted with 0's.



What approach can I take to statistically compare the predicted vs true datasets?










share|improve this question











$endgroup$





This question has an open bounty worth +50
reputation from Borealis ending ending at 2019-05-03 03:52:25Z">in 7 days.


The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.




















    0












    $begingroup$


    I am working with a machine learning approach that counts cars in images. I have a predicted dataset, which is the predicted output from the machine learning approach and a paired "true" dataset, which is the result of a human going through each image and counting the number of cars.



    The following is a sample of what the datasets look like (note that the actual dataset has 2500 paired samples):



    import pandas as pd

    d = 'true': [0,0,0,1,1,0,1,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
    'predicted': [0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]
    df = pd.DataFrame(data=d)



     true predicted
    0 0 0
    1 0 0
    2 0 0
    3 1 0
    4 1 0
    5 0 0
    6 1 1
    7 0 0
    8 0 0
    9 0 0
    10 0 0
    11 0 0
    12 0 0
    13 0 0
    14 4 2
    15 2 2
    16 0 0
    17 0 0
    18 0 0
    19 0 0
    20 0 0
    21 0 0
    22 0 0
    23 0 0
    24 0 1
    25 0 0
    26 0 0
    27 0 0
    28 0 0
    29 0 0
    30 0 0
    31 0 0
    32 1 1


    I am looking for a way to present the predicted approach to an audience so that they see if the predictions are statistically the same as the true observations and visualize any trends in the data (e.g. the predicted approach has a tendency to over or under predict). If these were categorical data, I would use a confusion matrix, however, I am not sure how to deal with these paired, discrete datasets that are heavily weighted with 0's.



    What approach can I take to statistically compare the predicted vs true datasets?










    share|improve this question











    $endgroup$





    This question has an open bounty worth +50
    reputation from Borealis ending ending at 2019-05-03 03:52:25Z">in 7 days.


    The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.


















      0












      0








      0





      $begingroup$


      I am working with a machine learning approach that counts cars in images. I have a predicted dataset, which is the predicted output from the machine learning approach and a paired "true" dataset, which is the result of a human going through each image and counting the number of cars.



      The following is a sample of what the datasets look like (note that the actual dataset has 2500 paired samples):



      import pandas as pd

      d = 'true': [0,0,0,1,1,0,1,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
      'predicted': [0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]
      df = pd.DataFrame(data=d)



       true predicted
      0 0 0
      1 0 0
      2 0 0
      3 1 0
      4 1 0
      5 0 0
      6 1 1
      7 0 0
      8 0 0
      9 0 0
      10 0 0
      11 0 0
      12 0 0
      13 0 0
      14 4 2
      15 2 2
      16 0 0
      17 0 0
      18 0 0
      19 0 0
      20 0 0
      21 0 0
      22 0 0
      23 0 0
      24 0 1
      25 0 0
      26 0 0
      27 0 0
      28 0 0
      29 0 0
      30 0 0
      31 0 0
      32 1 1


      I am looking for a way to present the predicted approach to an audience so that they see if the predictions are statistically the same as the true observations and visualize any trends in the data (e.g. the predicted approach has a tendency to over or under predict). If these were categorical data, I would use a confusion matrix, however, I am not sure how to deal with these paired, discrete datasets that are heavily weighted with 0's.



      What approach can I take to statistically compare the predicted vs true datasets?










      share|improve this question











      $endgroup$




      I am working with a machine learning approach that counts cars in images. I have a predicted dataset, which is the predicted output from the machine learning approach and a paired "true" dataset, which is the result of a human going through each image and counting the number of cars.



      The following is a sample of what the datasets look like (note that the actual dataset has 2500 paired samples):



      import pandas as pd

      d = 'true': [0,0,0,1,1,0,1,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
      'predicted': [0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1]
      df = pd.DataFrame(data=d)



       true predicted
      0 0 0
      1 0 0
      2 0 0
      3 1 0
      4 1 0
      5 0 0
      6 1 1
      7 0 0
      8 0 0
      9 0 0
      10 0 0
      11 0 0
      12 0 0
      13 0 0
      14 4 2
      15 2 2
      16 0 0
      17 0 0
      18 0 0
      19 0 0
      20 0 0
      21 0 0
      22 0 0
      23 0 0
      24 0 1
      25 0 0
      26 0 0
      27 0 0
      28 0 0
      29 0 0
      30 0 0
      31 0 0
      32 1 1


      I am looking for a way to present the predicted approach to an audience so that they see if the predictions are statistically the same as the true observations and visualize any trends in the data (e.g. the predicted approach has a tendency to over or under predict). If these were categorical data, I would use a confusion matrix, however, I am not sure how to deal with these paired, discrete datasets that are heavily weighted with 0's.



      What approach can I take to statistically compare the predicted vs true datasets?







      machine-learning python pandas accuracy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago







      Borealis

















      asked Apr 16 at 2:47









      BorealisBorealis

      122213




      122213






      This question has an open bounty worth +50
      reputation from Borealis ending ending at 2019-05-03 03:52:25Z">in 7 days.


      The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.








      This question has an open bounty worth +50
      reputation from Borealis ending ending at 2019-05-03 03:52:25Z">in 7 days.


      The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          You can use a simple error measure of $sum (real.people-predicted.people)^2+sum (real.cars-predicted.cars)^2$, the kind of problem you are dealing with has this objective function as the solved one.



          Actually, the algorithms implement this measure as their objective function.






          share|improve this answer











          $endgroup$












          • $begingroup$
            This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
            $endgroup$
            – Borealis
            Apr 16 at 4:31










          • $begingroup$
            You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
            $endgroup$
            – Juan Esteban de la Calle
            Apr 16 at 4:45











          • $begingroup$
            I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
            $endgroup$
            – Borealis
            52 secs ago












          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%2f49363%2fhow-to-compare-paired-count-data%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









          1












          $begingroup$

          You can use a simple error measure of $sum (real.people-predicted.people)^2+sum (real.cars-predicted.cars)^2$, the kind of problem you are dealing with has this objective function as the solved one.



          Actually, the algorithms implement this measure as their objective function.






          share|improve this answer











          $endgroup$












          • $begingroup$
            This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
            $endgroup$
            – Borealis
            Apr 16 at 4:31










          • $begingroup$
            You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
            $endgroup$
            – Juan Esteban de la Calle
            Apr 16 at 4:45











          • $begingroup$
            I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
            $endgroup$
            – Borealis
            52 secs ago
















          1












          $begingroup$

          You can use a simple error measure of $sum (real.people-predicted.people)^2+sum (real.cars-predicted.cars)^2$, the kind of problem you are dealing with has this objective function as the solved one.



          Actually, the algorithms implement this measure as their objective function.






          share|improve this answer











          $endgroup$












          • $begingroup$
            This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
            $endgroup$
            – Borealis
            Apr 16 at 4:31










          • $begingroup$
            You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
            $endgroup$
            – Juan Esteban de la Calle
            Apr 16 at 4:45











          • $begingroup$
            I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
            $endgroup$
            – Borealis
            52 secs ago














          1












          1








          1





          $begingroup$

          You can use a simple error measure of $sum (real.people-predicted.people)^2+sum (real.cars-predicted.cars)^2$, the kind of problem you are dealing with has this objective function as the solved one.



          Actually, the algorithms implement this measure as their objective function.






          share|improve this answer











          $endgroup$



          You can use a simple error measure of $sum (real.people-predicted.people)^2+sum (real.cars-predicted.cars)^2$, the kind of problem you are dealing with has this objective function as the solved one.



          Actually, the algorithms implement this measure as their objective function.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 16 at 4:46

























          answered Apr 16 at 3:23









          Juan Esteban de la CalleJuan Esteban de la Calle

          69122




          69122











          • $begingroup$
            This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
            $endgroup$
            – Borealis
            Apr 16 at 4:31










          • $begingroup$
            You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
            $endgroup$
            – Juan Esteban de la Calle
            Apr 16 at 4:45











          • $begingroup$
            I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
            $endgroup$
            – Borealis
            52 secs ago

















          • $begingroup$
            This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
            $endgroup$
            – Borealis
            Apr 16 at 4:31










          • $begingroup$
            You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
            $endgroup$
            – Juan Esteban de la Calle
            Apr 16 at 4:45











          • $begingroup$
            I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
            $endgroup$
            – Borealis
            52 secs ago
















          $begingroup$
          This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
          $endgroup$
          – Borealis
          Apr 16 at 4:31




          $begingroup$
          This approach would yield two numbers--one for each class. Would the results of your approach, for example, "person" -7 and "car" +4 be sufficient to describe the predicted accuracy?
          $endgroup$
          – Borealis
          Apr 16 at 4:31












          $begingroup$
          You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
          $endgroup$
          – Juan Esteban de la Calle
          Apr 16 at 4:45





          $begingroup$
          You are right, there is something to be corrected in the post. I edited it, I put the square in the difference, this way the errors will not substract.
          $endgroup$
          – Juan Esteban de la Calle
          Apr 16 at 4:45













          $begingroup$
          I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
          $endgroup$
          – Borealis
          52 secs ago





          $begingroup$
          I appreciate your help in this. I had to reword my question to clarify the problem I am trying to solve.
          $endgroup$
          – Borealis
          52 secs ago


















          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%2f49363%2fhow-to-compare-paired-count-data%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

          Францішак Багушэвіч Змест Сям'я | Біяграфія | Творчасць | Мова Багушэвіча | Ацэнкі дзейнасці | Цікавыя факты | Спадчына | Выбраная бібліяграфія | Ушанаванне памяці | У філатэліі | Зноскі | Літаратура | Спасылкі | НавігацыяЛяхоўскі У. Рупіўся дзеля Бога і людзей: Жыццёвы шлях Лявона Вітан-Дубейкаўскага // Вольскі і Памідораў з песняй пра немца Адвакат, паэт, народны заступнік Ашмянскі веснікВ Минске появится площадь Богушевича и улица Сырокомли, Белорусская деловая газета, 19 июля 2001 г.Айцец беларускай нацыянальнай ідэі паўстаў у бронзе Сяргей Аляксандравіч Адашкевіч (1918, Мінск). 80-я гады. Бюст «Францішак Багушэвіч».Яўген Мікалаевіч Ціхановіч. «Партрэт Францішка Багушэвіча»Мікола Мікалаевіч Купава. «Партрэт зачынальніка новай беларускай літаратуры Францішка Багушэвіча»Уладзімір Іванавіч Мелехаў. На помніку «Змагарам за родную мову» Барэльеф «Францішак Багушэвіч»Памяць пра Багушэвіча на Віленшчыне Страчаная сталіца. Беларускія шыльды на вуліцах Вільні«Krynica». Ideologia i przywódcy białoruskiego katolicyzmuФранцішак БагушэвічТворы на knihi.comТворы Францішка Багушэвіча на bellib.byСодаль Уладзімір. Францішак Багушэвіч на Лідчыне;Луцкевіч Антон. Жыцьцё і творчасьць Фр. Багушэвіча ў успамінах ягоных сучасьнікаў // Запісы Беларускага Навуковага таварыства. Вільня, 1938. Сшытак 1. С. 16-34.Большая российская1188761710000 0000 5537 633Xn9209310021619551927869394п

          Partai Komunis Tiongkok Daftar isi Kepemimpinan | Pranala luar | Referensi | Menu navigasidiperiksa1 perubahan tertundacpc.people.com.cnSitus resmiSurat kabar resmi"Why the Communist Party is alive, well and flourishing in China"0307-1235"Full text of Constitution of Communist Party of China"smengembangkannyas

          ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 6 (SMOTE) The 2019 Stack Overflow Developer Survey Results Are InCan SMOTE be applied over sequence of words (sentences)?ValueError when doing validation with random forestsSMOTE and multi class oversamplingLogic behind SMOTE-NC?ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)SmoteBoost: Should SMOTE be ran individually for each iteration/tree in the boosting?solving multi-class imbalance classification using smote and OSSUsing SMOTE for Synthetic Data generation to improve performance on unbalanced dataproblem of entry format for a simple model in KerasSVM SMOTE fit_resample() function runs forever with no result