The main thing to remember is that all of the recommendations are just that, recommendations. They are not perfect. With that being said, below describes the process of determining the recommendations for lineups. Each stat that is ordered by besides speed is multiplied by the historical average for that handed batter against the throwing type of the pitcher. So if you are setting the lineup recommendations for vs. RHP, the values to determine the order will be multiplied with a value above 1 for Left handed batters and below 1 for Right handed batters to try and determine the best batter for this lineup type.
The first thing we do is go through every position finding the player with the highest Runs Created (RC) at that position. This should be a player who has a significant amount of playing time to accumulate a high RC and was good offensively. The positions are based off of the players primary positions.
For outfielders, we determine the top 3 outfielders on the team by RC. Once we have those outfielders, we choose the CF first based off of speed, the LF second based off of OBP and finally the RF is whoever is left.
If it goes through all positions to determine the starters and a position has not been filled because no player is on the team with that position as their primary position, it will look for the best player who has played at least one game at that position based off of the modified RC value for the lineup type. If there are still some positions without starters, it will look at all remaining players and ordering them by the modified RC value for the lineup type.
Once all of the starters have been found, it determines their order in the lineup. The first slot it fills is the 3 spot by choosing the starter with the best OPS. Then the 4th, 5th and 6th spots are chosen, in that order, based off of the best player remaining by HR/AB. The next player chosen is the leadoff batter ordered by SB. Then the 2 spot is filled by the best player remaining by OBP. The 7th spot is next which is ordered by SLG. Whoever is left is put into the 8 spot.