Beispiel #1
0
basedLineF1Score = f.ScoreDataFrame(names, results, 'baseline_f1_Score')

models = f.GetBasedModel()
names, results = f.get_model_performance(X_train, y_train, models, SEED,
                                         'accuracy')
f.PlotBoxR().PlotResult(names, results)

basedLineAccuracyScore = f.ScoreDataFrame(names, results, 'baseline_accuracy')

# Record Scores
ScoreCard = pd.concat([basedLineAccuracyScore, basedLineF1Score], axis=1)

# Scaled Model on top of baseline
# Standard Scalar
models = f.GetScaledModel('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.GetScaledModel('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(self, scoring, SEED, result_col_nm, scalar):
     models = f.GetScaledModel(scalar)
     names, results = f.get_model_performance(self.X_train, self.y_train,
                                              models, SEED, scoring)
     _score = f.ScoreDataFrame(names, results, result_col_nm)
     return _score