markdown
stringlengths 0
37k
| code
stringlengths 1
33.3k
| path
stringlengths 8
215
| repo_name
stringlengths 6
77
| license
stringclasses 15
values |
---|---|---|---|---|
Finally, a task that rewards the agent for running down the corridor at a specific velocity is instantiated as a composer.Environment. | #@title The `RunThroughCorridor` environment
env = composer.Environment(
task=task,
time_limit=10,
random_state=np.random.RandomState(42),
strip_singleton_obs_buffer_dim=True,
)
env.reset()
pixels = []
for camera_id in range(3):
pixels.append(env.physics.render(camera_id=camera_id, width=240))
PIL.Image.fromarray(np.hstack(pixels)) | tutorial.ipynb | deepmind/dm_control | apache-2.0 |
Multi-Agent Soccer
Building on Composer and Locomotion libraries, the Multi-agent soccer environments, introduced in this paper, follow a consistent task structure of Walkers, Arena, and Task where instead of a single walker, we inject multiple walkers that can interact with each other physically in the same scene. The code snippet below shows how to instantiate a 2-vs-2 Multi-agent Soccer environment with the simple, 5 degree-of-freedom BoxHead walker type. | #@title 2-v-2 `Boxhead` soccer
random_state = np.random.RandomState(42)
env = soccer.load(
team_size=2,
time_limit=45.,
random_state=random_state,
disable_walker_contacts=False,
walker_type=soccer.WalkerType.BOXHEAD,
)
env.reset()
pixels = []
# Select a random subset of 6 cameras (soccer envs have lots of cameras)
cameras = random_state.choice(env.physics.model.ncam, 6, replace=False)
for camera_id in cameras:
pixels.append(env.physics.render(camera_id=camera_id, width=240))
image = np.vstack((np.hstack(pixels[:3]), np.hstack(pixels[3:])))
PIL.Image.fromarray(image) | tutorial.ipynb | deepmind/dm_control | apache-2.0 |
It can trivially be replaced by e.g. the WalkerType.ANT walker: | #@title 3-v-3 `Ant` soccer
random_state = np.random.RandomState(42)
env = soccer.load(
team_size=3,
time_limit=45.,
random_state=random_state,
disable_walker_contacts=False,
walker_type=soccer.WalkerType.ANT,
)
env.reset()
pixels = []
cameras = random_state.choice(env.physics.model.ncam, 6, replace=False)
for camera_id in cameras:
pixels.append(env.physics.render(camera_id=camera_id, width=240))
image = np.vstack((np.hstack(pixels[:3]), np.hstack(pixels[3:])))
PIL.Image.fromarray(image) | tutorial.ipynb | deepmind/dm_control | apache-2.0 |
Manipulation
The manipulation module provides a robotic arm, a set of simple objects, and tools for building reward functions for manipulation tasks. | #@title Listing all `manipulation` tasks{vertical-output: true}
# `ALL` is a tuple containing the names of all of the environments in the suite.
print('\n'.join(manipulation.ALL))
#@title Listing `manipulation` tasks that use vision{vertical-output: true}
print('\n'.join(manipulation.get_environments_by_tag('vision')))
#@title Loading and simulating a `manipulation` task{vertical-output: true}
env = manipulation.load('stack_2_of_3_bricks_random_order_vision', seed=42)
action_spec = env.action_spec()
def sample_random_action():
return env.random_state.uniform(
low=action_spec.minimum,
high=action_spec.maximum,
).astype(action_spec.dtype, copy=False)
# Step the environment through a full episode using random actions and record
# the camera observations.
frames = []
timestep = env.reset()
frames.append(timestep.observation['front_close'])
while not timestep.last():
timestep = env.step(sample_random_action())
frames.append(timestep.observation['front_close'])
all_frames = np.concatenate(frames, axis=0)
display_video(all_frames, 30) | tutorial.ipynb | deepmind/dm_control | apache-2.0 |
Model Selection
As in Durbin and Koopman, we force a number of the values to be missing. | # Get the basic series
dta_full = df.dinternet[1:].values
dta_miss = dta_full.copy()
# Remove datapoints
missing = np.r_[6,16,26,36,46,56,66,72,73,74,75,76,86,96]-1
dta_miss[missing] = np.nan | examples/notebooks/statespace_sarimax_internet.ipynb | huongttlan/statsmodels | bsd-3-clause |
Then we can consider model selection using the Akaike information criteria (AIC), but running the model for each variant and selecting the model with the lowest AIC value.
There are a couple of things to note here:
When running such a large batch of models, particularly when the autoregressive and moving average orders become large, there is the possibility of poor maximum likelihood convergence. Below we ignore the warnings since this example is illustrative.
We use the option enforce_invertibility=False, which allows the moving average polynomial to be non-invertible, so that more of the models are estimable.
Several of the models do not produce good results, and their AIC value is set to NaN. This is not surprising, as Durbin and Koopman note numerical problems with the high order models. | import warnings
aic_full = pd.DataFrame(np.zeros((6,6), dtype=float))
aic_miss = pd.DataFrame(np.zeros((6,6), dtype=float))
warnings.simplefilter('ignore')
# Iterate over all ARMA(p,q) models with p,q in [0,6]
for p in range(6):
for q in range(6):
if p == 0 and q == 0:
continue
# Estimate the model with no missing datapoints
mod = sm.tsa.statespace.SARIMAX(dta_full, order=(p,0,q), enforce_invertibility=False)
try:
res = mod.fit()
aic_full.iloc[p,q] = res.aic
except:
aic_full.iloc[p,q] = np.nan
# Estimate the model with missing datapoints
mod = sm.tsa.statespace.SARIMAX(dta_miss, order=(p,0,q), enforce_invertibility=False)
try:
res = mod.fit()
aic_miss.iloc[p,q] = res.aic
except:
aic_miss.iloc[p,q] = np.nan | examples/notebooks/statespace_sarimax_internet.ipynb | huongttlan/statsmodels | bsd-3-clause |
For the models estimated over the full (non-missing) dataset, the AIC chooses ARMA(1,1) or ARMA(3,0). Durbin and Koopman suggest the ARMA(1,1) specification is better due to parsimony.
$$
\text{Replication of:}\
\textbf{Table 8.1} ~~ \text{AIC for different ARMA models.}\
\newcommand{\r}[1]{{\color{red}{#1}}}
\begin{array}{lrrrrrr}
\hline
q & 0 & 1 & 2 & 3 & 4 & 5 \
\hline
p & {} & {} & {} & {} & {} & {} \
0 & 0.00 & 549.81 & 519.87 & 520.27 & 519.38 & 518.86 \
1 & 529.24 & \r{514.30} & 516.25 & 514.58 & 515.10 & 516.28 \
2 & 522.18 & 516.29 & 517.16 & 515.77 & 513.24 & 514.73 \
3 & \r{511.99} & 513.94 & 515.92 & 512.06 & 513.72 & 514.50 \
4 & 513.93 & 512.89 & nan & nan & 514.81 & 516.08 \
5 & 515.86 & 517.64 & nan & nan & nan & nan \
\hline
\end{array}
$$
For the models estimated over missing dataset, the AIC chooses ARMA(1,1)
$$
\text{Replication of:}\
\textbf{Table 8.2} ~~ \text{AIC for different ARMA models with missing observations.}\
\begin{array}{lrrrrrr}
\hline
q & 0 & 1 & 2 & 3 & 4 & 5 \
\hline
p & {} & {} & {} & {} & {} & {} \
0 & 0.00 & 488.93 & 464.01 & 463.86 & 462.63 & 463.62 \
1 & 468.01 & \r{457.54} & 459.35 & 458.66 & 459.15 & 461.01 \
2 & 469.68 & nan & 460.48 & 459.43 & 459.23 & 460.47 \
3 & 467.10 & 458.44 & 459.64 & 456.66 & 459.54 & 460.05 \
4 & 469.00 & 459.52 & nan & 463.04 & 459.35 & 460.96 \
5 & 471.32 & 461.26 & nan & nan & 461.00 & 462.97 \
\hline
\end{array}
$$
Note: the AIC values are calculated differently than in Durbin and Koopman, but show overall similar trends.
Postestimation
Using the ARMA(1,1) specification selected above, we perform in-sample prediction and out-of-sample forecasting. | # Statespace
mod = sm.tsa.statespace.SARIMAX(dta_miss, order=(1,0,1))
res = mod.fit()
print(res.summary())
# In-sample one-step-ahead predictions
predict_res = res.predict(full_results=True)
predict = predict_res.forecasts
cov = predict_res.forecasts_error_cov
predict_idx = np.arange(len(predict[0]))
# 95% confidence intervals
critical_value = norm.ppf(1 - 0.05 / 2.)
std_errors = np.sqrt(cov.diagonal().T)
ci = np.c_[
(predict - critical_value*std_errors)[:, :, None],
(predict + critical_value*std_errors)[:, :, None],
][0].T
# Out-of-sample forecasts and confidence intervals
nforecast = 20
forecast = res.forecast(nforecast)
forcast_idx = len(dta_full) + np.arange(nforecast)
# Graph
fig, ax = plt.subplots(figsize=(12,6))
ax.xaxis.grid()
ax.plot(predict_idx, dta_miss, 'k.')
# Plot
ax.plot(predict_idx, predict[0], 'gray');
ax.fill_between(predict_idx, ci[0], ci[1], alpha=0.1)
ax.plot(forcast_idx[-20:], forecast[0], 'k--', linestyle='--', linewidth=2)
ax.set(title='Figure 8.9 - Internet series'); | examples/notebooks/statespace_sarimax_internet.ipynb | huongttlan/statsmodels | bsd-3-clause |
We'll work in our test directory, where ActivitySim has saved the estimation data bundles. | os.chdir('test') | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Load data and prep model for estimation | modelname = "mandatory_tour_frequency"
from activitysim.estimation.larch import component_model
model, data = component_model(modelname, return_data=True) | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Review data loaded from the EDB
The next step is to read the EDB, including the coefficients, model settings, utilities specification, and chooser and alternative data.
Coefficients | data.coefficients | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Utility specification | data.spec | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Chooser data | data.chooser_data | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Estimate
With the model setup for estimation, the next step is to estimate the model coefficients. Make sure to use a sufficiently large enough household sample and set of zones to avoid an over-specified model, which does not have a numerically stable likelihood maximizing solution. Larch has a built-in estimation methods including BHHH, and also offers access to more advanced general purpose non-linear optimizers in the scipy package, including SLSQP, which allows for bounds and constraints on parameters. BHHH is the default and typically runs faster, but does not follow constraints on parameters. | model.estimate() | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Estimated coefficients | model.parameter_summary() | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Output Estimation Results | from activitysim.estimation.larch import update_coefficients
result_dir = data.edb_directory/"estimated"
update_coefficients(
model, data, result_dir,
output_file=f"{modelname}_coefficients_revised.csv",
); | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Write the model estimation report, including coefficient t-statistic and log likelihood | model.to_xlsx(
result_dir/f"{modelname}_model_estimation.xlsx",
data_statistics=False,
) | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Next Steps
The final step is to either manually or automatically copy the *_coefficients_revised.csv file to the configs folder, rename it to *_coefficients.csv, and run ActivitySim in simulation mode. | pd.read_csv(result_dir/f"{modelname}_coefficients_revised.csv") | activitysim/examples/example_estimation/notebooks/07_mand_tour_freq.ipynb | UDST/activitysim | bsd-3-clause |
Import the required libraries and define constants | import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from google.cloud import bigquery
from google.cloud.bigquery import Client
DATASET = "[your-bigquery-dataset-id]" # set the BigQuery dataset-id
TRAINING_DATA_TABLE = "[your-bigquery-table-id-to-store-the-training-data]" # set the BigQuery table-id to store the training data | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Create a BigQuery dataset
<a name="section-5"></a>
@bigquery
-- create a dataset in BigQuery
CREATE SCHEMA pricing_optimization
OPTIONS(
location="us"
)
Load the dataset from Cloud Storage
<a name="section-6"></a> | DATA_LOCATION = "gs://cloud-samples-data/ai-platform-unified/datasets/tabular/cdm_pricing_large_table.csv"
df = pd.read_csv(DATA_LOCATION)
print(df.shape)
df.head() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
You will build a forecast model on this data and thus determine the best price for a product. For this type of model, you will not be using many fields: only the sales and price related ones. For the current execrcise, focus on the following fields:
Product_ID
Customer_Hierarchy
Fiscal_Date
List_Price_Converged
Invoiced_quantity_in_Pieces
Net_Sales
Data Analysis
<a name="section-7"></a>
First, explore the data and distributions.
Select the required columns from the dataframe. | id_col = "Product_ID"
date_col = "Fiscal_Date"
categ_cols = ["Customer_Hierarchy"]
num_cols = ["List_Price_Converged", "Invoiced_quantity_in_Pieces", "Net_Sales"]
df = df[[id_col, date_col] + categ_cols + num_cols].copy()
df.head() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Check the column types and null values in the dataframe. | df.info() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
This data description reveals that there are no null values in the data. Also, the field Fiscal_Date which is a date field is loaded as an object type.
Change the type of the date field to datetime. | df["Fiscal_Date"] = pd.to_datetime(df["Fiscal_Date"], infer_datetime_format=True) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Plot the distributions for the categorical fields. | for i in categ_cols:
df[i].value_counts(normalize=True).plot(kind="bar")
plt.title(i)
plt.show() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Plot the distributions for the numerical fields. | for i in num_cols:
_, ax = plt.subplots(1, 2, figsize=(10, 4))
df[i].plot(kind="box", ax=ax[0])
df[i].plot(kind="hist", ax=ax[1])
ax[0].set_title(i + "-Boxplot")
ax[1].set_title(i + "-Histogram")
plt.show() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Check the maximum date and minimum date in Fiscal_Date column. | print(df["Fiscal_Date"].max())
print(df["Fiscal_Date"].min()) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Check the product distribution across each category. | grp_cols = ["Customer_Hierarchy", "Product_ID"]
grp_df = df[grp_cols].groupby(by=grp_cols).count().reset_index()
grp_df.groupby("Customer_Hierarchy").nunique() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Check the percentage changes in the orders based on the percentage changes in the price. | # aggregate the data
df_aggr = (
df.groupby(["Product_ID", "List_Price_Converged"])
.agg({"Fiscal_Date": min, "Invoiced_quantity_in_Pieces": sum, "Net_Sales": sum})
.reset_index()
)
# rename the aggregated columns
df_aggr.rename(
columns={
"Fiscal_Date": "First_price_date",
"Invoiced_quantity_in_Pieces": "Total_ordered_pieces",
"Net_Sales": "Total_net_sales",
},
inplace=True,
)
# sort values chronologically
df_aggr.sort_values(by=["Product_ID", "First_price_date"], inplace=True)
df_aggr.reset_index(drop=True, inplace=True)
# add columns for previous values
df_aggr["Previous_List"] = df_aggr.groupby(["Product_ID"])[
"List_Price_Converged"
].shift()
df_aggr["Previous_Total_ordered_pieces"] = df_aggr.groupby(["Product_ID"])[
"Total_ordered_pieces"
].shift()
# average price change across sku's
df_aggr["price_change_perc"] = (
(df_aggr["List_Price_Converged"] - df_aggr["Previous_List"])
/ df_aggr["Previous_List"].fillna(0)
* 100
)
df_aggr["order_change_perc"] = (
(df_aggr["Total_ordered_pieces"] - df_aggr["Previous_Total_ordered_pieces"])
/ df_aggr["Previous_Total_ordered_pieces"].fillna(0)
* 100
)
# plot a scatterplot to visualize the changes
sns.scatterplot(
x="price_change_perc",
y="order_change_perc",
data=df_aggr,
hue="Product_ID",
legend=False,
)
plt.title("Percentage of change in price vs order")
plt.show() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
For most of the products, the percentage change in orders are high where the percentage changes in the prices are low. This suggests that too much change in the prices can affect the number of orders.
Note: There seem to be some outliers in the data as percentage changes greater than 800 are found. In the current exercise, do not take any manual measures to deal with outliers as you will create a BigQuery ML timeseries model that already deals with outliers.
Preprocess the data for training
<a name="section-8"></a>
Check which Product_ID's have the maximum orders. | df_orders = df.groupby(["Product_ID", "Customer_Hierarchy"], as_index=False)[
"Invoiced_quantity_in_Pieces"
].sum()
df_orders.loc[
df_orders.groupby("Customer_Hierarchy")["Invoiced_quantity_in_Pieces"].idxmax()
] | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
From the above result, you can infer the following:
Under the Food category, SKU 62 has the maximum orders.
Under the Manufacturing category, SKU 17 has the maximum orders.
Under the Paper category, SKU 107 has the maximum orders.
Under the Publishing category, SKU 8 has the maximum orders.
Under the Utilities category, SKU 140 has the maximum orders.
Given that there are too many ids and only a few records for most of them, consider only the above Product_IDs for which there are a maximum number of orders.
Note: The Invoiced_quantity_in_Pieces field seems to be a float type rather than an int type as it should be. This could be because the data itself might be averaged in the first place.
Check the various prices available for these Product_IDs. | df_type_food = df[(df["Product_ID"] == "SKU 62") & (df["Customer_Hierarchy"] == "Food")]
print("Food :")
print(df_type_food["List_Price_Converged"].value_counts())
df_type_manuf = df[
(df["Product_ID"] == "SKU 17") & (df["Customer_Hierarchy"] == "Manufacturing")
]
print("Manufacturing :")
print(df_type_manuf["List_Price_Converged"].value_counts())
df_type_paper = df[
(df["Product_ID"] == "SKU 107") & (df["Customer_Hierarchy"] == "Paper")
]
print("Paper :")
print(df_type_paper["List_Price_Converged"].value_counts())
df_type_pub = df[
(df["Product_ID"] == "SKU 8") & (df["Customer_Hierarchy"] == "Publishing")
]
print("Publishing :")
print(df_type_pub["List_Price_Converged"].value_counts())
df_type_util = df[
(df["Product_ID"] == "SKU 140") & (df["Customer_Hierarchy"] == "Utilities")
]
print("Utilities :")
print(df_type_util["List_Price_Converged"].value_counts()) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
In the publishing category, Product_ID SKU 8 and SKU 17 are less than or equal to two different prices in the entire data and so you will exclude them and consider the rest for building the forecast model. The idea here is to train a forecast model on the timeseries data for products with different prices.
Join the data for all the Product_IDs into one dataframe and remove duplicate records. | df_final = pd.concat([df_type_food, df_type_paper, df_type_util])
df_final = (
df_final[
[
"Product_ID",
"Fiscal_Date",
"Customer_Hierarchy",
"List_Price_Converged",
"Invoiced_quantity_in_Pieces",
]
]
.drop_duplicates()
.reset_index(drop=True)
)
df_final.head() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Save the data to a BigQuery table. | bq_client = bigquery.Client(project=PROJECT_ID)
job_config = bigquery.LoadJobConfig(
# Specify a (partial) schema. All columns are always written to the
# table. The schema is used to assist in data type definitions.
schema=[
bigquery.SchemaField("Product_ID", bigquery.enums.SqlTypeNames.STRING),
bigquery.SchemaField("Fiscal_Date", bigquery.enums.SqlTypeNames.DATE),
bigquery.SchemaField("List_Price_Converged", bigquery.enums.SqlTypeNames.FLOAT),
bigquery.SchemaField(
"Invoiced_quantity_in_Pieces", bigquery.enums.SqlTypeNames.FLOAT
),
],
# Optionally, set the write disposition. BigQuery appends loaded rows
# to an existing table by default, but with WRITE_TRUNCATE write
# disposition it replaces the table with the loaded data.
write_disposition="WRITE_TRUNCATE",
)
# save the dataframe to a table in the created dataset
job = bq_client.load_table_from_dataframe(
df_final,
"{}.{}.{}".format(PROJECT_ID, DATASET, TRAINING_DATA_TABLE),
job_config=job_config,
) # Make an API request.
job.result() # Wait for the job to complete. | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Train the model using BigQuery ML
<a name="section-9"></a>
Train an Arima-Plus model on the data using BigQuery ML.
@bigquery
create or replace model pricing_optimization.bqml_arima
options
(model_type = 'ARIMA_PLUS',
time_series_timestamp_col = 'Fiscal_Date',
time_series_data_col = 'Invoiced_quantity_in_Pieces',
time_series_id_col = 'ID'
) as
select
Fiscal_Date,
Concat(Product_ID,"_" ,Cast(List_Price_Converged as string)) as ID,
Invoiced_quantity_in_Pieces
from
pricing_optimization.TRAINING_DATA
Generate forecasts from the model
<a name="section-10"></a>
Predict the sales for the next 30 days for each id and save to a dataframe. | client = Client()
query = '''
DECLARE HORIZON STRING DEFAULT "30"; #number of values to forecast
DECLARE CONFIDENCE_LEVEL STRING DEFAULT "0.90"; ## required confidence level
EXECUTE IMMEDIATE format("""
SELECT
*
FROM
ML.FORECAST(MODEL pricing_optimization.bqml_arima,
STRUCT(%s AS horizon,
%s AS confidence_level)
)
""",HORIZON,CONFIDENCE_LEVEL)'''
job = client.query(query)
dfforecast = job.to_dataframe()
dfforecast.head() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Interpret the results to choose the best price
<a name="section-11"></a>
Calculate average forecast values for the forecast duration. | dfforecast_avg = (
dfforecast[["ID", "forecast_value"]].groupby("ID", as_index=False).mean()
) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Extract the ID and Price fields from the ID field. | dfforecast_avg["Product_ID"] = dfforecast_avg["ID"].apply(lambda x: x.split("_")[0])
dfforecast_avg["Price"] = dfforecast_avg["ID"].apply(lambda x: x.split("_")[1]) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Plot the average forecasted sales vs. the price of the product. | for i in dfforecast_avg["Product_ID"].unique():
dfforecast_avg[dfforecast_avg["Product_ID"] == i].set_index("Price").sort_values(
"forecast_value"
).plot(kind="bar")
plt.title("Price vs. Average Sales for " + i)
plt.show() | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Based on the plots for price vs. the average forecasted orders, it can be said that to use the maximum orders, each of the considered Product_IDs can follow the below prices:
SKU 107's price range can be from 4.44 - 4.73 units
SKU 140's price can be 1.95 units
SKU 62's price can be 4.23 units
Clean Up
<a name="section-12"></a>
To clean up all Google Cloud resources used in this project, you can delete the Google Cloud project you used for the tutorial.
Otherwise, you can delete the individual resources you created in this tutorial. The following code deletes the entire dataset. | # Construct a BigQuery client object.
client = bigquery.Client()
# TODO(developer): Set model_id to the ID of the model to fetch.
dataset_id = "{PROJECT}.{DATASET}".format(PROJECT=PROJECT_ID, DATASET=DATASET)
# Use the delete_contents parameter to delete a dataset and its contents.
# Use the not_found_ok parameter to not receive an error if the dataset has already been deleted.
client.delete_dataset(
dataset_id, delete_contents=True, not_found_ok=True
) # Make an API request.
print("Deleted dataset '{}'.".format(dataset_id)) | notebooks/community/managed_notebooks/pricing_optimization/pricing-optimization.ipynb | GoogleCloudPlatform/vertex-ai-samples | apache-2.0 |
Explain the predictions made by the model using GradientExplainer | import shap
# since we have two inputs we pass a list of inputs to the explainer
explainer = shap.GradientExplainer(model, [x_train, x_train])
# we explain the model's predictions on the first three samples of the test set
shap_values = explainer.shap_values([x_test[:3], x_test[:3]])
# since the model has 10 outputs we get a list of 10 explanations (one for each output)
print(len(shap_values))
# since the model has 2 inputs we get a list of 2 explanations (one for each input) for each output
print(len(shap_values[0]))
# here we plot the explanations for all classes for the first input (this is the feed forward input)
shap.image_plot([shap_values[i][0] for i in range(10)], x_test[:3])
# here we plot the explanations for all classes for the second input (this is the conv-net input)
shap.image_plot([shap_values[i][1] for i in range(10)], x_test[:3]) | notebooks/image_examples/image_classification/Multi-input Gradient Explainer MNIST Example.ipynb | slundberg/shap | mit |
Estimating the sampling error
By setting return_variances=True we get an estimate of how accurate our explanations are. We can see that the default number of samples (200) that were used provide fairly low variance estimates (compared to the magnitude of the shap_values above). Note that you can always use the nsamples parameter to control how many samples are used. | # get the variance of our estimates
shap_values, shap_values_var = explainer.shap_values([x_test[:3], x_test[:3]], return_variances=True)
# here we plot the explanations for all classes for the first input (this is the feed forward input)
shap.image_plot([shap_values_var[i][0] for i in range(10)], x_test[:3]) | notebooks/image_examples/image_classification/Multi-input Gradient Explainer MNIST Example.ipynb | slundberg/shap | mit |
Document Table of Contents
1. Key Properties
2. Key Properties --> Software Properties
3. Key Properties --> Timestep Framework
4. Key Properties --> Timestep Framework --> Split Operator Order
5. Key Properties --> Tuning Applied
6. Grid
7. Grid --> Resolution
8. Transport
9. Emissions Concentrations
10. Emissions Concentrations --> Surface Emissions
11. Emissions Concentrations --> Atmospheric Emissions
12. Emissions Concentrations --> Concentrations
13. Gas Phase Chemistry
14. Stratospheric Heterogeneous Chemistry
15. Tropospheric Heterogeneous Chemistry
16. Photo Chemistry
17. Photo Chemistry --> Photolysis
1. Key Properties
Key properties of the atmospheric chemistry
1.1. Model Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
Overview of atmospheric chemistry model. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.model_overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.2. Model Name
Is Required: TRUE Type: STRING Cardinality: 1.1
Name of atmospheric chemistry model code. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.model_name')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.3. Chemistry Scheme Scope
Is Required: TRUE Type: ENUM Cardinality: 1.N
Atmospheric domains covered by the atmospheric chemistry model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.chemistry_scheme_scope')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "troposhere"
# "stratosphere"
# "mesosphere"
# "mesosphere"
# "whole atmosphere"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.4. Basic Approximations
Is Required: TRUE Type: STRING Cardinality: 1.1
Basic approximations made in the atmospheric chemistry model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.basic_approximations')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.5. Prognostic Variables Form
Is Required: TRUE Type: ENUM Cardinality: 1.N
Form of prognostic variables in the atmospheric chemistry component. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.prognostic_variables_form')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "3D mass/mixing ratio for gas"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.6. Number Of Tracers
Is Required: TRUE Type: INTEGER Cardinality: 1.1
Number of advected tracers in the atmospheric chemistry model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.number_of_tracers')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.7. Family Approach
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Atmospheric chemistry calculations (not advection) generalized into families of species? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.family_approach')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.8. Coupling With Chemical Reactivity
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Atmospheric chemistry transport scheme turbulence is couple with chemical reactivity? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.coupling_with_chemical_reactivity')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
2. Key Properties --> Software Properties
Software properties of aerosol code
2.1. Repository
Is Required: FALSE Type: STRING Cardinality: 0.1
Location of code for this component. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.software_properties.repository')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
2.2. Code Version
Is Required: FALSE Type: STRING Cardinality: 0.1
Code version identifier. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.software_properties.code_version')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
2.3. Code Languages
Is Required: FALSE Type: STRING Cardinality: 0.N
Code language(s). | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.software_properties.code_languages')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3. Key Properties --> Timestep Framework
Timestepping in the atmospheric chemistry model
3.1. Method
Is Required: TRUE Type: ENUM Cardinality: 1.1
Mathematical method deployed to solve the evolution of a given variable | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.method')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Operator splitting"
# "Integrated"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.2. Split Operator Advection Timestep
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Timestep for chemical species advection (in seconds) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_advection_timestep')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.3. Split Operator Physical Timestep
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Timestep for physics (in seconds). | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_physical_timestep')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.4. Split Operator Chemistry Timestep
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Timestep for chemistry (in seconds). | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_chemistry_timestep')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.5. Split Operator Alternate Order
Is Required: FALSE Type: BOOLEAN Cardinality: 0.1
? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_alternate_order')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.6. Integrated Timestep
Is Required: TRUE Type: INTEGER Cardinality: 1.1
Timestep for the atmospheric chemistry model (in seconds) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.integrated_timestep')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.7. Integrated Scheme Type
Is Required: TRUE Type: ENUM Cardinality: 1.1
Specify the type of timestep scheme | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.integrated_scheme_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Explicit"
# "Implicit"
# "Semi-implicit"
# "Semi-analytic"
# "Impact solver"
# "Back Euler"
# "Newton Raphson"
# "Rosenbrock"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4. Key Properties --> Timestep Framework --> Split Operator Order
**
4.1. Turbulence
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for turbulence scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.turbulence')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.2. Convection
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for convection scheme This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.convection')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.3. Precipitation
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for precipitation scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.precipitation')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.4. Emissions
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for emissions scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.emissions')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.5. Deposition
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for deposition scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.deposition')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.6. Gas Phase Chemistry
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for gas phase chemistry scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.gas_phase_chemistry')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.7. Tropospheric Heterogeneous Phase Chemistry
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for tropospheric heterogeneous phase chemistry scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.tropospheric_heterogeneous_phase_chemistry')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.8. Stratospheric Heterogeneous Phase Chemistry
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for stratospheric heterogeneous phase chemistry scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.stratospheric_heterogeneous_phase_chemistry')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.9. Photo Chemistry
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for photo chemistry scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.photo_chemistry')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.10. Aerosols
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Call order for aerosols scheme. This should be an integer greater than zero, and may be the same value as for another process if they are calculated at the same time. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.timestep_framework.split_operator_order.aerosols')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5. Key Properties --> Tuning Applied
Tuning methodology for atmospheric chemistry component
5.1. Description
Is Required: TRUE Type: STRING Cardinality: 1.1
General overview description of tuning: explain and motivate the main targets and metrics retained. &Document the relative weight given to climate performance metrics versus process oriented metrics, &and on the possible conflicts with parameterization level tuning. In particular describe any struggle &with a parameter value that required pushing it to its limits to solve a particular model deficiency. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.tuning_applied.description')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.2. Global Mean Metrics Used
Is Required: FALSE Type: STRING Cardinality: 0.N
List set of metrics of the global mean state used in tuning model/component | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.tuning_applied.global_mean_metrics_used')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.3. Regional Metrics Used
Is Required: FALSE Type: STRING Cardinality: 0.N
List of regional metrics of mean state used in tuning model/component | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.tuning_applied.regional_metrics_used')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.4. Trend Metrics Used
Is Required: FALSE Type: STRING Cardinality: 0.N
List observed trend metrics used in tuning model/component | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.key_properties.tuning_applied.trend_metrics_used')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6. Grid
Atmospheric chemistry grid
6.1. Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
Describe the general structure of the atmopsheric chemistry grid | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.2. Matches Atmosphere Grid
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
* Does the atmospheric chemistry grid match the atmosphere grid?* | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.matches_atmosphere_grid')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7. Grid --> Resolution
Resolution in the atmospheric chemistry grid
7.1. Name
Is Required: TRUE Type: STRING Cardinality: 1.1
This is a string usually used by the modelling group to describe the resolution of this grid, e.g. ORCA025, N512L180, T512L70 etc. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.resolution.name')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.2. Canonical Horizontal Resolution
Is Required: FALSE Type: STRING Cardinality: 0.1
Expression quoted for gross comparisons of resolution, eg. 50km or 0.1 degrees etc. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.resolution.canonical_horizontal_resolution')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.3. Number Of Horizontal Gridpoints
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Total number of horizontal (XY) points (or degrees of freedom) on computational grid. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.resolution.number_of_horizontal_gridpoints')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.4. Number Of Vertical Levels
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Number of vertical levels resolved on computational grid. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.resolution.number_of_vertical_levels')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.5. Is Adaptive Grid
Is Required: FALSE Type: BOOLEAN Cardinality: 0.1
Default is False. Set true if grid resolution changes during execution. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.grid.resolution.is_adaptive_grid')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
8. Transport
Atmospheric chemistry transport
8.1. Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
General overview of transport implementation | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.transport.overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
8.2. Use Atmospheric Transport
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is transport handled by the atmosphere, rather than within atmospheric cehmistry? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.transport.use_atmospheric_transport')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
8.3. Transport Details
Is Required: FALSE Type: STRING Cardinality: 0.1
If transport is handled within the atmospheric chemistry scheme, describe it. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.transport.transport_details')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
9. Emissions Concentrations
Atmospheric chemistry emissions
9.1. Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
Overview atmospheric chemistry emissions | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10. Emissions Concentrations --> Surface Emissions
**
10.1. Sources
Is Required: FALSE Type: ENUM Cardinality: 0.N
Sources of the chemical species emitted at the surface that are taken into account in the emissions scheme | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.sources')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Vegetation"
# "Soil"
# "Sea surface"
# "Anthropogenic"
# "Biomass burning"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10.2. Method
Is Required: FALSE Type: ENUM Cardinality: 0.N
Methods used to define chemical species emitted directly into model layers above the surface (several methods allowed because the different species may not use the same method). | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.method')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Climatology"
# "Spatially uniform mixing ratio"
# "Spatially uniform concentration"
# "Interactive"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10.3. Prescribed Climatology Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted at the surface and prescribed via a climatology, and the nature of the climatology (E.g. CO (monthly), C2H6 (constant)) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.prescribed_climatology_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10.4. Prescribed Spatially Uniform Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted at the surface and prescribed as spatially uniform | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.prescribed_spatially_uniform_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10.5. Interactive Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted at the surface and specified via an interactive method | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.interactive_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
10.6. Other Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted at the surface and specified via any other method | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.surface_emissions.other_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11. Emissions Concentrations --> Atmospheric Emissions
TO DO
11.1. Sources
Is Required: FALSE Type: ENUM Cardinality: 0.N
Sources of chemical species emitted in the atmosphere that are taken into account in the emissions scheme. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.sources')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Aircraft"
# "Biomass burning"
# "Lightning"
# "Volcanos"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11.2. Method
Is Required: FALSE Type: ENUM Cardinality: 0.N
Methods used to define the chemical species emitted in the atmosphere (several methods allowed because the different species may not use the same method). | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.method')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Climatology"
# "Spatially uniform mixing ratio"
# "Spatially uniform concentration"
# "Interactive"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11.3. Prescribed Climatology Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted in the atmosphere and prescribed via a climatology (E.g. CO (monthly), C2H6 (constant)) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.prescribed_climatology_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11.4. Prescribed Spatially Uniform Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted in the atmosphere and prescribed as spatially uniform | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.prescribed_spatially_uniform_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11.5. Interactive Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted in the atmosphere and specified via an interactive method | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.interactive_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
11.6. Other Emitted Species
Is Required: FALSE Type: STRING Cardinality: 0.1
List of chemical species emitted in the atmosphere and specified via an "other method" | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.atmospheric_emissions.other_emitted_species')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
12. Emissions Concentrations --> Concentrations
TO DO
12.1. Prescribed Lower Boundary
Is Required: FALSE Type: STRING Cardinality: 0.1
List of species prescribed at the lower boundary. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.concentrations.prescribed_lower_boundary')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
12.2. Prescribed Upper Boundary
Is Required: FALSE Type: STRING Cardinality: 0.1
List of species prescribed at the upper boundary. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.emissions_concentrations.concentrations.prescribed_upper_boundary')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
13. Gas Phase Chemistry
Atmospheric chemistry transport
13.1. Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
Overview gas phase atmospheric chemistry | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.gas_phase_chemistry.overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
13.2. Species
Is Required: FALSE Type: ENUM Cardinality: 0.N
Species included in the gas phase chemistry scheme. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.gas_phase_chemistry.species')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "HOx"
# "NOy"
# "Ox"
# "Cly"
# "HSOx"
# "Bry"
# "VOCs"
# "isoprene"
# "H2O"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
13.3. Number Of Bimolecular Reactions
Is Required: TRUE Type: INTEGER Cardinality: 1.1
The number of bi-molecular reactions in the gas phase chemistry scheme. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.gas_phase_chemistry.number_of_bimolecular_reactions')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
13.4. Number Of Termolecular Reactions
Is Required: TRUE Type: INTEGER Cardinality: 1.1
The number of ter-molecular reactions in the gas phase chemistry scheme. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.gas_phase_chemistry.number_of_termolecular_reactions')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
13.5. Number Of Tropospheric Heterogenous Reactions
Is Required: TRUE Type: INTEGER Cardinality: 1.1
The number of reactions in the tropospheric heterogeneous chemistry scheme. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.atmoschem.gas_phase_chemistry.number_of_tropospheric_heterogenous_reactions')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/cccma/cmip6/models/canesm5/atmoschem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
Subsets and Splits