As I understand it there are a certain % that will always be either male or female no matter what, probably about 15%. The rest are, to varying degrees, open to persuasion depending on conditions.
It's a survival machine, if it's going to be a bad season then more chance of genetic survival by being male and getting that pollen out there asap. My first 2 grows were all male which led to some reading on my part. I came across a hemp study from the 30's that showed an increase in staminate flowers with lower temps. My unheated cellar was cold, I put a heater in there and got 4 females from 5 on the 3rd grow.
A Russian study suggested that too small a pot can increase the % of males, does have some logic to it, 'Oh shit I've hit rocks, the soil is too shallow for a good grow, let's make pollen.'
Another idea I've read is to do with the temps of the water used to germinate. Too warm and it suggests that spring is late meaning a short season.
Apart from the hemp study I read it's all anecdotal but imo there's no harm in keeping an open mind and having the environment spot on just in case.