56 lines
1.2 KiB
Python
56 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Mon May 16 05:59:12 2022
|
|
|
|
@author: tanu
|
|
"""
|
|
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Created on Tue Mar 15 11:09:50 2022
|
|
|
|
@author: tanu
|
|
"""
|
|
#%% Data
|
|
X = all_df_wtgt[numerical_FN+categorical_FN]
|
|
X = all_df_wtgt[numerical_FN]
|
|
|
|
y = all_df_wtgt['dst_mode']
|
|
#%% variables
|
|
|
|
#%% MultClassPipeSKFCV: function call()
|
|
mm_skf_scoresD = MultClassPipeSKFCV(input_df = X
|
|
, target = y
|
|
, var_type = 'numerical'
|
|
, skf_cv = skf_cv)
|
|
|
|
|
|
mm_skf_scores_df_all = pd.DataFrame(mm_skf_scoresD)
|
|
mm_skf_scores_df_all
|
|
mm_skf_scores_df_test = mm_skf_scores_df_all.filter(like='test_', axis=0)
|
|
mm_skf_scores_df_train = mm_skf_scores_df_all.filter(like='train_', axis=0) # helps to see if you trust the results
|
|
|
|
#%% CHECK with BLIND test
|
|
#%%
|
|
import plotly.express as px
|
|
|
|
corr = X.corr(method = 'spearman')
|
|
corr.head()
|
|
|
|
#p = corr.style.background_gradient(cmap='coolwarm')
|
|
p = corr.style.background_gradient(cmap='coolwarm').set_precision(2)
|
|
p
|
|
|
|
fig = px.imshow(corr)
|
|
fig.show()
|
|
|
|
|
|
#%%TODO:
|
|
# Add correlation plot
|
|
# Remove low variance features
|
|
# Add feature selection
|
|
# Then run your models on BLIND test WITHOUT CV
|
|
|
|
|
|
|