Closed strubled closed 4 years ago
i've figured out how to store the transaction values and determine the winner per category. the problem is the annual fee. i just tried to do something where i found the top winners, and counted how many times they won (e.g. say if capital one won 3 categories), then found their annual fee and divided by the number of categories it won, then re-evaluated if that new value per category was enough to win (e.g. originally their grocery value may have been $200, but after subtracting a $100 annual fee, the total value is $100, so now they likely lose to another card).
the problem is that ends up making everything change, and i'm not sure you can write enough if statements to figure it all out. example, if capital one no longer wins 3, and only wins 2, and now i move onto another category like gas and find they don't win that either, now they're down to 1 win, which if it has a high annual fee probably makes it lose that category too, which makes some other card win, but now we need to check the annual fee on the new winning card and after subtracting it's value probably ends up losing to some other card...just doesn't seem like this path works.
i'm thinking we have to factor in the annual fee BEFORE evaluating against the other cards. we could do this in maybe a couple different ways:
another idea is to roll with 1 - 3 above and instead of recommending 1 card per category, we could recommend a few cards that end up with values roughly the same and add an asterisk or something. that seems lame.
one other idea is...
I wracked my brain about this last night. I’m going to talk to Juan and see if he has any ideas. There has to be a way to do this.
Sent from my iPhone
On May 21, 2020, at 9:59 PM, Dan Struble notifications@github.com wrote:
i've figured out how to store the transaction values and determine the winner per category. the problem is the annual fee. i just tried to do something where i found the top winners, and counted how many times they won (e.g. say if capital one won 3 categories), then found their annual fee and divided by the number of categories it won, then re-evaluated if that new value per category was enough to win (e.g. originally their grocery value may have been $200, but after subtracting a $100 annual fee, the total value is $100, so now they likely lose to another card).
the problem is that ends up making everything change, and i'm not sure you can write enough if statements to figure it all out. example, if capital one no longer wins 3, and only wins 2, and now i move onto another category like gas and find they don't win that either, now they're down to 1 win, which if it has a high annual fee probably makes it lose that category too, which makes some other card win, but now we need to check the annual fee on the new winning card and after subtracting it's value probably ends up losing to some other card...just doesn't seem like this path works.
i'm thinking we have to factor in the annual fee BEFORE evaluating against the other cards. we could do this in maybe a couple different ways:
by % of spend (I think @sknechtel you suggested this on text)...we could look at what a user's categories of spend are, and if say 50% is in the grocery spend category, we'd assume that groceries would account for 50% of the annual fee. so if it's a 2% cashback on 10000 of spend, w/ a $100 annual fee, we'd say you earn $200 - $50 = $150 by # of categories we're using...we could just divide the annual fee by 5 since we're looking at 5 categories (grocery, gas, hotel, dining, airfare, other...we're not doing amazon yet). that would mean in the same example above the annual fee would be $20 per category, so $180 by # of categories the card supports...say a travel card doesn't pay out for groceries, so only 4 categories. it would be $25 annual fee, so $175 we could gloss over this whole thing and just roll w/o an annual fee in the calculation except for the "total" value calculation. this would end up making the reco tell someone to use a particular card for a particular category when if they did that, and only that category, we're likely going to be wrong. another idea is to roll with 1 - 3 above and instead of recommending 1 card per category, we could recommend a few cards that end up with values roughly the same and add an asterisk or something. that seems lame.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I did idea # 5 above...we can always change it but i think it's fine for now. this ticket is done!
Context
https://github.com/strubled/optimizr/issues/7#issuecomment-631170776
Game Plan
Store Form Details and Card Values
transaction_category_totals
card_value
card_value
Create Reco
card_value
categories, and return the card name for the card w/ the highest value.let's consider the following possible results:
I assume we want to show the user the total amount of rewards they'll earn with each card that we recommend. in order to create the below table, we compared the results of each category - the annual fee. let's say for example the annual fee for hilton was $100. in this case, the hotel rewards were actually worth 200, airline 150 and total 500. so really we're over counting the annual fee by 200. we probably need to add even more logic that says if a card wins more than 1 category, let's say 3 categories, we have to find the annual fee and add back in 3-1 * annual fee - in this case the $200 back.
grocery_winner = capital one gas_winner = chase hotel_winner = hilton 100 airline_winner = hilton 50 dining_winner = bofa amazon_winner = amazon other_winner = hsbc total_winner = hilton 400
this is an extreme example...but for hilton, we should show they can earn $750. $100 + $50 + $400 + $200 (the annual fee we double counted).