{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyNE/AVfPCndZRo3VrKym5D7"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":2,"metadata":{"id":"Uy-HrhzJJ3Nn","executionInfo":{"status":"ok","timestamp":1793973707520,"user_tz":-420,"elapsed":39,"user":{"displayName":"Elfan Cris","userId":"15481999268029990356"}}},"outputs":[],"source":["import pandas as pd\n","\n","import numpy as np\n","\n","import matplotlib.pyplot as plt\n","\n","import seaborn as sns\n","\n","\n","from sklearn.model_selection import train_test_split\n","\n","from sklearn.tree import DecisionTreeClassifier\n","\n","from sklearn.ensemble import RandomForestClassifier\n","\n","from sklearn.metrics import accuracy_score, classification_report, confusion_matrix"]},{"cell_type":"code","source":["# Membaca file CSV\n","df = pd.read_csv('DataSet-Tugas-1.csv')\n","\n","# Menampilkan 5 baris pertama untuk memastikan data termuat dengan benar\n","df.head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"nUVSP27_KRsM","executionInfo":{"status":"ok","timestamp":1793973715866,"user_tz":-420,"elapsed":103,"user":{"displayName":"Elfan Cris","userId":"15481999268029990356"}},"outputId":"979a4fcf-71f2-448f-e248-d2c239e3d480"},"execution_count":3,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Hematokrit Hemoglobin Jumlah Eritrosit Jumlah Lekosit Jumlah Trombosit \\\n","0 45.0 15.2 5.81 5.9 219 \n","1 45.0 15.3 5.49 6.2 312 \n","2 47.5 16.6 5.84 7.4 244 \n","3 45.4 15.0 5.33 6.7 342 \n","4 44.9 15.8 5.19 7.0 328 \n","\n"," MCH MCHC MCV SOURCE \n","0 26.2 33.8 77.5 rwj \n","1 27.9 34.0 82.0 rwj \n","2 28.4 34.9 81.3 rwj \n","3 28.1 33.0 85.2 rwj \n","4 30.4 35.2 86.5 rwj "],"text/html":["\n","
| \n"," | Hematokrit | \n","Hemoglobin | \n","Jumlah Eritrosit | \n","Jumlah Lekosit | \n","Jumlah Trombosit | \n","MCH | \n","MCHC | \n","MCV | \n","SOURCE | \n","
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n","45.0 | \n","15.2 | \n","5.81 | \n","5.9 | \n","219 | \n","26.2 | \n","33.8 | \n","77.5 | \n","rwj | \n","
| 1 | \n","45.0 | \n","15.3 | \n","5.49 | \n","6.2 | \n","312 | \n","27.9 | \n","34.0 | \n","82.0 | \n","rwj | \n","
| 2 | \n","47.5 | \n","16.6 | \n","5.84 | \n","7.4 | \n","244 | \n","28.4 | \n","34.9 | \n","81.3 | \n","rwj | \n","
| 3 | \n","45.4 | \n","15.0 | \n","5.33 | \n","6.7 | \n","342 | \n","28.1 | \n","33.0 | \n","85.2 | \n","rwj | \n","
| 4 | \n","44.9 | \n","15.8 | \n","5.19 | \n","7.0 | \n","328 | \n","30.4 | \n","35.2 | \n","86.5 | \n","rwj | \n","