Skip to content

Commit

Permalink
Insert comment for codes
Browse files Browse the repository at this point in the history
  • Loading branch information
carolflz committed May 20, 2023
1 parent 6098acc commit 74d6ff6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CPC251_Project_Part1_Group-Cancer_2.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
4 changes: 1 addition & 3 deletions Project Part 1 (Template).ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"#split into 80:10:10"
]
"source": []
},
{
"attachments": {},
Expand Down
13 changes: 11 additions & 2 deletions Project Part 1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@
}
],
"source": [
"#Import the pandas library, reading the dataset into a dataframe\n",
"df= pd.read_csv('risk_factors.csv')\n",
"\n",
"#Print the dataframe\n",
"df"
]
},
Expand Down Expand Up @@ -508,6 +511,7 @@
}
],
"source": [
"#Display information about the dataframe\n",
"df.info()"
]
},
Expand Down Expand Up @@ -566,7 +570,10 @@
}
],
"source": [
"#Drop 'Biopsy' column to create a new dataframe called as 'X'\n",
"X = df.drop('Biopsy', axis = 1)\n",
"\n",
"#Display the information of 'X'\n",
"X.info()"
]
},
Expand All @@ -587,6 +594,7 @@
}
],
"source": [
"#Get the size or dimensions of 'X'\n",
"X.shape\n"
]
},
Expand All @@ -613,7 +621,10 @@
}
],
"source": [
"#Assign 'Biopsy' column to variable 'y'\n",
"y = df['Biopsy']\n",
"\n",
"#Display the information of 'y' variable\n",
"y.info()"
]
},
Expand Down Expand Up @@ -652,8 +663,6 @@
"metadata": {},
"outputs": [],
"source": [
"#split into 80:10:10\n",
"\n",
"#splitting into training and test set\n",
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.1,random_state=0)\n",
"\n",
Expand Down

0 comments on commit 74d6ff6

Please sign in to comment.