Horje
scikit learn to identify highly correlated features Code Example
how to print correlation to a feature in pyhton
df[df.columns[1:]].corr()['LoanAmount'][:]
scikit learn to identify highly correlated features
# 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)]




Python

Related
check datatype python Code Example check datatype python Code Example
numpy python 3.10 Code Example numpy python 3.10 Code Example
python program to count vowels in a string Code Example python program to count vowels in a string Code Example
compare lists element wise python Code Example compare lists element wise python Code Example
data structures and algorithms in python Code Example data structures and algorithms in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7