added practice and base_estimator for all the confusion in my head
This commit is contained in:
parent
e28a296d98
commit
97620c1bb0
3 changed files with 513 additions and 0 deletions
33
MultClassPipe3_CALL.py
Normal file
33
MultClassPipe3_CALL.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Tue Mar 15 11:09:50 2022
|
||||
|
||||
@author: tanu
|
||||
"""
|
||||
# stratified shuffle split
|
||||
X_train, X_test, y_train, y_test = train_test_split(num_df_wtgt[numerical_FN]
|
||||
, num_df_wtgt['mutation_class']
|
||||
, test_size = 0.33
|
||||
, **rs
|
||||
, shuffle = True
|
||||
, stratify = num_df_wtgt['mutation_class'])
|
||||
|
||||
y_train.to_frame().value_counts().plot(kind = 'bar')
|
||||
y_test.to_frame().value_counts().plot(kind = 'bar')
|
||||
|
||||
MultClassPipelineCV(X_train, X_test, y_train, y_test
|
||||
, input_df = num_df_wtgt[numerical_FN]
|
||||
, var_type = 'numerical')
|
||||
|
||||
|
||||
skf_cv_scores = MultClassPipelineCV(X_train, X_test, y_train, y_test
|
||||
, input_df = num_df_wtgt[numerical_FN]
|
||||
, var_type = 'numerical')
|
||||
|
||||
pp.pprint(skf_cv_scores)
|
||||
# construct a df
|
||||
skf_cv_scores_df = pd.DataFrame(skf_cv_scores)
|
||||
skf_cv_scores_df
|
||||
skf_cv_scores_df_test = skf_cv_scores_df.filter(like='test_', axis=0)
|
||||
skf_cv_scores_df_train = skf_cv_scores_df.filter(like='train_', axis=0)
|
Loading…
Add table
Add a link
Reference in a new issue