How do you calculate the risks of the LDL and HDL cholesterol ratio?

Not easily. The LDL and HDL ratio is not routinely advised. A better calculation is perhaps cholesterol minus hdl-c or non-hdl-c. In many instances this number should not exceed 30 beyond your ldl-c goal which is based on your own risk. If your ldl-c goal is 70 then non-hdl goal is 100 or less. The triglyceride/hdl ratio may be predictive of risk as well as diabetes. Some believe it should be less than 3.
My 2 cents. There is not a ton of data for the ldl-to-hdl ratio, but many of us think it is important. So, with that, my opinion (based in science) is that a ratio of less than 2-to-1 is important for those with risk for heart disease. For those with heart disease and/or diabetes i like them closer to 1.5-to-1 or less. For those at lower risk, I use 3-to-1 or better. Again, just a lipidologists opinion.
(Choles / HDL) < 3.0. It is better to have a high HDL and a low ldl. Hdl is the good and LDL is the bad cholesterol. Doctors want a patient's total cholesterol divided by HDL to be less than 3.0.