|
102 | 102 | "outputs": [],
|
103 | 103 | "source": [
|
104 | 104 | "!pip install --upgrade pip==20.2\n",
|
105 |
| - "!pip install \"tfx==0.26.0\"\n", |
| 105 | + "!pip install \"tfx==1.2.0\"\n", |
106 | 106 | "!pip install model-card-toolkit"
|
107 | 107 | ]
|
108 | 108 | },
|
|
151 | 151 | "from tfx.components import CsvExampleGen\n",
|
152 | 152 | "from tfx.components import Evaluator\n",
|
153 | 153 | "from tfx.components import Pusher\n",
|
154 |
| - "from tfx.components import ResolverNode\n", |
155 | 154 | "from tfx.components import SchemaGen\n",
|
156 | 155 | "from tfx.components import StatisticsGen\n",
|
157 | 156 | "from tfx.components import Trainer\n",
|
|
167 | 166 | "from tfx.types import Channel\n",
|
168 | 167 | "from tfx.types.standard_artifacts import Model\n",
|
169 | 168 | "from tfx.types.standard_artifacts import ModelBlessing\n",
|
170 |
| - "from tfx.utils.dsl_utils import external_input\n", |
171 | 169 | "\n",
|
172 | 170 | "import ml_metadata as mlmd"
|
173 | 171 | ]
|
|
290 | 288 | "# `pipeline_root` and `metadata_connection_config` may be passed to\n",
|
291 | 289 | "# InteractiveContext. Calls to InteractiveContext are no-ops outside of the\n",
|
292 | 290 | "# notebook.\n",
|
293 |
| - "context = InteractiveContext()" |
| 291 | + "context = InteractiveContext(pipeline_name=\"Census Income Classification Pipeline\")" |
294 | 292 | ]
|
295 | 293 | },
|
296 | 294 | {
|
|
322 | 320 | },
|
323 | 321 | "outputs": [],
|
324 | 322 | "source": [
|
325 |
| - "example_gen = CsvExampleGen(input=external_input(_data_root))\n", |
| 323 | + "example_gen = CsvExampleGen(input_base=_data_root)\n", |
326 | 324 | "context.run(example_gen)"
|
327 | 325 | ]
|
328 | 326 | },
|
|
356 | 354 | "outputs": [],
|
357 | 355 | "source": [
|
358 | 356 | "# Get the URI of the output artifact representing the training examples, which is a directory\n",
|
359 |
| - "train_uri = os.path.join(example_gen.outputs['examples'].get()[0].uri, 'train')\n", |
| 357 | + "train_uri = os.path.join(example_gen.outputs['examples'].get()[0].uri, 'Split-train')\n", |
360 | 358 | "\n",
|
361 | 359 | "# Get the list of files in this directory (all compressed TFRecord files)\n",
|
362 | 360 | "tfrecord_filenames = [os.path.join(train_uri, name)\n",
|
|
1231 | 1229 | "# different collections. \n",
|
1232 | 1230 | "model_card.quantitative_analysis.graphics.collection = filter_graphs(\n",
|
1233 | 1231 | " model_card.quantitative_analysis.graphics.collection, TARGET_EVAL_GRAPH_NAMES)\n",
|
1234 |
| - "model_card.model_parameters.data.eval.graphics.collection = filter_graphs(\n", |
1235 |
| - " model_card.model_parameters.data.eval.graphics.collection, TARGET_DATASET_GRAPH_NAMES)\n", |
1236 |
| - "model_card.model_parameters.data.train.graphics.collection = filter_graphs(\n", |
1237 |
| - " model_card.model_parameters.data.train.graphics.collection, TARGET_DATASET_GRAPH_NAMES)" |
| 1232 | + "model_card.model_parameters.data[0].graphics.collection = filter_graphs(\n", |
| 1233 | + " model_card.model_parameters.data[0].graphics.collection, TARGET_DATASET_GRAPH_NAMES)\n", |
| 1234 | + "model_card.model_parameters.data[1].graphics.collection = filter_graphs(\n", |
| 1235 | + " model_card.model_parameters.data[1].graphics.collection, TARGET_DATASET_GRAPH_NAMES)" |
1238 | 1236 | ]
|
1239 | 1237 | },
|
1240 | 1238 | {
|
|
1254 | 1252 | },
|
1255 | 1253 | "outputs": [],
|
1256 | 1254 | "source": [
|
1257 |
| - "model_card.model_parameters.data.train.graphics.description = (\n", |
| 1255 | + "model_card.model_parameters.data[0].name = 'train_set'\n", |
| 1256 | + "model_card.model_parameters.data[0].graphics.description = (\n", |
1258 | 1257 | " 'This section includes graphs displaying the class distribution for the '\n",
|
1259 | 1258 | " '“Race” and “Sex” attributes in our training dataset. We chose to '\n",
|
1260 | 1259 | " 'show these graphs in particular because we felt it was important that '\n",
|
1261 | 1260 | " 'users see the class imbalance.'\n",
|
1262 | 1261 | ")\n",
|
1263 |
| - "model_card.model_parameters.data.eval.graphics.description = (\n", |
| 1262 | + "model_card.model_parameters.data[1].name = 'eval_set'\n", |
| 1263 | + "model_card.model_parameters.data[1].graphics.description = (\n", |
1264 | 1264 | " 'Like the training set, we provide graphs showing the class distribution '\n",
|
1265 | 1265 | " 'of the data we used to evaluate our model’s performance. '\n",
|
1266 | 1266 | ")\n",
|
|
0 commit comments