<jupyter_start><jupyter_text>Model Preselect test logeristic regression<jupyter_code>#===============================================
# Basic Imports
BASE_FOLDER = '../../'
%run -i ..\..\utility\feature_extractor\JupyterLoad_feature_extractor.py
%run -i ..\..\utility\modeling\JupyterLoad_modeling.py

from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA, FastICA
from sklearn.preprocessing import PolynomialFeatures

%run -i miniutil_singel_pipe_eval_helper.py

df_summery = pd.DataFrame()<jupyter_output>load feature_extractor_mother
load feature_extractor_mel_spectra
load feature_extractor_psd
load feature_extractor_ICA2
load feature_extractore_pre_nnFilterDenoise
load extractor_diagram_mother
load Simple_FIR_HP
load TimeSliceAppendActivation
load load_data
Load split_data
Load anomaly_detection_models
Load pseudo_supervised_models
Load tensorflow models
Load detection_pipe<jupyter_text>Feature list* PSD_raw* PSD_den* PSD_bssm* PSD_denbssm* ICA_demix* MEL_raw* MEL_den* MEL_bssm* MEL_denbssm  Low noise ID00<jupyter_code>## Meta
machines = ['fan']
SNRs = ['6dB']
IDs = ['00']
feat_discfile = '/dataset/extdia_v1/fan6dB00_EDiaV1HPaug0_pandaDisc.pkl'<jupyter_output><empty_output><jupyter_text>PSD_bssm<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_bssm'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fan6dB00_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9963995548440858
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.8897125850442804
pipe saved to pickle<jupyter_text>PSD_den<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_den'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fan6dB00_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9954196087890882
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.91804357406323
pipe saved to pickle<jupyter_text>PSD_raw<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_raw'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fan6dB00_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9976810227621595
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.9564380104920647
pipe saved to pickle<jupyter_text>High noise ID00<jupyter_code>## Meta
machines = ['fan']
SNRs = ['min6dB']
IDs = ['00']
feat_discfile = '/dataset/extdia_v1/fanmin6dB00_EDiaV1HPaug0_pandaDisc.pkl'<jupyter_output><empty_output><jupyter_text>PSD_raw<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_raw'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fanmin6dB00_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9796184926099732
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.659720251857844
pipe saved to pickle<jupyter_text>PSD_den<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_bssm'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fanmin6dB00_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9613462677075566
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.514014572982632
pipe saved to pickle<jupyter_text>High noise ID02<jupyter_code>## Meta
machines = ['fan']
SNRs = ['min6dB']
IDs = ['02']
feat_discfile = '/dataset/extdia_v1/fanmin6dB02_EDiaV1HPaug0_pandaDisc.pkl'<jupyter_output><empty_output><jupyter_text>PSD_raw<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_raw'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fanmin6dB02_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9991578805927965
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.841865752127932
pipe saved to pickle<jupyter_text>PSD_den<jupyter_code>df, tasks, npart = Make_TTsplit_and_task(feat_discfile,machines, SNRs,IDs,
                        features = [ 'PSD_bssm'],
                        feat = {'function':'flat'})

preprocessing = [
    (StandardScaler, {}),
    #(PolynomialFeatures, {'degree': 2})
]

#modeling = (uni_LogisticRegression, {'C': 0.5, 'max_iter': 600})
modeling = (uni_RandomForestClassifier, {'max_depth': 2})

pipe = Pipe(preprocessing, modeling, True)
pipe.run_pipe(tasks[0])

name_of_test = pipe.model.name + 'n' +'_' + npart

pipetask_to_metrics(pipe,tasks[0],df_summery,name_of_test,0.5)
print(name_of_test)<jupyter_output>../..//dataset/extdia_v1/fanmin6dB02_EDiaV1HPaug0_pandaDisc.pkl --> Done
...loading data
data loading completed

...preprocessing data
data preprocessing finished

...fitting the model
0.9956237591190991
model fitted successfully

...evaluating model
evaluation successfull, roc_auc: 0.7920601174727075
pipe saved to pickle<jupyter_text>Summery<jupyter_code>df_summery.to_pickle('S01_summerys/S01_RFC_fan')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1336394677970093, 'fraction_numerical': 0.045920169551395267, 'mean_word_length': 5.1506154960173784, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '458260', 'license': 'MIT', 'n_tokens_mistral': 3424, 'n_tokens_neox': 3106, 'n_words': 538, 'path': 'modeling/pseudo_supervised/S01_pseudo_supervsed_model_preselect_Test_RFC_on_FAN.ipynb', 'repo_name': 'BA-HanseML/NF_Prj_MIMII_Dataset', 'size': '8493'}