File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -542,12 +542,14 @@ def calculateFitStat(
542
542
GINI = (2 * auc ) - 1
543
543
fitStats ["_GINI_" ] = GINI
544
544
545
- from scipy .stats import (
546
- gamma ,
547
- ) # Holdover until fitstat generation via SWAT is sussed out
548
-
549
- _ , _ , scale = gamma .fit (dataSets [j ][1 ])
550
- fitStats ["_GAMMA_" ] = 1 / scale
545
+ try :
546
+ from scipy .stats import gamma
547
+ _ , _ , scale = gamma .fit (dataSets [j ][1 ])
548
+ fitStats ["_GAMMA_" ] = 1 / scale
549
+ except ImportError :
550
+ warnings .warn ("scipy was not installed, so the gamma calculation could"
551
+ "not be computed." )
552
+ fitStats ["_GAMMA_" ] = None
551
553
552
554
intPredict = [round (x ) for x in dataSets [j ][1 ]]
553
555
MCE = 1 - metrics .accuracy_score (dataSets [j ][0 ], intPredict )
@@ -559,7 +561,7 @@ def calculateFitStat(
559
561
MCLL = metrics .log_loss (dataSets [j ][0 ], dataSets [j ][1 ])
560
562
fitStats ["_MCLL_" ] = MCLL
561
563
562
- KS = max (math . fabs (fpr - tpr ))
564
+ KS = max (abs (fpr - tpr ))
563
565
fitStats ["_KS_" ] = KS
564
566
565
567
KSPostCutoff = None
You can’t perform that action at this time.
0 commit comments