{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":91249,"databundleVersionId":11294684,"sourceType":"competition"}],"dockerImageVersionId":30918,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"#### Have checked train labels.  \n#### There must be some clues here!!  ","metadata":{}},{"cell_type":"code","source":"!pip install sweetviz\n\nimport pandas as pd\nimport numpy as np\n\nimport sweetviz as sv\nfrom IPython.display import IFrame","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-03-22T09:24:46.808726Z","iopub.execute_input":"2025-03-22T09:24:46.809240Z","iopub.status.idle":"2025-03-22T09:24:46.814566Z","shell.execute_reply.started":"2025-03-22T09:24:46.809174Z","shell.execute_reply":"2025-03-22T09:24:46.813460Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# i/o setting\nfolder = \"/kaggle/input/byu-locating-bacterial-flagellar-motors-2025\"\nfp = f\"{folder}/train_labels.csv\"\n\n# read data\ndf = pd.read_csv(fp)\ndf","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T09:24:46.816949Z","iopub.execute_input":"2025-03-22T09:24:46.817247Z","iopub.status.idle":"2025-03-22T09:24:46.854863Z","shell.execute_reply.started":"2025-03-22T09:24:46.817221Z","shell.execute_reply":"2025-03-22T09:24:46.853815Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Use sweetviz","metadata":{}},{"cell_type":"code","source":"def make_report(df):\n    # setting\n    sv.config.category_max_cardinality_for_summary_report = 1000\n    \n    # make report and output\n    report = sv.analyze(df)\n    report.show_html('report.html')\n    \n    # show in notebook\n    return IFrame('report.html', width=1000, height=600)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:08:41.096560Z","iopub.execute_input":"2025-03-22T10:08:41.097014Z","iopub.status.idle":"2025-03-22T10:08:41.102903Z","shell.execute_reply.started":"2025-03-22T10:08:41.096978Z","shell.execute_reply":"2025-03-22T10:08:41.101841Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# All data","metadata":{}},{"cell_type":"code","source":"# read data\ndf = pd.read_csv(fp)\n\n# make report\nmake_report(df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:08:46.563333Z","iopub.execute_input":"2025-03-22T10:08:46.563721Z","iopub.status.idle":"2025-03-22T10:08:51.118117Z","shell.execute_reply.started":"2025-03-22T10:08:46.563681Z","shell.execute_reply":"2025-03-22T10:08:51.117145Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Neagative data","metadata":{}},{"cell_type":"code","source":"# read data\ndf = pd.read_csv(fp)\n\n# filter negative data\ndf = df[df[\"Number of motors\"]==0]\n\n# make report\nmake_report(df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:08:51.119351Z","iopub.execute_input":"2025-03-22T10:08:51.119690Z","iopub.status.idle":"2025-03-22T10:08:54.247072Z","shell.execute_reply.started":"2025-03-22T10:08:51.119663Z","shell.execute_reply":"2025-03-22T10:08:54.245925Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Positive data","metadata":{}},{"cell_type":"code","source":"# read data\ndf = pd.read_csv(fp)\n\n# filter positive data\ndf = df[df[\"Number of motors\"]!=0]\n\n# make report\nmake_report(df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:08:54.248570Z","iopub.execute_input":"2025-03-22T10:08:54.248941Z","iopub.status.idle":"2025-03-22T10:08:58.599690Z","shell.execute_reply.started":"2025-03-22T10:08:54.248911Z","shell.execute_reply":"2025-03-22T10:08:58.598547Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Single Positive data","metadata":{}},{"cell_type":"code","source":"# read data\ndf = pd.read_csv(fp)\n\n# filter positive data\ndf = df[df[\"Number of motors\"]==1]\n\n# make report\nmake_report(df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:12:57.626231Z","iopub.execute_input":"2025-03-22T10:12:57.626590Z","iopub.status.idle":"2025-03-22T10:13:02.187270Z","shell.execute_reply.started":"2025-03-22T10:12:57.626562Z","shell.execute_reply":"2025-03-22T10:13:02.185885Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Multi Positive data","metadata":{"execution":{"iopub.status.busy":"2025-03-22T10:11:22.826651Z","iopub.execute_input":"2025-03-22T10:11:22.827034Z","iopub.status.idle":"2025-03-22T10:11:22.831202Z","shell.execute_reply.started":"2025-03-22T10:11:22.827006Z","shell.execute_reply":"2025-03-22T10:11:22.830054Z"}}},{"cell_type":"code","source":"# read data\ndf = pd.read_csv(fp)\n\n# filter positive data\ndf = df[~df[\"Number of motors\"].isin([0, 1])]\n\n# make report\nmake_report(df)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-03-22T10:11:59.538725Z","iopub.execute_input":"2025-03-22T10:11:59.539084Z","iopub.status.idle":"2025-03-22T10:12:03.975407Z","shell.execute_reply.started":"2025-03-22T10:11:59.539057Z","shell.execute_reply":"2025-03-22T10:12:03.974477Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}