This repository has been archived on 2026-06-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cas-pml/SL/aufgaben/template/4_WS/WS 10 Vorlage.ipynb
T
2026-05-21 14:16:30 +02:00

5.4 KiB

WS 10 Performancevergleiche Regression

  • Vergleichen Sie alle Regressoren (ausser SVR und MLPRegressor) mit folgenden Modifikationen
    • die Vergleiche werden ohne und mit Standardisierung der Features durchgeführt
    • die Resultate (r2_score) werden in Form einer Heatmap zusammengestellt
  • informieren Sie sich zum Vorgehen am Code in 3.4 Regression - Modellvergleiche.ipynb
  • Präsentation der Ergebnisse als
    • seaborn heatmap
    • alternative Visualisierung: Grouped barplots
Cell:
[Cell type raw - unsupported, skipped]
In [3]:
## prepare env, read and prepare data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()

codepath = '../2_code'
datapath = '../3_data'
from sys import path; path.insert(1, codepath)
from os import chdir; chdir(datapath)

from bfh_cas_pml import prep_data
X_train, X_test, y_train, y_test = prep_data('melb_data_prep.csv', target='Price', seed=1234)
In [4]:
## standardize features (lead: train)
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaler.fit(X_train)
X_train_sc = scaler.transform(X_train)
X_test_sc = scaler.transform(X_test)
In [5]:
## import trainer classes
## tbd



In [6]:
## define models
## tbd


In [7]:
## compare models
## tbd: prepare empty lists for results



# for model in models:

    ## not scaled
    ## tbd
    
    
    
    ## scaled
    ## tbd
    

    
Cell:
[Cell type raw - unsupported, skipped]

Fazit:

  • tbd