Ejemplo n.º 1
0
scaledScoreStandard = f.ScoreDataFrame(names, results, 'standard_f1_score')
ScoreCard = pd.concat([ScoreCard, scaledScoreStandard], axis=1)

# Minmax scalar
models = f.GetScaledModel('minmax')
names, results = f.get_model_performance(X_train, y_train, models, SEED,
                                         'f1_weighted')
f.PlotBoxR().PlotResult(names, results)

# Record Scores
scaledScoreMinMax = f.ScoreDataFrame(names, results, 'minmax_f1_score')
ScoreCard = pd.concat([ScoreCard, scaledScoreMinMax], axis=1)

# Scaled Model on top of baseline with models adjusted for Class Weight
# Standard Scalar
models = f.GetScaledModelwithfactorizedCW('standard')
names, results = f.get_model_performance(X_train, y_train, models, SEED,
                                         'f1_weighted')
f.PlotBoxR().PlotResult(names, results)

# Record Scores
scaledScoreStandard = f.ScoreDataFrame(names, results, 'standard_f1_score')
ScoreCard = pd.concat([ScoreCard, scaledScoreStandard], axis=1)

# Minmax scalar
models = f.GetScaledModelwithfactorizedCW('minmax')
names, results = f.get_model_performance(X_train, y_train, models, SEED,
                                         'f1_weighted')
f.PlotBoxR().PlotResult(names, results)

# Record Scores
 def scaled_model_with_CW_factor(self, scoring, SEED, scalar):
     models = f.GetScaledModelwithfactorizedCW(scalar)
     names, results = f.cv_score(self.X_train, self.y_train, models,
                                 scoring, SEED)
     _score = f.cv_metrics(names, results)
     return _score