{
  "id": 78839,
  "title": "Feature 1/2/3",
  "url": "/competitions/elo-merchant-category-recommendation/discussion/78839",
  "author_name": "Konstantin Yakovlev",
  "post_date": "2019-01-28T10:36:00.026000",
  "votes": 21,
  "comment_count": 29,
  "views": 0,
  "content": "<p>Any theories what these features are?</p>\n\n<p>I think that such stable card related feature should be card type\n - Feature 1 - Card type (<a href=\"https://elo.com.br/produtos/pessoais\">https://elo.com.br/produtos/pessoais</a>) (Debit/Credit/Both/International/Nacional/etc)\n - Feature 2 - Processing company (Elo, Diners, Discover)\n - Feature 3 - Personal/Business \nSomething like this</p>",
  "messages": [
    {
      "id": 462462,
      "postDate": "2019-01-28T10:36:00.027Z",
      "content": "<p>Any theories what these features are?</p>\n\n<p>I think that such stable card related feature should be card type\n - Feature 1 - Card type (<a href=\"https://elo.com.br/produtos/pessoais\">https://elo.com.br/produtos/pessoais</a>) (Debit/Credit/Both/International/Nacional/etc)\n - Feature 2 - Processing company (Elo, Diners, Discover)\n - Feature 3 - Personal/Business \nSomething like this</p>",
      "rawMarkdown": "Any theories what these features are?\n\nI think that such stable card related feature should be card type\n - Feature 1 - Card type (https://elo.com.br/produtos/pessoais) (Debit/Credit/Both/International/Nacional/etc)\n - Feature 2 - Processing company (Elo, Diners, Discover)\n - Feature 3 - Personal/Business \nSomething like this",
      "votes": 21
    },
    {
      "id": 462676,
      "postDate": "2019-01-28T17:49:00.703Z",
      "content": "<p>Some info from Elo API\nProbably some of these parameters  are used in Scoring\nWe can get some of them from historical transactions by aggregating</p>\n\n#\n\n<p>The card number (PAN - Primary Account Number) is segmented by prefixes called \"BIN\", which stands for Bank Identification Number.</p>\n\n<p>Once the BIN is recognized, you can then consult the system using various attributes, such as:</p>\n\n<ul>\n<li>What is the country of origin (home) of the card? BIN { country }</li>\n<li>Can the card be used internationally? BIN { isInternational }</li>\n<li>What is the funding of the card? Credit, debit, multiple (both)? BIN { funding }</li>\n<li>Is it a corporate or individual card? BIN { isCompany }</li>\n<li>Is it a real or virtual card (CardToken)? BIN { isToken }</li>\n<li>Where can I capture card? (e.g. ATM, Point of Sale, Internet ...) BIN { allowedCaptures }</li>\n<li>What kind of use is it for? (e.g. credit at sight, credit in installments by the store, debit...) BIN { usage }</li>\n<li>What is the card provider? BIN { brand }</li>\n<li>On which network can the card be used? (e.g. Elo, Elo-Discovery...) BIN { cardNetwork }</li>\n<li>Who is the issuer (bank) of the card? BIN { issuer }</li>\n<li>Which cardholder services are offered? (e.g. Travel Insurance) BIN { services }</li>\n</ul>",
      "rawMarkdown": "Some info from Elo API\nProbably some of these parameters  are used in Scoring\nWe can get some of them from historical transactions by aggregating\n\n########\nThe card number (PAN - Primary Account Number) is segmented by prefixes called \"BIN\", which stands for Bank Identification Number.\n\nOnce the BIN is recognized, you can then consult the system using various attributes, such as:\n\n- What is the country of origin (home) of the card? BIN { country }\n- Can the card be used internationally? BIN { isInternational }\n- What is the funding of the card? Credit, debit, multiple (both)? BIN { funding }\n- Is it a corporate or individual card? BIN { isCompany }\n- Is it a real or virtual card (CardToken)? BIN { isToken }\n- Where can I capture card? (e.g. ATM, Point of Sale, Internet ...) BIN { allowedCaptures }\n- What kind of use is it for? (e.g. credit at sight, credit in installments by the store, debit...) BIN { usage }\n- What is the card provider? BIN { brand }\n- On which network can the card be used? (e.g. Elo, Elo-Discovery...) BIN { cardNetwork }\n- Who is the issuer (bank) of the card? BIN { issuer }\n- Which cardholder services are offered? (e.g. Travel Insurance) BIN { services }",
      "votes": 1
    },
    {
      "id": 462521,
      "postDate": "2019-01-28T12:49:46.707Z",
      "content": "<p>Lets check:\nFeature 1 has 5 unique values [installments Uniques are returned in order of appearance]\n5 [ 3  2  1  5  6  4 -1  0 10  8  7 12 11  9 -2]\n2 [ 0  1  2  5  4  3  6 12 -1 10  7  8  9 11 -2]\n3 [ 0  1  3 -1  4  6  2  5 12 10 11  8  7  9 -2]\n1 [ 1  2 -1  3  6 10  0  5 12  9  4  8  7 11 -2]\n4 [ 1  2  6 -1  3 10  5  4 12  0  8  7  9 11 -2]\nProbably 5,4,1 are Credit cards\n2,3 Debit\nSame for Category 3 (which is group of installments)\n5 [3 2 0 1 4]\n2 [1 2 3 0 4]\n3 [1 2 3 0 4]\n1 [2 3 0 1 4]\n4 [2 3 0 1 4]</p>\n\n<p>Feature 2 / Number of unique merchants\n1 107218\n2 215282\n3 231060\nProbably 1 - International brand (Diners?)\n2-3 (Elo own Cards) </p>",
      "rawMarkdown": "Lets check:\nFeature 1 has 5 unique values [installments Uniques are returned in order of appearance]\n5 [ 3  2  1  5  6  4 -1  0 10  8  7 12 11  9 -2]\n2 [ 0  1  2  5  4  3  6 12 -1 10  7  8  9 11 -2]\n3 [ 0  1  3 -1  4  6  2  5 12 10 11  8  7  9 -2]\n1 [ 1  2 -1  3  6 10  0  5 12  9  4  8  7 11 -2]\n4 [ 1  2  6 -1  3 10  5  4 12  0  8  7  9 11 -2]\nProbably 5,4,1 are Credit cards\n2,3 Debit\nSame for Category 3 (which is group of installments)\n5 [3 2 0 1 4]\n2 [1 2 3 0 4]\n3 [1 2 3 0 4]\n1 [2 3 0 1 4]\n4 [2 3 0 1 4]\n\nFeature 2 / Number of unique merchants\n1 107218\n2 215282\n3 231060\nProbably 1 - International brand (Diners?)\n2-3 (Elo own Cards) ",
      "votes": 1
    },
    {
      "id": 464831,
      "postDate": "2019-02-01T15:38:49.283Z",
      "content": "<p><a href=\"/pracas\">@pracas</a> you may try this feature from merchants (some kind of popularity/activity metric)\nthere are all card ids (for train and test)\nAnd I think that\n- - 33 -&gt; Closed Accounts</p>",
      "rawMarkdown": "@pracas you may try this feature from merchants (some kind of popularity/activity metric)\nthere are all card ids (for train and test)\nAnd I think that\n- - 33 -&gt; Closed Accounts",
      "votes": 2,
      "replies": [
        {
          "id": 465485,
          "postDate": "2019-02-03T08:38:17.983Z",
          "content": "<p>I did a kmeans on merchants sometime back but haven't used it yet. Keeping it for the last. \nThis thread means merchants.csv could be interesting. <a href=\"https://www.kaggle.com/c/elo-merchant-category-recommendation/discussion/79304\">https://www.kaggle.com/c/elo-merchant-category-recommendation/discussion/79304</a></p>",
          "rawMarkdown": "I did a kmeans on merchants sometime back but haven't used it yet. Keeping it for the last. \nThis thread means merchants.csv could be interesting. https://www.kaggle.com/c/elo-merchant-category-recommendation/discussion/79304"
        }
      ]
    },
    {
      "id": 463087,
      "postDate": "2019-01-29T11:32:55.187Z",
      "content": "<p>More from my experience till now.</p>\n\n<p>30 features\nlocal 5 fold cv single model LGBMRegressor - 3.63546\nLB - 3.689</p>\n\n<p>Features used:\n'feature_1', 'feature_2', 'feature_3', \n'first_active_month',\n'purchase_date' (old and new transactions)\n'purchase_amount' (old and new transactions)</p>\n\n<p>'category_1' (old and new transactions),\n'category_2 (old and new transactions),\n'category_3' (old and new transactions),</p>\n\n<p>'installments' (old transactions)</p>\n\n<p>I believe that huge gap in cv and lb comes from 'category_1'\nI also believe that we all doing something wrong with massive aggregations there should be other approach.</p>",
      "rawMarkdown": "More from my experience till now.\n\n30 features\nlocal 5 fold cv single model LGBMRegressor - 3.63546\nLB - 3.689\n\nFeatures used:\n'feature_1', 'feature_2', 'feature_3', \n'first_active_month',\n'purchase_date' (old and new transactions)\n'purchase_amount' (old and new transactions)\n\n'category_1' (old and new transactions),\n'category_2 (old and new transactions),\n'category_3' (old and new transactions),\n\n'installments' (old transactions)\n\nI believe that huge gap in cv and lb comes from 'category_1'\nI also believe that we all doing something wrong with massive aggregations there should be other approach.",
      "votes": 2,
      "replies": [
        {
          "id": 463463,
          "postDate": "2019-01-30T03:08:10.573Z",
          "content": "<p><a href=\"/kyakovlev\">@kyakovlev</a> Thank you for your insights! I have a question - how did you find theses 30 features? Which feature selection strategy did you use?</p>",
          "rawMarkdown": "@kyakovlev Thank you for your insights! I have a question - how did you find theses 30 features? Which feature selection strategy did you use?"
        },
        {
          "id": 463637,
          "postDate": "2019-01-30T10:33:18.690Z",
          "content": "<p>It is not a strategy for the final model, but it can give you some insights:</p>\n\n<ol>\n<li>Split train data 1/10 for train and validation set</li>\n<li>Prepare all possible features (even mad ones)</li>\n<li>To the \"base feature set\" (feature 1,2,3)  add your features one by one (add/check score/remove) and see what element has a greater impact on your new train and new validation set score. The best feature include to \"base feature set\" -&gt;&gt; repeat step 3. If no improvement then stop.\nHope you will not do this manually (on 400+ features) - try to create some pipeline.</li>\n</ol>\n\n<p>Such approach will give you importances of features by a group.\nRank/Feature name/Main train set CV (not the splitted one)\n1    base list 3.8489825669822957\n2    global_\"some_feature\"    3.79805646993044\n3    na_\"some_feature\"    3.7666920623205624 <br>\n4    new_\"some_feature\"   3.7355999870516707\n5    hist_\"some_feature\"    3.7160250738394365\n6    new_\"some_feature\"    3.6928149838572466 \n7    hist_\"some_feature\"    3.6813351718831604 <br>\n8    new_\"some_feature\"    3.6709096900087004 <br>\n9    hist_\"some_feature\"    3.6669050721719816 (here the model with 12 features has 3.66 cv)\n...</p>\n\n<p>With such table you'll be able to find the most important ones and develop new better (final) features.</p>",
          "rawMarkdown": "It is not a strategy for the final model, but it can give you some insights:\n\n1. Split train data 1/10 for train and validation set\n2. Prepare all possible features (even mad ones)\n3. To the \"base feature set\" (feature 1,2,3)  add your features one by one (add/check score/remove) and see what element has a greater impact on your new train and new validation set score. The best feature include to \"base feature set\" -&gt;&gt; repeat step 3. If no improvement then stop.\nHope you will not do this manually (on 400+ features) - try to create some pipeline.\n\nSuch approach will give you importances of features by a group.\nRank/Feature name/Main train set CV (not the splitted one)\n1    base list 3.8489825669822957\n2    global_\"some_feature\"    3.79805646993044\n3    na_\"some_feature\"    3.7666920623205624  \n4    new_\"some_feature\"   3.7355999870516707\n5    hist_\"some_feature\"    3.7160250738394365\n6    new_\"some_feature\"    3.6928149838572466 \n7    hist_\"some_feature\"    3.6813351718831604    \n8    new_\"some_feature\"    3.6709096900087004  \n9    hist_\"some_feature\"    3.6669050721719816 (here the model with 12 features has 3.66 cv)\n...\n\nWith such table you'll be able to find the most important ones and develop new better (final) features.",
          "votes": 3
        },
        {
          "id": 463638,
          "postDate": "2019-01-30T10:37:50.770Z",
          "content": "<p>Also you may try to use some feature extraction technics using this library\n<a href=\"http://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/\">http://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/</a></p>",
          "rawMarkdown": "Also you may try to use some feature extraction technics using this library\nhttp://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/",
          "votes": 2
        },
        {
          "id": 463737,
          "postDate": "2019-01-30T13:59:50.010Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 463739,
          "postDate": "2019-01-30T14:03:40.843Z",
          "content": "<p>fixed, thank you</p>",
          "rawMarkdown": "fixed, thank you"
        },
        {
          "id": 463750,
          "postDate": "2019-01-30T14:27:53.297Z",
          "content": "<p>Hah,so quickly! </p>",
          "rawMarkdown": "Hah,so quickly! "
        },
        {
          "id": 465183,
          "postDate": "2019-02-02T14:42:18.493Z",
          "content": "<p>Do you mind telling me why you believe the huge gap comes from 'category_1'?</p>",
          "rawMarkdown": "Do you mind telling me why you believe the huge gap comes from 'category_1'?"
        },
        {
          "id": 471651,
          "postDate": "2019-02-14T18:06:04.217Z",
          "content": "<p>for here the model with 12 features has 3.66 cv, you mean 12 features or 12 feature groups? the latter may beyond 12 features</p>",
          "rawMarkdown": "for here the model with 12 features has 3.66 cv, you mean 12 features or 12 feature groups? the latter may beyond 12 features"
        },
        {
          "id": 471843,
          "postDate": "2019-02-15T01:12:54.820Z",
          "content": "<p>12 features.</p>",
          "rawMarkdown": "12 features."
        }
      ]
    },
    {
      "id": 462630,
      "postDate": "2019-01-28T16:09:42.217Z",
      "content": "<p>Here is a good picture for the beginning of the year 2018.\nDifferences in points(calculation) for the different type of Brazilian cards (also Elo).\nIf loyalty score depends on cardholder \"points balance\" we have to implement a weighted feature in the model.\nIn the table you can find coefficients and expiration periods\n<a href=\"https://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/\">https://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/</a></p>",
      "rawMarkdown": "Here is a good picture for the beginning of the year 2018.\nDifferences in points(calculation) for the different type of Brazilian cards (also Elo).\nIf loyalty score depends on cardholder \"points balance\" we have to implement a weighted feature in the model.\nIn the table you can find coefficients and expiration periods\nhttps://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/",
      "votes": 2
    },
    {
      "id": 465706,
      "postDate": "2019-02-03T20:18:09.360Z",
      "content": "<p><a href=\"/lishaozhe1992\">@lishaozhe1992</a> here is a picture of cv/lb gap \nthere is a spike after adding category 1 based features</p>",
      "rawMarkdown": "@lishaozhe1992 here is a picture of cv/lb gap \nthere is a spike after adding category 1 based features"
    },
    {
      "id": 464437,
      "postDate": "2019-01-31T21:38:35.900Z",
      "content": "<p>Still fighting \"category 1\" overfitting\nWas able to reduce CV/LB gap to 0.0358  (very limited set of features aprx 40 with single not tuned model)\nCV: 3.657158188\nLB: 3.693\nHow you deal with category 1?\nNormal agg sum works good on CV but has drastic \"overfitting\"   effect on LB\nI think that Category 1 is international and internet transactions and probably with separation it is possible to reduce gap.</p>",
      "rawMarkdown": "Still fighting \"category 1\" overfitting\nWas able to reduce CV/LB gap to 0.0358  (very limited set of features aprx 40 with single not tuned model)\nCV: 3.657158188\nLB: 3.693\nHow you deal with category 1?\nNormal agg sum works good on CV but has drastic \"overfitting\" \teffect on LB\nI think that Category 1 is international and internet transactions and probably with separation it is possible to reduce gap.",
      "replies": [
        {
          "id": 464488,
          "postDate": "2019-02-01T00:59:03.073Z",
          "content": "<p><a href=\"/kyakovlev\">@kyakovlev</a> Are you using merchants.csv?</p>",
          "rawMarkdown": "@kyakovlev Are you using merchants.csv?"
        },
        {
          "id": 464495,
          "postDate": "2019-02-01T01:27:56.610Z",
          "content": "<p>Not yet\nBut, category_1 and category_4 in merchant.csv have also dependences  to geo features (city state)\nprobably there is some connection</p>",
          "rawMarkdown": "Not yet\nBut, category_1 and category_4 in merchant.csv have also dependences  to geo features (city state)\nprobably there is some connection"
        },
        {
          "id": 464797,
          "postDate": "2019-02-01T14:20:37.563Z",
          "content": "<p>Category1 in transactions? yes these seem to have a lot of effect. Its in the top 10 features. Been trying to run those separations and the kernel simply fails. have you figured out how to use merchants.csv? </p>",
          "rawMarkdown": "Category1 in transactions? yes these seem to have a lot of effect. Its in the top 10 features. Been trying to run those separations and the kernel simply fails. have you figured out how to use merchants.csv? "
        },
        {
          "id": 464820,
          "postDate": "2019-02-01T15:07:43.623Z",
          "content": "<p>I had some ideas about it but didn't try yet\n1. Create a rating and popularity scale for each merchant\n2. Kmeans\n3. Merge merchant data to historical transactions and do embedding using keras or one of sklearn.decomposition\n4. Target mean by category\n5. Adjust historical sales category 1 and category 3 using info from the merchant DF\n6. Normal aggregations\n7. Calculate CAC/Churn/CSS etc\nand many other ideas but have no time do check all of them))</p>\n\n<p>I think merchants have to add 0.01-0.03 gain to the model </p>",
          "rawMarkdown": "I had some ideas about it but didn't try yet\n1. Create a rating and popularity scale for each merchant\n2. Kmeans\n3. Merge merchant data to historical transactions and do embedding using keras or one of sklearn.decomposition\n4. Target mean by category\n5. Adjust historical sales category 1 and category 3 using info from the merchant DF\n6. Normal aggregations\n7. Calculate CAC/Churn/CSS etc\nand many other ideas but have no time do check all of them))\n\nI think merchants have to add 0.01-0.03 gain to the model "
        },
        {
          "id": 469163,
          "postDate": "2019-02-10T16:14:50.820Z",
          "content": "<p>Have you tried processing the whole set of transactions as a time series? Maybe extract month-wise transactions for all customers for 12 + 2 months and then trying to solve it as a time series? what are your thoughts on this? </p>",
          "rawMarkdown": "Have you tried processing the whole set of transactions as a time series? Maybe extract month-wise transactions for all customers for 12 + 2 months and then trying to solve it as a time series? what are your thoughts on this? \n"
        }
      ]
    },
    {
      "id": 463007,
      "postDate": "2019-01-29T08:25:11.907Z",
      "content": "<p>These are 2 things i can confirm based on my analysis. \nFeature_1 is related to the elapsed time from the first active month feature\nFeature_3 is a feature derived from Feature_1 \nFeature_2 is still a mystery</p>",
      "rawMarkdown": "These are 2 things i can confirm based on my analysis. \nFeature_1 is related to the elapsed time from the first active month feature\nFeature_3 is a feature derived from Feature_1 \nFeature_2 is still a mystery",
      "replies": [
        {
          "id": 463060,
          "postDate": "2019-01-29T10:31:32.493Z",
          "content": "<p>Can you provide more info about Feature 1 (your findings)?</p>\n\n<p>In case the feature 1 is a Elo card type the connection could be through launch of the new product.\nUntil day X were y card types -&gt; X1 launch y1 card</p>",
          "rawMarkdown": "Can you provide more info about Feature 1 (your findings)?\n\nIn case the feature 1 is a Elo card type the connection could be through launch of the new product.\nUntil day X were y card types -&gt; X1 launch y1 card"
        },
        {
          "id": 463064,
          "postDate": "2019-01-29T10:40:39.857Z",
          "content": "<p>do you mean that 'does the card_id change in some format based on feature_1? '  Haven't done any analysis on that. </p>",
          "rawMarkdown": "do you mean that 'does the card_id change in some format based on feature_1? '  Haven't done any analysis on that. "
        },
        {
          "id": 463075,
          "postDate": "2019-01-29T11:09:37.607Z",
          "content": "<p>Sorry for my bad explanation.\nI think that there could be a connection between feature 1 and \"start active month\" because of \"product launch time\".</p>\n\n<p>Let's think about feature 1 as a product type\nImagine that before 2017 there was no \"Elo mega-platinum credit card\".\nSo you will not find card id with some feature 1 before day X</p>",
          "rawMarkdown": "Sorry for my bad explanation.\nI think that there could be a connection between feature 1 and \"start active month\" because of \"product launch time\".\n\nLet's think about feature 1 as a product type\nImagine that before 2017 there was no \"Elo mega-platinum credit card\".\nSo you will not find card id with some feature 1 before day X"
        },
        {
          "id": 463484,
          "postDate": "2019-01-30T04:12:45.997Z",
          "content": "<p>Feature_1 , count of val 1,2,&amp;4 add up to count of Feature 3, Val 0\nFeature_1 , count of val 3&amp;5 add up to count of Feature 3, Val 1\nFeature_3, Val 0 has life lesser than around 1200 days and Val 1 greater than that\nSo Feature_3 is kind of redundant.. \nFor me both these are way down the Feature_importance list with around 100 features [ all aggregrations]\nI'm still learning to work with lightgbm.. maybe once i get that going the scores will improve..\nI had done some testing with assumptions that feature_1 being something important and split data accordingly, train and test... it did not work out to be better</p>\n\n<p>Does reducing the features improve the results? how was your CV score before you reduced the features?</p>",
          "rawMarkdown": "Feature_1 , count of val 1,2,&amp;4 add up to count of Feature 3, Val 0\nFeature_1 , count of val 3&amp;5 add up to count of Feature 3, Val 1\nFeature_3, Val 0 has life lesser than around 1200 days and Val 1 greater than that\nSo Feature_3 is kind of redundant.. \nFor me both these are way down the Feature_importance list with around 100 features [ all aggregrations]\nI'm still learning to work with lightgbm.. maybe once i get that going the scores will improve..\nI had done some testing with assumptions that feature_1 being something important and split data accordingly, train and test... it did not work out to be better\n\nDoes reducing the features improve the results? how was your CV score before you reduced the features?"
        },
        {
          "id": 463762,
          "postDate": "2019-01-30T15:10:41.670Z",
          "content": "<p>oops.. for some reason the rest of the posts, in the discussion was not visible yesterday when i replied... now i see more details on your theory...\nAS for Category 3  historic cat3 value 'c' seems to correspond to instalments other than 0 or 1, 'A' seems to be only 0 instalments and 'B' for 1 instalments</p>",
          "rawMarkdown": "oops.. for some reason the rest of the posts, in the discussion was not visible yesterday when i replied... now i see more details on your theory...\nAS for Category 3  historic cat3 value 'c' seems to correspond to instalments other than 0 or 1, 'A' seems to be only 0 instalments and 'B' for 1 instalments"
        }
      ]
    },
    {
      "id": 462621,
      "postDate": "2019-01-28T15:50:30.130Z",
      "content": "<p><a href=\"https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf\">https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf</a>\nMerchant Category codes\nWe have anonymized categories BUT for some big companies (mostly for travel - airlines, hotels) have own category code.\nProbably we can separate some travel transactions by size of merchant ids in merchant category id</p>",
      "rawMarkdown": "https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf\nMerchant Category codes\nWe have anonymized categories BUT for some big companies (mostly for travel - airlines, hotels) have own category code.\nProbably we can separate some travel transactions by size of merchant ids in merchant category id\n"
    }
  ],
  "comments": [
    {
      "id": 462676,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-28T17:49:00.703000",
      "content": "<p>Some info from Elo API\nProbably some of these parameters  are used in Scoring\nWe can get some of them from historical transactions by aggregating</p>\n\n#\n\n<p>The card number (PAN - Primary Account Number) is segmented by prefixes called \"BIN\", which stands for Bank Identification Number.</p>\n\n<p>Once the BIN is recognized, you can then consult the system using various attributes, such as:</p>\n\n<ul>\n<li>What is the country of origin (home) of the card? BIN { country }</li>\n<li>Can the card be used internationally? BIN { isInternational }</li>\n<li>What is the funding of the card? Credit, debit, multiple (both)? BIN { funding }</li>\n<li>Is it a corporate or individual card? BIN { isCompany }</li>\n<li>Is it a real or virtual card (CardToken)? BIN { isToken }</li>\n<li>Where can I capture card? (e.g. ATM, Point of Sale, Internet ...) BIN { allowedCaptures }</li>\n<li>What kind of use is it for? (e.g. credit at sight, credit in installments by the store, debit...) BIN { usage }</li>\n<li>What is the card provider? BIN { brand }</li>\n<li>On which network can the card be used? (e.g. Elo, Elo-Discovery...) BIN { cardNetwork }</li>\n<li>Who is the issuer (bank) of the card? BIN { issuer }</li>\n<li>Which cardholder services are offered? (e.g. Travel Insurance) BIN { services }</li>\n</ul>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 462521,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-28T12:49:46.707000",
      "content": "<p>Lets check:\nFeature 1 has 5 unique values [installments Uniques are returned in order of appearance]\n5 [ 3  2  1  5  6  4 -1  0 10  8  7 12 11  9 -2]\n2 [ 0  1  2  5  4  3  6 12 -1 10  7  8  9 11 -2]\n3 [ 0  1  3 -1  4  6  2  5 12 10 11  8  7  9 -2]\n1 [ 1  2 -1  3  6 10  0  5 12  9  4  8  7 11 -2]\n4 [ 1  2  6 -1  3 10  5  4 12  0  8  7  9 11 -2]\nProbably 5,4,1 are Credit cards\n2,3 Debit\nSame for Category 3 (which is group of installments)\n5 [3 2 0 1 4]\n2 [1 2 3 0 4]\n3 [1 2 3 0 4]\n1 [2 3 0 1 4]\n4 [2 3 0 1 4]</p>\n\n<p>Feature 2 / Number of unique merchants\n1 107218\n2 215282\n3 231060\nProbably 1 - International brand (Diners?)\n2-3 (Elo own Cards) </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 464831,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-02-01T15:38:49.283000",
      "content": "<p><a href=\"/pracas\">@pracas</a> you may try this feature from merchants (some kind of popularity/activity metric)\nthere are all card ids (for train and test)\nAnd I think that\n- - 33 -&gt; Closed Accounts</p>",
      "votes": 2,
      "replies": [
        {
          "id": 465485,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-02-03T08:38:17.983000",
          "content": "<p>I did a kmeans on merchants sometime back but haven't used it yet. Keeping it for the last. \nThis thread means merchants.csv could be interesting. <a href=\"https://www.kaggle.com/c/elo-merchant-category-recommendation/discussion/79304\">https://www.kaggle.com/c/elo-merchant-category-recommendation/discussion/79304</a></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 463087,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-29T11:32:55.187000",
      "content": "<p>More from my experience till now.</p>\n\n<p>30 features\nlocal 5 fold cv single model LGBMRegressor - 3.63546\nLB - 3.689</p>\n\n<p>Features used:\n'feature_1', 'feature_2', 'feature_3', \n'first_active_month',\n'purchase_date' (old and new transactions)\n'purchase_amount' (old and new transactions)</p>\n\n<p>'category_1' (old and new transactions),\n'category_2 (old and new transactions),\n'category_3' (old and new transactions),</p>\n\n<p>'installments' (old transactions)</p>\n\n<p>I believe that huge gap in cv and lb comes from 'category_1'\nI also believe that we all doing something wrong with massive aggregations there should be other approach.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 463463,
          "author_name": "Aditya Vyas",
          "author_url": "",
          "post_date": "2019-01-30T03:08:10.573000",
          "content": "<p><a href=\"/kyakovlev\">@kyakovlev</a> Thank you for your insights! I have a question - how did you find theses 30 features? Which feature selection strategy did you use?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463637,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-01-30T10:33:18.690000",
          "content": "<p>It is not a strategy for the final model, but it can give you some insights:</p>\n\n<ol>\n<li>Split train data 1/10 for train and validation set</li>\n<li>Prepare all possible features (even mad ones)</li>\n<li>To the \"base feature set\" (feature 1,2,3)  add your features one by one (add/check score/remove) and see what element has a greater impact on your new train and new validation set score. The best feature include to \"base feature set\" -&gt;&gt; repeat step 3. If no improvement then stop.\nHope you will not do this manually (on 400+ features) - try to create some pipeline.</li>\n</ol>\n\n<p>Such approach will give you importances of features by a group.\nRank/Feature name/Main train set CV (not the splitted one)\n1    base list 3.8489825669822957\n2    global_\"some_feature\"    3.79805646993044\n3    na_\"some_feature\"    3.7666920623205624 <br>\n4    new_\"some_feature\"   3.7355999870516707\n5    hist_\"some_feature\"    3.7160250738394365\n6    new_\"some_feature\"    3.6928149838572466 \n7    hist_\"some_feature\"    3.6813351718831604 <br>\n8    new_\"some_feature\"    3.6709096900087004 <br>\n9    hist_\"some_feature\"    3.6669050721719816 (here the model with 12 features has 3.66 cv)\n...</p>\n\n<p>With such table you'll be able to find the most important ones and develop new better (final) features.</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 463638,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-01-30T10:37:50.770000",
          "content": "<p>Also you may try to use some feature extraction technics using this library\n<a href=\"http://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/\">http://rasbt.github.io/mlxtend/user_guide/feature_selection/SequentialFeatureSelector/</a></p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 463737,
          "author_name": "",
          "author_url": "",
          "post_date": "2019-01-30T13:59:50.010000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463739,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-01-30T14:03:40.843000",
          "content": "<p>fixed, thank you</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463750,
          "author_name": "kwang",
          "author_url": "",
          "post_date": "2019-01-30T14:27:53.297000",
          "content": "<p>Hah,so quickly! </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 465183,
          "author_name": "Lisz",
          "author_url": "",
          "post_date": "2019-02-02T14:42:18.493000",
          "content": "<p>Do you mind telling me why you believe the huge gap comes from 'category_1'?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 471651,
          "author_name": "🐳鲲(China)",
          "author_url": "",
          "post_date": "2019-02-14T18:06:04.217000",
          "content": "<p>for here the model with 12 features has 3.66 cv, you mean 12 features or 12 feature groups? the latter may beyond 12 features</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 471843,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-02-15T01:12:54.820000",
          "content": "<p>12 features.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 462630,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-28T16:09:42.217000",
      "content": "<p>Here is a good picture for the beginning of the year 2018.\nDifferences in points(calculation) for the different type of Brazilian cards (also Elo).\nIf loyalty score depends on cardholder \"points balance\" we have to implement a weighted feature in the model.\nIn the table you can find coefficients and expiration periods\n<a href=\"https://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/\">https://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/</a></p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 465706,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-02-03T20:18:09.360000",
      "content": "<p><a href=\"/lishaozhe1992\">@lishaozhe1992</a> here is a picture of cv/lb gap \nthere is a spike after adding category 1 based features</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 464437,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-31T21:38:35.900000",
      "content": "<p>Still fighting \"category 1\" overfitting\nWas able to reduce CV/LB gap to 0.0358  (very limited set of features aprx 40 with single not tuned model)\nCV: 3.657158188\nLB: 3.693\nHow you deal with category 1?\nNormal agg sum works good on CV but has drastic \"overfitting\"   effect on LB\nI think that Category 1 is international and internet transactions and probably with separation it is possible to reduce gap.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 464488,
          "author_name": "Aditya Vyas",
          "author_url": "",
          "post_date": "2019-02-01T00:59:03.073000",
          "content": "<p><a href=\"/kyakovlev\">@kyakovlev</a> Are you using merchants.csv?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 464495,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-02-01T01:27:56.610000",
          "content": "<p>Not yet\nBut, category_1 and category_4 in merchant.csv have also dependences  to geo features (city state)\nprobably there is some connection</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 464797,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-02-01T14:20:37.563000",
          "content": "<p>Category1 in transactions? yes these seem to have a lot of effect. Its in the top 10 features. Been trying to run those separations and the kernel simply fails. have you figured out how to use merchants.csv? </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 464820,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-02-01T15:07:43.623000",
          "content": "<p>I had some ideas about it but didn't try yet\n1. Create a rating and popularity scale for each merchant\n2. Kmeans\n3. Merge merchant data to historical transactions and do embedding using keras or one of sklearn.decomposition\n4. Target mean by category\n5. Adjust historical sales category 1 and category 3 using info from the merchant DF\n6. Normal aggregations\n7. Calculate CAC/Churn/CSS etc\nand many other ideas but have no time do check all of them))</p>\n\n<p>I think merchants have to add 0.01-0.03 gain to the model </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 469163,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-02-10T16:14:50.820000",
          "content": "<p>Have you tried processing the whole set of transactions as a time series? Maybe extract month-wise transactions for all customers for 12 + 2 months and then trying to solve it as a time series? what are your thoughts on this? </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 463007,
      "author_name": "RVPrakash",
      "author_url": "",
      "post_date": "2019-01-29T08:25:11.907000",
      "content": "<p>These are 2 things i can confirm based on my analysis. \nFeature_1 is related to the elapsed time from the first active month feature\nFeature_3 is a feature derived from Feature_1 \nFeature_2 is still a mystery</p>",
      "votes": 0,
      "replies": [
        {
          "id": 463060,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-01-29T10:31:32.493000",
          "content": "<p>Can you provide more info about Feature 1 (your findings)?</p>\n\n<p>In case the feature 1 is a Elo card type the connection could be through launch of the new product.\nUntil day X were y card types -&gt; X1 launch y1 card</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463064,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-01-29T10:40:39.857000",
          "content": "<p>do you mean that 'does the card_id change in some format based on feature_1? '  Haven't done any analysis on that. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463075,
          "author_name": "Konstantin Yakovlev",
          "author_url": "",
          "post_date": "2019-01-29T11:09:37.607000",
          "content": "<p>Sorry for my bad explanation.\nI think that there could be a connection between feature 1 and \"start active month\" because of \"product launch time\".</p>\n\n<p>Let's think about feature 1 as a product type\nImagine that before 2017 there was no \"Elo mega-platinum credit card\".\nSo you will not find card id with some feature 1 before day X</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463484,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-01-30T04:12:45.997000",
          "content": "<p>Feature_1 , count of val 1,2,&amp;4 add up to count of Feature 3, Val 0\nFeature_1 , count of val 3&amp;5 add up to count of Feature 3, Val 1\nFeature_3, Val 0 has life lesser than around 1200 days and Val 1 greater than that\nSo Feature_3 is kind of redundant.. \nFor me both these are way down the Feature_importance list with around 100 features [ all aggregrations]\nI'm still learning to work with lightgbm.. maybe once i get that going the scores will improve..\nI had done some testing with assumptions that feature_1 being something important and split data accordingly, train and test... it did not work out to be better</p>\n\n<p>Does reducing the features improve the results? how was your CV score before you reduced the features?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 463762,
          "author_name": "RVPrakash",
          "author_url": "",
          "post_date": "2019-01-30T15:10:41.670000",
          "content": "<p>oops.. for some reason the rest of the posts, in the discussion was not visible yesterday when i replied... now i see more details on your theory...\nAS for Category 3  historic cat3 value 'c' seems to correspond to instalments other than 0 or 1, 'A' seems to be only 0 instalments and 'B' for 1 instalments</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 462621,
      "author_name": "Konstantin Yakovlev",
      "author_url": "",
      "post_date": "2019-01-28T15:50:30.130000",
      "content": "<p><a href=\"https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf\">https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf</a>\nMerchant Category codes\nWe have anonymized categories BUT for some big companies (mostly for travel - airlines, hotels) have own category code.\nProbably we can separate some travel transactions by size of merchant ids in merchant category id</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "462462": "Any theories what these features are?\n\nI think that such stable card related feature should be card type\n - Feature 1 - Card type (https://elo.com.br/produtos/pessoais) (Debit/Credit/Both/International/Nacional/etc)\n - Feature 2 - Processing company (Elo, Diners, Discover)\n - Feature 3 - Personal/Business \nSomething like this",
    "462676": "Some info from Elo API\nProbably some of these parameters  are used in Scoring\nWe can get some of them from historical transactions by aggregating\n\n########\nThe card number (PAN - Primary Account Number) is segmented by prefixes called \"BIN\", which stands for Bank Identification Number.\n\nOnce the BIN is recognized, you can then consult the system using various attributes, such as:\n\n- What is the country of origin (home) of the card? BIN { country }\n- Can the card be used internationally? BIN { isInternational }\n- What is the funding of the card? Credit, debit, multiple (both)? BIN { funding }\n- Is it a corporate or individual card? BIN { isCompany }\n- Is it a real or virtual card (CardToken)? BIN { isToken }\n- Where can I capture card? (e.g. ATM, Point of Sale, Internet ...) BIN { allowedCaptures }\n- What kind of use is it for? (e.g. credit at sight, credit in installments by the store, debit...) BIN { usage }\n- What is the card provider? BIN { brand }\n- On which network can the card be used? (e.g. Elo, Elo-Discovery...) BIN { cardNetwork }\n- Who is the issuer (bank) of the card? BIN { issuer }\n- Which cardholder services are offered? (e.g. Travel Insurance) BIN { services }",
    "462521": "Lets check:\nFeature 1 has 5 unique values [installments Uniques are returned in order of appearance]\n5 [ 3  2  1  5  6  4 -1  0 10  8  7 12 11  9 -2]\n2 [ 0  1  2  5  4  3  6 12 -1 10  7  8  9 11 -2]\n3 [ 0  1  3 -1  4  6  2  5 12 10 11  8  7  9 -2]\n1 [ 1  2 -1  3  6 10  0  5 12  9  4  8  7 11 -2]\n4 [ 1  2  6 -1  3 10  5  4 12  0  8  7  9 11 -2]\nProbably 5,4,1 are Credit cards\n2,3 Debit\nSame for Category 3 (which is group of installments)\n5 [3 2 0 1 4]\n2 [1 2 3 0 4]\n3 [1 2 3 0 4]\n1 [2 3 0 1 4]\n4 [2 3 0 1 4]\n\nFeature 2 / Number of unique merchants\n1 107218\n2 215282\n3 231060\nProbably 1 - International brand (Diners?)\n2-3 (Elo own Cards) ",
    "464831": "@pracas you may try this feature from merchants (some kind of popularity/activity metric)\nthere are all card ids (for train and test)\nAnd I think that\n- - 33 -&gt; Closed Accounts",
    "463087": "More from my experience till now.\n\n30 features\nlocal 5 fold cv single model LGBMRegressor - 3.63546\nLB - 3.689\n\nFeatures used:\n'feature_1', 'feature_2', 'feature_3', \n'first_active_month',\n'purchase_date' (old and new transactions)\n'purchase_amount' (old and new transactions)\n\n'category_1' (old and new transactions),\n'category_2 (old and new transactions),\n'category_3' (old and new transactions),\n\n'installments' (old transactions)\n\nI believe that huge gap in cv and lb comes from 'category_1'\nI also believe that we all doing something wrong with massive aggregations there should be other approach.",
    "462630": "Here is a good picture for the beginning of the year 2018.\nDifferences in points(calculation) for the different type of Brazilian cards (also Elo).\nIf loyalty score depends on cardholder \"points balance\" we have to implement a weighted feature in the model.\nIn the table you can find coefficients and expiration periods\nhttps://exame.abril.com.br/seu-dinheiro/os-melhores-e-piores-cartoes-de-credito-para-acumular-pontos-2/",
    "465706": "@lishaozhe1992 here is a picture of cv/lb gap \nthere is a spike after adding category 1 based features",
    "464437": "Still fighting \"category 1\" overfitting\nWas able to reduce CV/LB gap to 0.0358  (very limited set of features aprx 40 with single not tuned model)\nCV: 3.657158188\nLB: 3.693\nHow you deal with category 1?\nNormal agg sum works good on CV but has drastic \"overfitting\" \teffect on LB\nI think that Category 1 is international and internet transactions and probably with separation it is possible to reduce gap.",
    "463007": "These are 2 things i can confirm based on my analysis. \nFeature_1 is related to the elapsed time from the first active month feature\nFeature_3 is a feature derived from Feature_1 \nFeature_2 is still a mystery",
    "462621": "https://www.dm.usda.gov/procurement/card/card_x/mcc.pdf\nMerchant Category codes\nWe have anonymized categories BUT for some big companies (mostly for travel - airlines, hotels) have own category code.\nProbably we can separate some travel transactions by size of merchant ids in merchant category id\n"
  }
}