Unless your seeds are feminized, each seed has exactly a 50% chance to be female. However, this does not guarantee 50% females (as you found out), you could have more or less based on chance.

There are environmental factors that can cause the plants to turn from female to male (but not the other way around), such as an irregular light cycle or temperature stress. I think there are others, but I don't know.

Peace