added UQ import and ml call scripts
This commit is contained in:
parent
66ebb1a30a
commit
3ed7840f60
2 changed files with 313 additions and 0 deletions
56
UQ_pnca_ml_CALL.py
Normal file
56
UQ_pnca_ml_CALL.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
#!/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
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue