[SPARK-20764][ML][PYSPARK][FOLLOWUP] Fix visibility discrepancy with numInstances and degreesOfFreedom in LR and GLR - Python version
[SPARK-20764][ML][PYSPARK][FOLLOWUP] Fix visibility discrepancy with numInstances and degreesOfFreedom in LR and GLR - Python version

## What changes were proposed in this pull request?
Add test cases for PR-18062

## How was this patch tested?
The existing UT

Author: Peng <peng.meng@intel.com>

Closes #18068 from mpjlu/moreTest.

tejasapatil/spark,ConeyLiu/spark,alunarbeach/spark,ConeyLiu/spark,Aegeaner/spark,alunarbeach/spark,jiangxb1987/spark,joseph-torres/spark,apache/spark,WindCanDie/spark,pgandhi999/spark,esi-mineset/spark,akopich/spark,liyichao/spark,debugger87/spark,ahnqirage/spark,srowen/spark,xflin/spark,dhruve/spark,cin/spark,rednaxelafx/apache-spark,aokolnychyi/spark,xuanyuanking/spark,goldmedal/spark,dbtsai/spark,mdespriee/spark,debugger87/spark,mdespriee/spark,tejasapatil/spark,ptkool/spark,WindCanDie/spark,saturday-shi/spark,sureshthalamati/spark,mike0sv/spark,hhbyyh/spark,hvanhovell/spark,minixalpha/spark,cin/spark,xuanyuanking/spark,gengliangwang/spark,lvdongr/spark,xflin/spark,wzhfy/spark,rekhajoshm/spark,zuotingbing/spark,byakuinss/spark,ajaysaini725/spark,guoxiaolongzte/spark,wangyum/spark,michalsenkyr/spark,actuaryzhang/spark,vinodkc/spark,HyukjinKwon/spark,xflin/spark,Aegeaner/spark,panfengfeng/spark,joseph-torres/spark,vinodkc/spark,minixalpha/spark,tengpeng/spark,lxsmnv/spark,someorz/spark,sahilTakiar/spark,ericvandenbergfb/spark,1haodian/spark,hvanhovell/spark,janewangfb/spark,facaiy/spark,ueshin/apache-spark,liutang123/spark,apache/spark,pgandhi999/spark,janewangfb/spark,aokolnychyi/spark,dbtsai/spark,markhamstra/spark,ajaysaini725/spark,rekhajoshm/spark,aray/spark,zhouyejoe/spark,yanboliang/spark,shuangshuangwang/spark,jiangxb1987/spark,LantaoJin/spark,shaneknapp/spark,techaddict/spark,JoshRosen/spark,kissmetrics/spark,pgandhi999/spark,ddna1021/spark,mdespriee/spark,ajaysaini725/spark,goldmedal/spark,esi-mineset/spark,vinodkc/spark,xuanyuanking/spark,shaneknapp/spark,xflin/spark,ericvandenbergfb/spark,eyalfa/spark,janewangfb/spark,facaiy/spark,WeichenXu123/spark,BryanCutler/spark,shuangshuangwang/spark,byakuinss/spark,mike0sv/spark,brad-kaiser/spark,saturday-shi/spark,ddna1021/spark,highfei2011/spark,nlalevee/spark,rezasafi/spark,1haodian/spark,kissmetrics/spark,darionyaphet/spark,kiszk/spark,rikima/spark,cloud-fan/spark,facaiy/spark,cloud-fan/spark,milliman/spark,aokolnychyi/spark,sureshthalamati/spark,taroplus/spark,zuotingbing/spark,poffuomo/spark,Aegeaner/spark,adrian-ionescu/apache-spark,sahilTakiar/spark,hvanhovell/spark,WindCanDie/spark,bOOm-X/spark,hvanhovell/spark,dhruve/spark,nilsgrabbert/spark,nilsgrabbert/spark,skonto/spark,mdespriee/spark,shaneknapp/spark,ahnqirage/spark,kissmetrics/spark,wzhfy/spark,rezasafi/spark,alunarbeach/spark,bOOm-X/spark,minixalpha/spark,rekhajoshm/spark,ptkool/spark,mdespriee/spark,adrian-ionescu/apache-spark,milliman/spark,ddna1021/spark,maropu/spark,spark-test/spark,wzhfy/spark,liyichao/spark,eyalfa/spark,vinodkc/spark,actuaryzhang/spark,guoxiaolongzte/spark,panfengfeng/spark,mahak/spark,akopich/spark,rikima/spark,xuanyuanking/spark,wangmiao1981/spark,bdrillard/spark,nchammas/spark,skonto/spark,someorz/spark,michalsenkyr/spark,byakuinss/spark,1haodian/spark,sureshthalamati/spark,map222/spark,darionyaphet/spark,szhem/spark,jkbradley/spark,WindCanDie/spark,chuckchen/spark,mahak/spark,debugger87/spark,aokolnychyi/spark,witgo/spark,jkbradley/spark,someorz/spark,ddna1021/spark,zero323/spark,byakuinss/spark,nilsgrabbert/spark,aosagie/spark,lvdongr/spark,stanzhai/spark,kevinyu98/spark,sahilTakiar/spark,nlalevee/spark,rednaxelafx/apache-spark,zuotingbing/spark,icexelloss/spark,stanzhai/spark,wzhfy/spark,rezasafi/spark,SHASHANKB/spark,chuckchen/spark,bdrillard/spark,panfengfeng/spark,pgandhi999/spark,xflin/spark,rednaxelafx/apache-spark,ddna1021/spark,byakuinss/spark,vinodkc/spark,ajaysaini725/spark,tengpeng/spark,Aegeaner/spark,zhouyejoe/spark,narahari92/spark,ueshin/apache-spark,kiszk/spark,caneGuy/spark,zhouyejoe/spark,byakuinss/spark,jiangxb1987/spark,szhem/spark,UndeadBaneGitHub/spark,zzcclp/spark,eyalfa/spark,kevinyu98/spark,michalsenkyr/spark,witgo/spark,techaddict/spark,WeichenXu123/spark,cin/spark,skonto/spark,joseph-torres/spark,yanboliang/spark,cloud-fan/spark,liutang123/spark,aokolnychyi/spark,stanzhai/spark,goldmedal/spark,shuangshuangwang/spark,shaneknapp/spark,holdenk/spark,maropu/spark,liutang123/spark,hvanhovell/spark,kiszk/spark,rezasafi/spark,holdenk/spark,adrian-ionescu/apache-spark,goldmedal/spark,liutang123/spark,rikima/spark,shuangshuangwang/spark,BryanCutler/spark,caneGuy/spark,lvdongr/spark,sahilTakiar/spark,tengpeng/spark,chuckchen/spark,jkbradley/spark,adrian-ionescu/apache-spark,alunarbeach/spark,darionyaphet/spark,bdrillard/spark,mzl9039/spark,stanzhai/spark,ericvandenbergfb/spark,srowen/spark,dhruve/spark,maropu/spark,cin/spark,bravo-zhang/spark,1haodian/spark,rezasafi/spark,debugger87/spark,actuaryzhang/spark,rezasafi/spark,HyukjinKwon/spark,WindCanDie/spark,SHASHANKB/spark,saturday-shi/spark,zhouyejoe/spark,map222/spark,LantaoJin/spark,tejasapatil/spark,nchammas/spark,akopich/spark,HyukjinKwon/spark,chuckchen/spark,lxsmnv/spark,rekhajoshm/spark,darionyaphet/spark,saltstar/spark,mahak/spark,witgo/spark,janewangfb/spark,kiszk/spark,yanboliang/spark,nlalevee/spark,ptkool/spark,tengpeng/spark,LantaoJin/spark,narahari92/spark,zuotingbing/spark,narahari92/spark,shubhamchopra/spark,shaneknapp/spark,JoshRosen/spark,nlalevee/spark,pgandhi999/spark,joseph-torres/spark,chuckchen/spark,cloud-fan/spark,kissmetrics/spark,ueshin/apache-spark,ueshin/apache-spark,poffuomo/spark,gengliangwang/spark,wzhfy/spark,icexelloss/spark,dongjoon-hyun/spark,wangmiao1981/spark,ahnqirage/spark,highfei2011/spark,vinodkc/spark,cin/spark,shubhamchopra/spark,zzcclp/spark,rikima/spark,markhamstra/spark,UndeadBaneGitHub/spark,ioana-delaney/spark,akopich/spark,spark-test/spark,JoshRosen/spark,UndeadBaneGitHub/spark,ericvandenbergfb/spark,panfengfeng/spark,1haodian/spark,zuotingbing/spark,narahari92/spark,ericvandenbergfb/spark,stanzhai/spark,Aegeaner/spark,ron8hu/spark,adrian-ionescu/apache-spark,liyichao/spark,liyichao/spark,stanzhai/spark,akopich/spark,someorz/spark,ajaysaini725/spark,saturday-shi/spark,zero323/spark,ericvandenbergfb/spark,caneGuy/spark,spark-test/spark,goldmedal/spark,holdenk/spark,mahak/spark,maropu/spark,dhruve/spark,eyalfa/spark,UndeadBaneGitHub/spark,debugger87/spark,nchammas/spark,pgandhi999/spark,highfei2011/spark,ahnqirage/spark,esi-mineset/spark,dhruve/spark,markhamstra/spark,Aegeaner/spark,aosagie/spark,actuaryzhang/spark,lvdongr/spark,map222/spark,liyichao/spark,tejasapatil/spark,icexelloss/spark,mzl9039/spark,yanboliang/spark,dongjoon-hyun/spark,tejasapatil/spark,techaddict/spark,dhruve/spark,HyukjinKwon/spark,wangmiao1981/spark,shaneknapp/spark,ron8hu/spark,alunarbeach/spark,ueshin/apache-spark,aray/spark,panfengfeng/spark,lvdongr/spark,dongjoon-hyun/spark,bdrillard/spark,sureshthalamati/spark,huang1900/spark,saturday-shi/spark,rekhajoshm/spark,eyalfa/spark,spark-test/spark,poffuomo/spark,huang1900/spark,zzcclp/spark,lxsmnv/spark,highfei2011/spark,JoshRosen/spark,caneGuy/spark,hhbyyh/spark,srowen/spark,mzl9039/spark,SHASHANKB/spark,zhouyejoe/spark,darionyaphet/spark,BryanCutler/spark,cloud-fan/spark,shaneknapp/spark,shubhamchopra/spark,ddna1021/spark,lxsmnv/spark,dbtsai/spark,liutang123/spark,shubhamchopra/spark,ConeyLiu/spark,huang1900/spark,xflin/spark,wangmiao1981/spark,jkbradley/spark,bravo-zhang/spark,holdenk/spark,minixalpha/spark,someorz/spark,poffuomo/spark,apache/spark,LantaoJin/spark,zzcclp/spark,vinodkc/spark,saltstar/spark,hhbyyh/spark,witgo/spark,guoxiaolongzte/spark,apache/spark,apache/spark,zero323/spark,zzcclp/spark,markhamstra/spark,HyukjinKwon/spark,bOOm-X/spark,yanboliang/spark,aray/spark,esi-mineset/spark,mzl9039/spark,srowen/spark,BryanCutler/spark,ron8hu/spark,eyalfa/spark,actuaryzhang/spark,szhem/spark,tengpeng/spark,ConeyLiu/spark,rekhajoshm/spark,mike0sv/spark,ron8hu/spark,liyichao/spark,rikima/spark,holdenk/spark,bravo-zhang/spark,WeichenXu123/spark,kissmetrics/spark,srowen/spark,brad-kaiser/spark,ron8hu/spark,akopich/spark,techaddict/spark,highfei2011/spark,WeichenXu123/spark,bOOm-X/spark,bOOm-X/spark,SHASHANKB/spark,eyalfa/spark,facaiy/spark,kevinyu98/spark,dbtsai/spark,aosagie/spark,icexelloss/spark,ericvandenbergfb/spark,dongjoon-hyun/spark,hhbyyh/spark,michalsenkyr/spark,saturday-shi/spark,techaddict/spark,saturday-shi/spark,skonto/spark,highfei2011/spark,mike0sv/spark,apache/spark,sahilTakiar/spark,aray/spark,bOOm-X/spark,milliman/spark,jiangxb1987/spark,aray/spark,zuotingbing/spark,mike0sv/spark,maropu/spark,tengpeng/spark,narahari92/spark,lxsmnv/spark,kevinyu98/spark,ueshin/apache-spark,actuaryzhang/spark,facaiy/spark,ioana-delaney/spark,cin/spark,gengliangwang/spark,kissmetrics/spark,taroplus/spark,darionyaphet/spark,nchammas/spark,aosagie/spark,brad-kaiser/spark,map222/spark,ConeyLiu/spark,wangyum/spark,bravo-zhang/spark,shuangshuangwang/spark,skonto/spark,hvanhovell/spark,cloud-fan/spark,icexelloss/spark,ConeyLiu/spark,UndeadBaneGitHub/spark,BryanCutler/spark,rikima/spark,michalsenkyr/spark,huang1900/spark,saltstar/spark,mike0sv/spark,xuanyuanking/spark,shubhamchopra/spark,mdespriee/spark,ptkool/spark,wangyum/spark,ioana-delaney/spark,sahilTakiar/spark,ptkool/spark,aray/spark,markhamstra/spark,byakuinss/spark,taroplus/spark,darionyaphet/spark,wangmiao1981/spark,aosagie/spark,taroplus/spark,guoxiaolongzte/spark,nilsgrabbert/spark,taroplus/spark,jiangxb1987/spark,michalsenkyr/spark,goldmedal/spark,zuotingbing/spark,someorz/spark,wangmiao1981/spark,JoshRosen/spark,esi-mineset/spark,narahari92/spark,kevinyu98/spark,caneGuy/spark,ron8hu/spark,markhamstra/spark,gengliangwang/spark,janewangfb/spark,WeichenXu123/spark,szhem/spark,holdenk/spark,kiszk/spark,debugger87/spark,nlalevee/spark,nchammas/spark,sureshthalamati/spark,skonto/spark,aosagie/spark,LantaoJin/spark,rednaxelafx/apache-spark,ConeyLiu/spark,shuangshuangwang/spark,guoxiaolongzte/spark,tengpeng/spark,gengliangwang/spark,ioana-delaney/spark,sahilTakiar/spark,pgandhi999/spark,map222/spark,bravo-zhang/spark,srowen/spark,saltstar/spark,narahari92/spark,szhem/spark,hhbyyh/spark,kevinyu98/spark,dbtsai/spark,mahak/spark,huang1900/spark,liutang123/spark,saltstar/spark,bOOm-X/spark,joseph-torres/spark,bravo-zhang/spark,zero323/spark,ioana-delaney/spark,saltstar/spark,dbtsai/spark,SHASHANKB/spark,ajaysaini725/spark,milliman/spark,icexelloss/spark,wzhfy/spark,ron8hu/spark,zhouyejoe/spark,witgo/spark,WindCanDie/spark,brad-kaiser/spark,skonto/spark,saltstar/spark,zero323/spark,maropu/spark,kiszk/spark,JoshRosen/spark,srowen/spark,caneGuy/spark,xuanyuanking/spark,HyukjinKwon/spark,janewangfb/spark,bdrillard/spark,jiangxb1987/spark,wangmiao1981/spark,panfengfeng/spark,mahak/spark,shuangshuangwang/spark,facaiy/spark,LantaoJin/spark,jkbradley/spark,gengliangwang/spark,wangyum/spark,WeichenXu123/spark,UndeadBaneGitHub/spark,LantaoJin/spark,akopich/spark,kissmetrics/spark,tejasapatil/spark,rednaxelafx/apache-spark,spark-test/spark,rednaxelafx/apache-spark,shubhamchopra/spark,bdrillard/spark,dongjoon-hyun/spark,yanboliang/spark,zhouyejoe/spark,ueshin/apache-spark,aosagie/spark,Aegeaner/spark,dongjoon-hyun/spark,ptkool/spark,rikima/spark,nlalevee/spark,chuckchen/spark,BryanCutler/spark,minixalpha/spark,wangyum/spark,dbtsai/spark,SHASHANKB/spark,ddna1021/spark,minixalpha/spark,mzl9039/spark,hvanhovell/spark,map222/spark,michalsenkyr/spark,nilsgrabbert/spark,jkbradley/spark,actuaryzhang/spark,brad-kaiser/spark,ioana-delaney/spark,mzl9039/spark,lvdongr/spark,apache/spark,brad-kaiser/spark,kiszk/spark,joseph-torres/spark,ajaysaini725/spark,zero323/spark,guoxiaolongzte/spark,spark-test/spark,WeichenXu123/spark,matthewfranglen/spark,BryanCutler/spark,lxsmnv/spark,kevinyu98/spark,guoxiaolongzte/spark,minixalpha/spark,rezasafi/spark,JoshRosen/spark,alunarbeach/spark,wzhfy/spark,nilsgrabbert/spark,ahnqirage/spark,adrian-ionescu/apache-spark,nlalevee/spark,jiangxb1987/spark,mahak/spark,aokolnychyi/spark,someorz/spark,zzcclp/spark,facaiy/spark,esi-mineset/spark,caneGuy/spark,xuanyuanking/spark,map222/spark,huang1900/spark,janewangfb/spark,joseph-torres/spark,highfei2011/spark,WindCanDie/spark,wangyum/spark,dhruve/spark,nilsgrabbert/spark,techaddict/spark,rekhajoshm/spark,szhem/spark,esi-mineset/spark,nchammas/spark,markhamstra/spark,dongjoon-hyun/spark,alunarbeach/spark,1haodian/spark,brad-kaiser/spark,HyukjinKwon/spark,jkbradley/spark,adrian-ionescu/apache-spark,sureshthalamati/spark,lxsmnv/spark,goldmedal/spark,tejasapatil/spark,sureshthalamati/spark,mdespriee/spark,witgo/spark,poffuomo/spark,szhem/spark,ahnqirage/spark,UndeadBaneGitHub/spark,huang1900/spark,yanboliang/spark,cloud-fan/spark,lvdongr/spark,zzcclp/spark,icexelloss/spark,debugger87/spark,1haodian/spark,hhbyyh/spark,poffuomo/spark,taroplus/spark,milliman/spark,stanzhai/spark,liyichao/spark,panfengfeng/spark,witgo/spark,milliman/spark,shubhamchopra/spark,cin/spark,spark-test/spark,gengliangwang/spark,ioana-delaney/spark,SHASHANKB/spark,liutang123/spark,mike0sv/spark,mzl9039/spark,zero323/spark,holdenk/spark,milliman/spark,wangyum/spark,poffuomo/spark,hhbyyh/spark,bravo-zhang/spark,chuckchen/spark,ptkool/spark,techaddict/spark,taroplus/spark,ahnqirage/spark,bdrillard/spark,maropu/spark,nchammas/spark,rednaxelafx/apache-spark,xflin/spark,aray/spark,aokolnychyi/spark