Dependence of the solar wind plasma density on moderate- and extremely high-geomagnetic activity elucidated by potential learning