Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

CBS Franchise Baseball

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    yeah. I'll see what I can do.
    In the best of times, our days are numbered, anyway. And it would be a crime against Nature for any generation to take the world crisis so solemnly that it put off enjoying those things for which we were presumably designed in the first place, and which the gravest statesmen and the hoarsest politicians hope to make available to all men in the end: I mean the opportunity to do good work, to fall in love, to enjoy friends, to sit under trees, to read, to hit a ball and bounce the baby.

    Comment


    • #17
      BTW - 9! = 362880 possible orderings, so, no, you wouldn't want to optimize that by hand .

      you could do it a bit easier in python using itertools.permutations() (it would save you all that nasty looping). doesn't java have something like that?

      Code:
      import itertools
      
      other_pitchers = [ [ 3.35, 3.22, 3.44, 4.35, 3.29 ],
                         [ 4.52, 4.35, 3.60, 3.32, 3.24 ],
                         [ 4.56, 3.22, 3.11, 4.01, 2.99 ],
                         [ 4.23, 3.38, 3.11, 3.19, 3.08 ],
                         [ 4.45, 3.03, 3.27, 3.02, 4.12 ],
                         [ 2.97, 3.03, 3.27, 2.89, 3.20 ],
                         [ 5.96, 5.89, 5.02, 5.43, 4.22 ],
                         [ 4.67, 3.12, 4.37, 3.27, 3.24 ],
                         [ 4.39, 3.78, 3.24, 3.21, 3.17 ] ]
      
      starting_pitcher = 3
      
      team_numbers = [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]
      team_names = [ "Cubs", "Bears", "Blackhawks", "Sox", "Giants", "As", "Orioles", "Reds", "Astros" ]
      
      low = 100.0
      
      for team_order in itertools.permutations(team_numbers):
          current = 0
          for ii in range(9):
              current += other_pitchers[team_order[ii]][(starting_pitcher-1+ii)%5]
          if current + .001 < low:
              low = current
              low_order = team_order
      
      line = "%5.2f: " % low
      for ii in range(9):
          line = line + team_names[low_order[ii]] + " "
      print line
      but, really, don't you want to minimize the difference between your starters and your opponents? so, like:

      Code:
      import itertools
      from math import pow
      
      my_pitchers = [ 4.13, 3.88, 3.95, 3.87, 3.42 ]
      
      other_pitchers = [ [ 3.35, 3.22, 3.44, 4.35, 3.29 ],
                         [ 4.52, 4.35, 3.60, 3.32, 3.24 ],
                         [ 4.56, 3.22, 3.11, 4.01, 2.99 ],
                         [ 4.23, 3.38, 3.11, 3.19, 3.08 ],
                         [ 4.45, 3.03, 3.27, 3.02, 4.12 ],
                         [ 2.97, 3.03, 3.27, 2.89, 3.20 ],
                         [ 5.96, 5.89, 5.02, 5.43, 4.22 ],
                         [ 4.67, 3.12, 4.37, 3.27, 3.24 ],
                         [ 4.39, 3.78, 3.24, 3.21, 3.17 ] ]
      
      starting_pitcher = 3
      
      team_numbers = [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]
      team_names = [ "Cubs", "Bears", "Blackhawks", "Sox", "Giants", "As", "Orioles", "Reds", "Astros" ]
      
      low = 100000.0
      
      for team_order in itertools.permutations(team_numbers):
          current = 0
          for ii in range(9):
              current += pow(other_pitchers[team_order[ii]][(starting_pitcher-1+ii)%5] - my_pitchers[(starting_pitcher-1+ii)%5],2)
          if current + 1.0e-6 < low:
              low = current
              low_order = team_order
      
      line = "%6.3f: " % low
      for ii in range(9):
          line = line + team_names[low_order[ii]] + " "
      print line
      ???
      "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

      Comment


      • #18
        I don't know of a built-in function to generate permutations. I was looking at using Johnson-Trotter but it was creating a stack overflow on ideone.

        What you actually want is a way to maximize that percentage chance of victory that it generates when you start the game, but I don't think I can reverse engineer that easily. It's not necessarily the case that you want the least squares since if one team has much better hitting than yours it might be better to optimize for their worse pitchers, but least squares probably is better than the primitive version I have.
        Last edited by mjl; 09-17-2014, 12:47 AM.
        In the best of times, our days are numbered, anyway. And it would be a crime against Nature for any generation to take the world crisis so solemnly that it put off enjoying those things for which we were presumably designed in the first place, and which the gravest statesmen and the hoarsest politicians hope to make available to all men in the end: I mean the opportunity to do good work, to fall in love, to enjoy friends, to sit under trees, to read, to hit a ball and bounce the baby.

        Comment


        • #19
          i think it'd be better to replace:

          current += pow(other_pitchers[team_order[ii]][(starting_pitcher-1+ii)%5] - my_pitchers[(starting_pitcher-1+ii)%5],2)

          with:

          current += (my_pitchers[(starting_pitcher-1+ii)%5] - other_pitchers[team_order[ii]][(starting_pitcher-1+ii)%5])

          you just want to maximize how much better your pitchers are than theirs. without being able to know the details of the algorithm to calculate percentage win estimates (and even with that, you'd have to enter the details of every full roster), i think looking at pitchers is the best you can do.

          ETA: oh, and sometimes python > java .
          "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

          Comment


          • #20
            a) yes, python is better here, if only because Java makes you use really awkward instantiation for the arrays, but also for the permutations function.

            b) your new algorithm is functionally identical to mine. unless you're doing something with each of the differences (squaring or whatever you like), you can rearrange that to being (sum of my pitchers) - (sum of opposing pitchers), and since sum of my pitchers is immutable...
            In the best of times, our days are numbered, anyway. And it would be a crime against Nature for any generation to take the world crisis so solemnly that it put off enjoying those things for which we were presumably designed in the first place, and which the gravest statesmen and the hoarsest politicians hope to make available to all men in the end: I mean the opportunity to do good work, to fall in love, to enjoy friends, to sit under trees, to read, to hit a ball and bounce the baby.

            Comment


            • #21
              Or, you can just play the worst pitcher among the 10 teams while eyeballing the better teams to play their worst starters. At least that's how I do it.

              If you math nerds want to play around with something, make sure you add/train the hitters who would optimize your lineup the best. Just taking a player because "I remembered he was good" or "I like this guy" won't work as well. Think of it like those Moneyball A's -- get the batters who hit singles and/or walk a lot, and then try to optimize your managers to work best with their badges.

              I now keep a spreadsheet that totals a player's 1B, 2B, 3B, HR + BB, and it opens your eyes as to who really should be the better players on your team. Yes, you do need a few sluggers to help the HR milestones, but at the sub-legend levels, those will likely be one-dimensional types. If possible, try and get HR + SB guys, but they come along infrequently (hence, CarGo on both my CBS & Facebook squads).

              Also, try and make sure your SP lists Ks as a strength on their page. Strangely, the pitcher attributes don't tell you their K rates, so it's really a guessing game as to which pitcher will K a bunch.

              The hardest milestones are the saves category, since only one pitcher will likely get you enough saves at one time. And by the time that pitcher hits the saves milestone, the other pitchers may not be good enough any longer to remain on your team.


              At Level 51+, you enter the Legends leagues, and unlike the pre-legend leagues where some teams level up but the others remain the same level, you either level up or level down. So there's 8 Legend levels and if you advance, the competition is killer.

              My record pre-legends was something like 3300-40.....then in my 3rd legend league I went 3-15!

              Comment


              • #22
                Originally posted by mjl View Post
                b) your new algorithm is functionally identical to mine. unless you're doing something with each of the differences (squaring or whatever you like), you can rearrange that to being (sum of my pitchers) - (sum of opposing pitchers), and since sum of my pitchers is immutable...
                yeah, i figured that out late last night.

                i did a bunch of training of my hitters and it made quite a difference today.

                already lost a couple of games where i was a 90/10 favorite. one where i got pounded like 13-2. those are tough to take!
                "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

                Comment


                • #23
                  Originally posted by revo View Post
                  I now keep a spreadsheet that totals a player's 1B, 2B, 3B, HR + BB,
                  isn't that done for you in the app, in the Stats tab?

                  If possible, try and get HR + SB guys, but they come along infrequently (hence, CarGo on both my CBS & Facebook squads).
                  aaron boone and drew stubbs have that combination on my team.

                  and, weirdly, jose tabata is going nuts on the basepaths for me. he has twice as many SB as anybody else (including altuve and everth cabrera).

                  Also, try and make sure your SP lists Ks as a strength on their page. Strangely, the pitcher attributes don't tell you their K rates, so it's really a guessing game as to which pitcher will K a bunch.
                  yeah, i wish they gave more information all around. i'm sure it'd be too much for many who play, but for those of us who want to dig in, it'd be nice if they exposed more of the innards.
                  "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

                  Comment


                  • #24
                    Originally posted by bryanbutler View Post
                    isn't that done for you in the app, in the Stats tab?
                    Sorry, I meant their percentage attributes, not their accumulated stats to date. When you click on your player's card, it will give you his percentages in those categories. Your best hitters will have the highest combined percentages of 1B, 2B, 3B, HR + BB. Totalling these together will make it easy for you to compare to players in the draft/free agents and see who should be replaced, and will also tell you who should continue to perform highly.

                    For example, my Glenn Beckert has 43.7% 1B (higher than anyone on my team, including Ashburn & Posey), and a combined attribute total of 96.0%. So he basically has the percentage attributes of a legend even though he isn't one -- and as such, he's batting .379 over 5,000 ABs. Meanwhile, my Juan Uribe has a combined attribute total of 71.2%, so he really should be replaced -- but he's one of my hit and HR leaders, so unfortunately I need him for the milestones.

                    If I see a player who has low combined attribute percentages and isn't close to helping in milestones, he's gotta go.

                    Comment


                    • #25
                      ahh, understood. thanks.
                      "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

                      Comment


                      • #26
                        Originally posted by revo View Post
                        The hardest milestones are the saves category, since only one pitcher will likely get you enough saves at one time. And by the time that pitcher hits the saves milestone, the other pitchers may not be good enough any longer to remain on your team.
                        trying to figure out saves. does what you say mean that if my closer reaches 25 saves, i'll clear the 5 save milestone? i'd have thought you'd need 5 different pitchers, but that would make it extremely tough, so maybe that's how they do it?
                        "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

                        Comment


                        • #27
                          Originally posted by bryanbutler View Post
                          trying to figure out saves. does what you say mean that if my closer reaches 25 saves, i'll clear the 5 save milestone? i'd have thought you'd need 5 different pitchers, but that would make it extremely tough, so maybe that's how they do it?
                          Yes, you need 5 different pitchers.

                          Comment


                          • #28
                            Originally posted by revo View Post
                            Yes, you need 5 different pitchers.
                            ugh - saves will be tough.
                            "Instead of all of this energy and effort directed at the war to end drugs, how about a little attention to drugs which will end war?" Albert Hofmann

                            Comment


                            • #29
                              Originally posted by bryanbutler View Post
                              ugh - saves will be tough.
                              Very tough.

                              Comment


                              • #30
                                bryan - clear your PMs.
                                In the best of times, our days are numbered, anyway. And it would be a crime against Nature for any generation to take the world crisis so solemnly that it put off enjoying those things for which we were presumably designed in the first place, and which the gravest statesmen and the hoarsest politicians hope to make available to all men in the end: I mean the opportunity to do good work, to fall in love, to enjoy friends, to sit under trees, to read, to hit a ball and bounce the baby.

                                Comment

                                Working...
                                X