Skip to content

Commit c4307d1

Browse files
Sean O'Keefeml-fairness-infra-github
Sean O'Keefe
authored andcommitted
Removing PyTorch example.
PiperOrigin-RevId: 318550104
1 parent 0954dd3 commit c4307d1

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

fairness_indicators/documentation/examples/Fairness_Indicators_Pandas_Case_Study.ipynb

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"source": [
2626
"## Case Study Overview\n",
27-
"In this case study we will apply [TensorFlow Model Analysis](https://www.tensorflow.org/tfx/model_analysis/get_started) and [Fairness Indicators](https://www.tensorflow.org/tfx/guide/fairness_indicators) to evaluate data stored as a Pandas DataFrame, where each row contains ground truth labels, various features, and a model prediction. We will show how this workflow can be used to spot potential fairness concerns, independent of the framework one used to construct and train the model. As in this case study, we can analyze the results from any machine learning framework (e.g. TensorFlow, PyTorch, etc) once they are converted to a Pandas DataFrame.\n",
27+
"In this case study we will apply [TensorFlow Model Analysis](https://www.tensorflow.org/tfx/model_analysis/get_started) and [Fairness Indicators](https://www.tensorflow.org/tfx/guide/fairness_indicators) to evaluate data stored as a Pandas DataFrame, where each row contains ground truth labels, various features, and a model prediction. We will show how this workflow can be used to spot potential fairness concerns, independent of the framework one used to construct and train the model. As in this case study, we can analyze the results from any machine learning framework (e.g. TensorFlow, JAX, etc) once they are converted to a Pandas DataFrame.\n",
2828
" \n",
2929
"For this exercise, we will leverage the Deep Neural Network (DNN) model that was developed in the [Shape Constraints for Ethics with Tensorflow Lattice](https://colab.research.google.com/github/tensorflow/lattice/blob/master/docs/tutorials/shape_constraints_for_ethics.ipynb#scrollTo=uc0VwsT5nvQi) case study using the Law School Admissions dataset from the Law School Admissions Council (LSAC). This classifier attempts to predict whether or not a student will pass the bar, based on their Law School Admission Test (LSAT) score and undergraduate GPA. This classifier attempts to predict whether or not a student will pass the bar, based on their LSAT score and undergraduate GPA.\n",
3030
"\n",
@@ -305,25 +305,6 @@
305305
" return pd.DataFrame(\n",
306306
" data=np.array(np.reshape(predictions, x_grid.shape)).flatten())"
307307
]
308-
},
309-
{
310-
"cell_type": "code",
311-
"execution_count": null,
312-
"metadata": {
313-
"colab": {},
314-
"colab_type": "code",
315-
"id": "reZKLCHVEU0h"
316-
},
317-
"outputs": [],
318-
"source": [
319-
"# PyTorch Estimator to Pandas DataFrame example:\n",
320-
"\n",
321-
"import torch\n",
322-
"\n",
323-
"def torch_tensor_to_dataframe(torch_model):\n",
324-
" torch_numpy = torch_model.numpy()\n",
325-
" return pd.DataFrame(torch_numpy)"
326-
]
327308
}
328309
],
329310
"metadata": {

0 commit comments

Comments
 (0)