diff --git a/imports.py b/imports.py index 40888f2..0735ec6 100644 --- a/imports.py +++ b/imports.py @@ -74,6 +74,9 @@ geneL_ppi2 = ['alr', 'embb', 'katg'] #%% get cols mycols = my_df.columns +my_df['active_aa_pos'].dtype +my_df['active_aa_pos'] = my_df['active_aa_pos'].astype(object) + #%%============================================================================ # GET Y diff --git a/my_data9.py b/my_data9.py index 314ed91..0b1f4b8 100644 --- a/my_data9.py +++ b/my_data9.py @@ -59,9 +59,9 @@ f2 = preprocessor.transform(numerical_features_df) f3 = preprocessor.fit_transform(numerical_features_df) (f3==f2).all() -f4 = preprocessor.fit_transform(all_features_df) -f4 -reprocessor.fit_transform(numerical_features_df) +preprocessor.fit_transform(numerical_features_df) + +#preprocessor.fit_transform(all_features_df) #%% model_log = Pipeline(steps = [ @@ -108,8 +108,6 @@ pd.DataFrame(output).mean() t1_res = MultClassPipeline2(X_trainN, X_testN, y_trainN, y_testN, input_df = all_features_df) t1_res -t2_res = MultClassPipeline2(X_train, X_test, y_train, y_test, input_df = all_features_df) -t2_res #%% # https://machinelearningmastery.com/columntransformer-for-numerical-and-categorical-data/ #Each transformer is a three-element tuple that defines the name of the transformer, the transform to apply, and the column indices to apply it to. For example: @@ -129,4 +127,8 @@ col_transform = ColumnTransformer(transformers=t # create pipeline (unlike example above where the col transfer was a preprocess step and it was fit_transformed) pipeline = Pipeline(steps=[('prep', col_transform) - , ('classifier', clf)]) \ No newline at end of file + , ('classifier', LogisticRegression())]) +#%% Added this to the MultClassPipeline + +t2_res = MultClassPipeline2(X_train, X_test, y_train, y_test, input_df = all_features_df) +t2_res \ No newline at end of file