“wysoce skorelowane cechy Python” Kod odpowiedzi

wysoce skorelowane cechy Python

# Create correlation matrix
corr_matrix = df.corr().abs()

# Select upper triangle of correlation matrix
upper = corr_matrix.where(np.triu(np.ones(corr_matrix.shape), k=1).astype(np.bool))

# Find index of feature columns with correlation greater than 0.95
to_drop = [column for column in upper.columns if any(upper[column] > 0.95)]

df.drop(to_drop, axis=1, inplace=True)
Xanthous Xenomorph

wysoce skorelowane cechy Python

# Create correlation matrix
corr_matrix = df.corr().abs()

# Select upper triangle of correlation matrix
upper = corr_matrix.where(np.triu(np.ones(corr_matrix.shape), k=1).astype(np.bool))

# Find index of feature columns with correlation greater than 0.95
to_drop = [column for column in upper.columns if any(upper[column] > 0.95)]
Xanthous Xenomorph

Odpowiedzi podobne do “wysoce skorelowane cechy Python”

Pytania podobne do “wysoce skorelowane cechy Python”

Więcej pokrewnych odpowiedzi na “wysoce skorelowane cechy Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu