GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Copybara import of the project: · Russ76/python-aiplatform@78069ee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform_v1beta1/types
    • model_evaluation.py
  • samples/generated_samples
    • snippet_metadata_google.cloud.aiplatform.v1.json
    • snippet_metadata_google.cloud.aiplatform.v1beta1.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform_v1beta1/types/model_evaluation.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1beta1/types/model_evaluation.py
+60Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import proto # type: ignore
2121

2222
from google.cloud.aiplatform_v1beta1.types import explanation
23+
from google.cloud.aiplatform_v1beta1.types import model_evaluation_slice
2324
from google.protobuf import struct_pb2 # type: ignore
2425
from google.protobuf import timestamp_pb2 # type: ignore
2526

@@ -81,6 +82,8 @@ class ModelEvaluation(proto.Message):
8182
uploaded from Managed Pipeline, metadata contains a
8283
structured value with keys of "pipeline_job_id",
8384
"evaluation_dataset_type", "evaluation_dataset_path".
85+
bias_configs (google.cloud.aiplatform_v1beta1.types.ModelEvaluation.BiasConfig):
86+
Specify the configuration for bias detection.
8487
"""
8588

8689
class ModelEvaluationExplanationSpec(proto.Message):
@@ -108,6 +111,58 @@ class ModelEvaluationExplanationSpec(proto.Message):
108111
message=explanation.ExplanationSpec,
109112
)
110113

114+
class BiasConfig(proto.Message):
115+
r"""Configuration for bias detection.
116+
117+
Attributes:
118+
bias_slices (google.cloud.aiplatform_v1beta1.types.ModelEvaluationSlice.Slice.SliceSpec):
119+
Specification for how the data should be sliced for bias. It
120+
contains a list of slices, with limitation of two slices.
121+
The first slice of data will be the slice_a. The second
122+
slice in the list (slice_b) will be compared against the
123+
first slice. If only a single slice is provided, then
124+
slice_a will be compared against “not slice_a”. Below are
125+
examples with feature "education" with value "low",
126+
"medium", "high" in the dataset:
127+
128+
Example 1:
129+
130+
::
131+
132+
bias_slices = [{'education': 'low'}]
133+
134+
A single slice provided. In this case, slice_a is the
135+
collection of data with 'education' equals 'low', and
136+
slice_b is the collection of data with 'education' equals
137+
'medium' or 'high'.
138+
139+
Example 2:
140+
141+
::
142+
143+
bias_slices = [{'education': 'low'},
144+
{'education': 'high'}]
145+
146+
Two slices provided. In this case, slice_a is the collection
147+
of data with 'education' equals 'low', and slice_b is the
148+
collection of data with 'education' equals 'high'.
149+
labels (MutableSequence[str]):
150+
Positive labels selection on the target
151+
field.
152+
"""
153+
154+
bias_slices: model_evaluation_slice.ModelEvaluationSlice.Slice.SliceSpec = (
155+
proto.Field(
156+
proto.MESSAGE,
157+
number=1,
158+
message=model_evaluation_slice.ModelEvaluationSlice.Slice.SliceSpec,
159+
)
160+
)
161+
labels: MutableSequence[str] = proto.RepeatedField(
162+
proto.STRING,
163+
number=2,
164+
)
165+
111166
name: str = proto.Field(
112167
proto.STRING,
113168
number=1,
@@ -151,6 +206,11 @@ class ModelEvaluationExplanationSpec(proto.Message):
151206
number=11,
152207
message=struct_pb2.Value,
153208
)
209+
bias_configs: BiasConfig = proto.Field(
210+
proto.MESSAGE,
211+
number=12,
212+
message=BiasConfig,
213+
)
154214

155215

156216
__all__ = tuple(sorted(__protobuf__.manifest))
Collapse file

‎samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json‎

Copy file name to clipboardExpand all lines: samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.26.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{
Collapse file

‎samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json‎

Copy file name to clipboardExpand all lines: samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.26.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.