It is genetically predetermined. It is already decided if they are male or female as a seed. Sinsemilla Jones is correct. Otherwise you you would be able to take feminized seeds and stress them to become male plants. This will not happen. The most that would happen is you'd cause your female plants to have a few male flowers.