mirror of
https://github.com/harivansh-afk/ds1001_final.git
synced 2026-04-20 04:02:40 +00:00
add git commands to commit and push changes
This commit is contained in:
parent
8d855f3b6f
commit
6c89915892
1 changed files with 19 additions and 5 deletions
|
|
@ -256,7 +256,7 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Scatterplot between two variables\n",
|
||||
"# Scatterplot between two continuous variables\n",
|
||||
"plt.figure(figsize=(10, 6))\n",
|
||||
"sns.scatterplot(x='Variable1', y='Variable2', data=\"xx\") # Replace 'Variable1' and 'Variable2' with your column names\n",
|
||||
"plt.title('Scatterplot of Variable1 vs Variable2')\n",
|
||||
|
|
@ -324,7 +324,7 @@
|
|||
"source": [
|
||||
"# Divide the dataset into features and target\n",
|
||||
"target = \"xx\"['TargetVariable'] # Replace 'TargetVariable' with your actual target column name and \"xx\" with your dataframe name\n",
|
||||
"features = \"xx\".drop(columns=[target])\n"
|
||||
"features = \"xx\".drop(columns=['TargetVariable']) # Drop the target column from features\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -454,7 +454,8 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"mf_race.by_group #What do the results show? Change the mf_race with each subgroup and report the findings. "
|
||||
"mf_race.by_group #What do the results show? Change the mf_race with each subgroup and report the findings. This means\n",
|
||||
"# you should run this cell multiple times, once for each of the levels in the race variable."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -464,7 +465,8 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"mf_gender.by_group #What do the results show?"
|
||||
"mf_gender.by_group #What do the results show? There's only two groups here so we don't need to change anything. \n",
|
||||
"# in the metric frame."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -475,7 +477,8 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Derived fairness metrics. Be sure you understand the scale and meaning of these. Here we are calculating the \n",
|
||||
"# two fairness ratios using the gender_m feature. What do the results show, is the model more or less fair with this grouping?\n",
|
||||
"# two fairness ratios using the gender_m feature, which is bi-variate. What do the results show, is the model more or \n",
|
||||
"# less fair with this grouping?\n",
|
||||
"\n",
|
||||
"dpr_gender = fairlearn.metrics.demographic_parity_ratio(y_test, y_pred, sensitive_features=X_test['gender_m'])\n",
|
||||
"print(\"Demographic Parity ratio:\\t\", dpr_gender)\n",
|
||||
|
|
@ -501,6 +504,17 @@
|
|||
"eodds_race = fairlearn.metrics.equalized_odds_ratio(y_test, y_pred, sensitive_features=X_test.filter(regex=\"race.*\"))\n",
|
||||
"print(\"Equalized Odds ratio:\\t\\t\", eodds_race)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "767ebbe9",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!git commit -m \"Insert Message Here\" # This will commit your changes to git. \n",
|
||||
"!git push # This will push your changes to back to your remote repository on GitHub."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue