{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install mmengine","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-04T01:02:11.170568Z","iopub.execute_input":"2023-03-04T01:02:11.170967Z","iopub.status.idle":"2023-03-04T01:02:22.796678Z","shell.execute_reply.started":"2023-03-04T01:02:11.170935Z","shell.execute_reply":"2023-03-04T01:02:22.795748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import mmengine\nimport pandas as pd\nfrom sklearn import model_selection","metadata":{"execution":{"iopub.status.busy":"2023-03-04T01:02:46.461713Z","iopub.execute_input":"2023-03-04T01:02:46.462139Z","iopub.status.idle":"2023-03-04T01:02:46.623128Z","shell.execute_reply.started":"2023-03-04T01:02:46.462105Z","shell.execute_reply":"2023-03-04T01:02:46.622066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('/kaggle/input/cassava-leaf-disease-classification/train.csv')\ndf.label.value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-03-04T01:00:21.898136Z","iopub.execute_input":"2023-03-04T01:00:21.898537Z","iopub.status.idle":"2023-03-04T01:00:21.927323Z","shell.execute_reply.started":"2023-03-04T01:00:21.898477Z","shell.execute_reply":"2023-03-04T01:00:21.926616Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"splits = model_selection.train_test_split(df, test_size=0.2, random_state=12345, shuffle=True, stratify=df.label)\nlen(splits[0]), len(splits[1])","metadata":{"execution":{"iopub.status.busy":"2023-03-04T01:01:43.384103Z","iopub.execute_input":"2023-03-04T01:01:43.384501Z","iopub.status.idle":"2023-03-04T01:01:43.406206Z","shell.execute_reply.started":"2023-03-04T01:01:43.384445Z","shell.execute_reply":"2023-03-04T01:01:43.405368Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mmengine.dump(splits[0], 'train.pkl')\nmmengine.dump(splits[1], 'val.pkl')","metadata":{"execution":{"iopub.status.busy":"2023-03-04T01:02:48.453426Z","iopub.execute_input":"2023-03-04T01:02:48.453931Z","iopub.status.idle":"2023-03-04T01:02:48.469155Z","shell.execute_reply.started":"2023-03-04T01:02:48.453883Z","shell.execute_reply":"2023-03-04T01:02:48.467192Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}