Challenge | Automation solution | Keep It Simple Solution |
---|---|---|
Training-Serving Skew, where differences crop up between training and serving stacks | Feature Store | Transform Pattern |
Clients are interested in a capability that involves multiple steps, only one of which is the ML model | ML Pipelines | Stateless Serving Function |
The incoming data changes characteristics | Continuous evaluation | Scheduled evaluation |
The correct answer changes over time | Continuous traini |
Challenge | Automation solution |
---|---|
Training-Serving Skew, where differences crop up between training and serving stacks | Feature Store |
Clients are interested in a capability that involves multiple steps, only one of which is the ML model | ML Pipelines |
The incoming data changes characteristics | Continuous evaluation |
The correct answer changes over time | Continuous training |
Model fairness issues arise | Mumbo Jumbo |
Parts of the system aren’t changed when new code |
Challenge | Automation solution | Keep It Simple Solution | Complexity needed if … |
---|---|---|---|
Training-Serving Skew, where differences crop up between training and serving stacks | Feature Store | Transform Pattern | Features injected server-side |
Clients are interested in a capability that involves multiple steps, only one of which is the ML model | ML Pipelines | Stateless Serving Function | Cascade of ML models |
The incoming data changes characteristics | Continuous evaluation | Scheduled evaluat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.backends.backend_pdf import PdfPages | |
def _draw_as_table(df, pagesize): | |
alternating_colors = [['white'] * len(df.columns), ['lightgray'] * len(df.columns)] * len(df) | |
alternating_colors = alternating_colors[:len(df)] | |
fig, ax = plt.subplots(figsize=pagesize) | |
ax.axis('tight') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2021 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2021 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE TABLE publicdata.us_tracts AS | |
WITH populated_areas AS ( | |
SELECT | |
bounds, population_density | |
FROM `ai-analytics-solutions`.publicdata.popdensity_sedac_rectangles | |
WHERE | |
year = 2020 AND | |
(tile = 'gpw_v4_population_density_rev11_2020_30_sec_1.asc' OR | |
tile = 'gpw_v4_population_density_rev11_2020_30_sec_2.asc' | |
) AND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT='ai-analytics-solutions' | |
BUCKET='ai-analytics-solutions-kfpdemo' | |
REGION='us-central1' | |
from datetime import datetime | |
import apache_beam as beam | |
def parse_nlp_result(response): | |
return [ | |
# response, # entire string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_geo(LATRES, LONRES, ORIGIN_LAT, ORIGIN_LON, rowno, startcol, endcol): | |
# represent each rectangle by a polygon of its corners | |
top = ORIGIN_LAT - rowno * LATRES | |
bot = ORIGIN_LAT - (rowno+1) * LATRES | |
left = ORIGIN_LON + startcol * LONRES | |
right = ORIGIN_LON + endcol * LONRES | |
poly = json.dumps({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_rectangle_geo(LATRES, LONRES, ORIGIN_LAT, ORIGIN_LON, rowno, startcol, linedata): | |
# find a rectangle of pixels with the same value, and represent that pixel instead | |
endcol = startcol | |
while (endcol < len(linedata)) and (linedata[endcol] == linedata[startcol]): | |
endcol = endcol + 1 | |
return create_geo(LATRES, LONRES, ORIGIN_LAT, ORIGIN_LON, rowno, startcol, endcol) |
NewerOlder