{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-09-16T12:06:22.594192Z","iopub.execute_input":"2022-09-16T12:06:22.594947Z","iopub.status.idle":"2022-09-16T12:06:44.138374Z","shell.execute_reply.started":"2022-09-16T12:06:22.594823Z","shell.execute_reply":"2022-09-16T12:06:44.135225Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\n\ndf_s = pd.read_csv(r'/kaggle/input/cassava-leaf-disease-classification/sample_submission.csv')\ndf_s.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:07:43.392266Z","iopub.execute_input":"2022-09-16T12:07:43.392672Z","iopub.status.idle":"2022-09-16T12:07:43.407132Z","shell.execute_reply.started":"2022-09-16T12:07:43.392641Z","shell.execute_reply":"2022-09-16T12:07:43.405817Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('/kaggle/input/cassava-leaf-disease-classification/train.csv')\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:08:21.947204Z","iopub.execute_input":"2022-09-16T12:08:21.947810Z","iopub.status.idle":"2022-09-16T12:08:21.992272Z","shell.execute_reply.started":"2022-09-16T12:08:21.947758Z","shell.execute_reply":"2022-09-16T12:08:21.990981Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# count\ndf['label'].unique()","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:10:04.784590Z","iopub.execute_input":"2022-09-16T12:10:04.786078Z","iopub.status.idle":"2022-09-16T12:10:04.798021Z","shell.execute_reply.started":"2022-09-16T12:10:04.786003Z","shell.execute_reply":"2022-09-16T12:10:04.796847Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 5 Lables detected","metadata":{}},{"cell_type":"code","source":"df['image_id'] = df['image_id'].str.replace('.jpg', '')","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:12:06.254419Z","iopub.execute_input":"2022-09-16T12:12:06.254886Z","iopub.status.idle":"2022-09-16T12:12:06.288846Z","shell.execute_reply.started":"2022-09-16T12:12:06.254851Z","shell.execute_reply":"2022-09-16T12:12:06.288014Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.dtypes","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:13:33.462620Z","iopub.execute_input":"2022-09-16T12:13:33.463633Z","iopub.status.idle":"2022-09-16T12:13:33.471738Z","shell.execute_reply.started":"2022-09-16T12:13:33.463595Z","shell.execute_reply":"2022-09-16T12:13:33.470549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['image_id'] = df['image_id'].astype(int)","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:13:55.340501Z","iopub.execute_input":"2022-09-16T12:13:55.340965Z","iopub.status.idle":"2022-09-16T12:13:55.350030Z","shell.execute_reply.started":"2022-09-16T12:13:55.340926Z","shell.execute_reply":"2022-09-16T12:13:55.348760Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.dtypes","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:14:02.477497Z","iopub.execute_input":"2022-09-16T12:14:02.477963Z","iopub.status.idle":"2022-09-16T12:14:02.487119Z","shell.execute_reply.started":"2022-09-16T12:14:02.477923Z","shell.execute_reply":"2022-09-16T12:14:02.485757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = df.astype(float)","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:20:55.501091Z","iopub.execute_input":"2022-09-16T12:20:55.501513Z","iopub.status.idle":"2022-09-16T12:20:55.507618Z","shell.execute_reply.started":"2022-09-16T12:20:55.501481Z","shell.execute_reply":"2022-09-16T12:20:55.506240Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:32:42.604041Z","iopub.execute_input":"2022-09-16T12:32:42.604526Z","iopub.status.idle":"2022-09-16T12:32:42.622442Z","shell.execute_reply.started":"2022-09-16T12:32:42.604493Z","shell.execute_reply":"2022-09-16T12:32:42.621453Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"a = df['image_id']\nb = df['label']\nfrom sklearn.tree import DecisionTreeClassifier # Import Decision Tree Classifier\nfrom sklearn.model_selection import train_test_split # Import train_test_split function\nfrom sklearn import metrics #Import scikit-learn metrics module for accuracy calculation\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.naive_bayes import GaussianNB\nX = a\ny = b","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:36:29.712598Z","iopub.execute_input":"2022-09-16T12:36:29.713082Z","iopub.status.idle":"2022-09-16T12:36:29.720089Z","shell.execute_reply.started":"2022-09-16T12:36:29.713034Z","shell.execute_reply":"2022-09-16T12:36:29.718921Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#clf = RandomForestClassifier()\n#clf = clf.fit(X, y)","metadata":{"execution":{"iopub.status.busy":"2022-09-16T12:32:07.519153Z","iopub.execute_input":"2022-09-16T12:32:07.520092Z","iopub.status.idle":"2022-09-16T12:32:07.544374Z","shell.execute_reply.started":"2022-09-16T12:32:07.520032Z","shell.execute_reply":"2022-09-16T12:32:07.542652Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}