markdown stringlengths 0 37k | code stringlengths 1 33.3k | path stringlengths 8 215 | repo_name stringlengths 6 77 | license stringclasses 15
values |
|---|---|---|---|---|
<div class="alert alert-success">
**EXERCISE 6**:
* Loop over the data files, read and process the file using our defined function, and append the dataframe to a list.
* Combine the the different DataFrames in the list into a single DataFrame where the different columns are the different stations. Call the result `co... | # %load _solutions/case4_air_quality_processing12.py
# %load _solutions/case4_air_quality_processing13.py
combined_data.head() | notebooks/case4_air_quality_processing.ipynb | jorisvandenbossche/DS-python-data-analysis | bsd-3-clause |
Finally, we don't want to have to repeat this each time we use the data. Therefore, let's save the processed data to a csv file. | # let's first give the index a descriptive name
combined_data.index.name = 'datetime'
combined_data.to_csv("airbase_data_processed.csv") | notebooks/case4_air_quality_processing.ipynb | jorisvandenbossche/DS-python-data-analysis | bsd-3-clause |
Example 2: Extracellular response of synaptic input
This is an example of LFPy running in a Jupyter notebook. To run through this example code and produce output, press <shift-Enter> in each code block below.
First step is to import LFPy and other packages for analysis and plotting: | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import LFPy | examples/LFPy-example-02.ipynb | LFPy/LFPy | gpl-3.0 |
Create some dictionarys with parameters for cell, synapse and extracellular electrode: | cellParameters = {
'morphology': 'morphologies/L5_Mainen96_LFPy.hoc',
'tstart': -50,
'tstop': 100,
'dt': 2**-4,
'passive': True,
}
synapseParameters = {
'syntype': 'Exp2Syn',
'e': 0.,
'tau1': 0.5,
'tau2': 2.0,
'weight': 0.005,
'record_current': True,
}
z = np.mgrid[-400:120... | examples/LFPy-example-02.ipynb | LFPy/LFPy | gpl-3.0 |
Then, create the cell, synapse and electrode objects using the
LFPy.Cell, LFPy.Synapse, LFPy.RecExtElectrode classes. | cell = LFPy.Cell(**cellParameters)
cell.set_pos(x=-10, y=0, z=0)
cell.set_rotation(x=4.98919, y=-4.33261, z=np.pi)
synapse = LFPy.Synapse(cell,
idx = cell.get_closest_idx(z=800),
**synapseParameters)
synapse.set_spike_times(np.array([10, 30, 50]))
... | examples/LFPy-example-02.ipynb | LFPy/LFPy | gpl-3.0 |
Run the simulation using cell.simulate() probing the extracellular potential with
the additional keyword argument probes=[electrode] | cell.simulate(probes=[electrode]) | examples/LFPy-example-02.ipynb | LFPy/LFPy | gpl-3.0 |
Then plot the somatic potential and the prediction obtained using the RecExtElectrode instance
(now accessible as electrode.data): | fig = plt.figure(figsize=(12, 6))
gs = GridSpec(2, 3)
ax0 = fig.add_subplot(gs[:, 0])
ax0.plot(cell.x.T, cell.z.T, 'k')
ax0.plot(synapse.x, synapse.z,
color='r', marker='o', markersize=10,
label='synapse')
ax0.plot(electrode.x, electrode.z, '.', color='g',
label='electrode')
ax0.axis([-500... | examples/LFPy-example-02.ipynb | LFPy/LFPy | gpl-3.0 |
Now I can run my script: | %cd data/SF_Si_bulk/
%run ../../../../../Code/SF/sf.py | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
Not very elegant, I know. It's just for demo pourposes. | cd ../../../ | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
I have first to import a few modules/set up a few things: | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
# plt.rcParams['figure.figsize'] = (9., 6.)
%matplotlib inline | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
Next I can read the data from a local folder: | sf_c = np.genfromtxt(
'data/SF_Si_bulk/Spfunctions/spftot_exp_kpt_1_19_bd_1_4_s1.0_p1.0_800ev_np1.dat')
sf_gw = np.genfromtxt(
'data/SF_Si_bulk/Spfunctions/spftot_gw_s1.0_p1.0_800ev.dat')
#!gvim spftot_exp_kpt_1_19_bd_1_4_s1.0_p1.0_800ev_np1.dat | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
Now I can plot the stored arrays. | plt.plot(sf_c[:,0], sf_c[:,1], label='1-pole cumulant')
plt.plot(sf_gw[:,0], sf_gw[:,1], label='GW')
plt.xlim(-50, 0)
plt.ylim(0, 300)
plt.title("Bulk Si - Spectral function - ib=1, ikpt=1")
plt.xlabel("Energy (eV)")
plt.grid(); plt.legend(loc='best') | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
Creating a PDF document
I can create a PDF version of this notebook from itself, using the command line: | !jupyter-nbconvert --to pdf cumulant-to-pdf.ipynb
pwd
!xpdf cumulant-to-pdf.pdf | cumulant-to-pdf.ipynb | teoguso/sol_1116 | mit |
自己构造一组随机的数据 | X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
y = np.array([1, 1, 1, 2, 2, 2]) | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
初始化多个分类器模型 | clf1 = LogisticRegression(random_state=1)
clf2 = RandomForestClassifier(random_state=1)
clf3 = GaussianNB() | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
初始化投票器 | eclf1 = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='hard') | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
训练模型 | eclf1 = eclf1.fit(X, y) | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
预测 | print(eclf1.predict(X)) | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
投票器的设置
投票器可以设置
voting
hard表示直接以多数原则投票确定结果,soft表示基于预测概率之和的argmax来预测类别标签
n_jobs
并行任务数设置
weights
不同分类器的权重
flatten_transform(0.19版本接口)
仅当voting为'soft'时有用.flatten_transform = true时影响变换输出的形状,变换方法返回形为(n_samples,n_classifiers * n_classes).如果flatten_transform = false,则返回(n_classifiers,n_samples,n_classes) | eclf3 = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)],n_jobs=3, voting='soft', weights=[2,1,1])
eclf3 = eclf3.fit(X, y)
print(eclf3.predict(X))
print(eclf3.transform(X).shape) | ipynbs/appendix/ensemble/voting.ipynb | NLP-Deeplearning-Club/Classic-ML-Methods-Algo | mit |
TensorFlow Addons Optimizers: CyclicalLearningRate
<table class="tfo-notebook-buttons" align="left">
<td>
<a target="_blank" href="https://www.tensorflow.org/addons/tutorials/optimizers_cyclicallearningrate"><img src="https://www.tensorflow.org/images/tf_logo_32px.png" />View on TensorFlow.org</a>
</td>
<td>
... | !pip install -q -U tensorflow_addons
from tensorflow.keras import layers
import tensorflow_addons as tfa
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
tf.random.set_seed(42)
np.random.seed(42) | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Load and prepare dataset | (x_train, y_train), (x_test, y_test) = tf.keras.datasets.fashion_mnist.load_data()
x_train = np.expand_dims(x_train, -1)
x_test = np.expand_dims(x_test, -1) | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Define hyperparameters | BATCH_SIZE = 64
EPOCHS = 10
INIT_LR = 1e-4
MAX_LR = 1e-2 | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Define model building and model training utilities | def get_training_model():
model = tf.keras.Sequential(
[
layers.InputLayer((28, 28, 1)),
layers.experimental.preprocessing.Rescaling(scale=1./255),
layers.Conv2D(16, (5, 5), activation="relu"),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Conv2D(3... | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
In the interest of reproducibility, the initial model weights are serialized which you will be using to conduct our experiments. | initial_model = get_training_model()
initial_model.save("initial_model") | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Train a model without CLR | standard_model = tf.keras.models.load_model("initial_model")
no_clr_history = train_model(standard_model, optimizer="sgd") | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Define CLR schedule
The tfa.optimizers.CyclicalLearningRate module return a direct schedule that can be passed to an optimizer. The schedule takes a step as its input and outputs a value calculated using CLR formula as laid out in the paper. | steps_per_epoch = len(x_train) // BATCH_SIZE
clr = tfa.optimizers.CyclicalLearningRate(initial_learning_rate=INIT_LR,
maximal_learning_rate=MAX_LR,
scale_fn=lambda x: 1/(2.**(x-1)),
step_size=2 * steps_per_epoch
)
optimizer = tf.keras.optimizers.SGD(clr) | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Here, you specify the lower and upper bounds of the learning rate and the schedule will oscillate in between that range ([1e-4, 1e-2] in this case). scale_fn is used to define the function that would scale up and scale down the learning rate within a given cycle. step_size defines the duration of a single cycle. A step... | step = np.arange(0, EPOCHS * steps_per_epoch)
lr = clr(step)
plt.plot(step, lr)
plt.xlabel("Steps")
plt.ylabel("Learning Rate")
plt.show() | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
In order to better visualize the effect of CLR, you can plot the schedule with an increased number of steps. | step = np.arange(0, 100 * steps_per_epoch)
lr = clr(step)
plt.plot(step, lr)
plt.xlabel("Steps")
plt.ylabel("Learning Rate")
plt.show() | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
The function you are using in this tutorial is referred to as the triangular2 method in the CLR paper. There are other two functions there were explored namely triangular and exp (short for exponential).
Train a model with CLR | clr_model = tf.keras.models.load_model("initial_model")
clr_history = train_model(clr_model, optimizer=optimizer) | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
As expected the loss starts higher than the usual and then it stabilizes as the cycles progress. You can confirm this visually with the plots below.
Visualize losses | (fig, ax) = plt.subplots(2, 1, figsize=(10, 8))
ax[0].plot(no_clr_history.history["loss"], label="train_loss")
ax[0].plot(no_clr_history.history["val_loss"], label="val_loss")
ax[0].set_title("No CLR")
ax[0].set_xlabel("Epochs")
ax[0].set_ylabel("Loss")
ax[0].set_ylim([0, 2.5])
ax[0].legend()
ax[1].plot(clr_history.h... | site/en-snapshot/addons/tutorials/optimizers_cyclicallearningrate.ipynb | tensorflow/docs-l10n | apache-2.0 |
Non-parametric 1 sample cluster statistic on single trial power
This script shows how to estimate significant clusters
in time-frequency power estimates. It uses a non-parametric
statistical procedure based on permutations and cluster
level statistics.
The procedure consists of:
extracting epochs
compute single trial ... | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD-3-Clause
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
import mne
from mne.time_frequency import tfr_morlet
from mne.stats import permutation_cluster_1samp_te... | dev/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | mne-tools/mne-tools.github.io | bsd-3-clause |
Set parameters | data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
raw_fname = meg_path / 'sample_audvis_raw.fif'
tmin, tmax, event_id = -0.3, 0.6, 1
# Setup for reading the raw data
raw = mne.io.read_raw_fif(raw_fname)
events = mne.find_events(raw, stim_channel='STI 014')
include = []
raw.info['bads'] += ['MEG 2... | dev/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | mne-tools/mne-tools.github.io | bsd-3-clause |
Define adjacency for statistics
To perform a cluster-based permutation test, we need a suitable definition
for the adjacency of sensors, time points, and frequency bins.
The adjacency matrix will be used to form clusters.
We first compute the sensor adjacency, and then combine that with a
"lattice" adjacency for the ti... | # find_ch_adjacency first attempts to find an existing "neighbor"
# (adjacency) file for given sensor layout.
# If such a file doesn't exist, an adjacency matrix is computed on the fly,
# using Delaunay triangulations.
sensor_adjacency, ch_names = mne.channels.find_ch_adjacency(
tfr_epochs.info, 'grad')
# In this ... | dev/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | mne-tools/mne-tools.github.io | bsd-3-clause |
Compute statistic
For forming clusters, we need to specify a critical test statistic threshold.
Only data bins exceeding this threshold will be used to form clusters.
Here, we
use a t-test and can make use of Scipy's percent point function of the t
distribution to get a t-value that corresponds to a specific alpha leve... | # We want a two-tailed test
tail = 0
# In this example, we wish to set the threshold for including data bins in
# the cluster forming process to the t-value corresponding to p=0.001 for the
# given data.
#
# Because we conduct a two-tailed test, we divide the p-value by 2 (which means
# we're making use of both tails ... | dev/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | mne-tools/mne-tools.github.io | bsd-3-clause |
View time-frequency plots
We now visualize the observed clusters that are statistically significant
under our permutation distribution.
<div class="alert alert-danger"><h4>Warning</h4><p>Talking about "significant clusters" can be convenient, but
you must be aware of all associated caveats! For example, it... | evoked_data = evoked.data
times = 1e3 * evoked.times
plt.figure()
plt.subplots_adjust(0.12, 0.08, 0.96, 0.94, 0.2, 0.43)
T_obs_plot = np.nan * np.ones_like(T_obs)
for c, p_val in zip(clusters, cluster_p_values):
if p_val <= 0.05:
T_obs_plot[c] = T_obs[c]
# Just plot one channel's data
# use the following... | dev/_downloads/5b9edf9c05aec2b9bb1f128f174ca0f3/40_cluster_1samp_time_freq.ipynb | mne-tools/mne-tools.github.io | bsd-3-clause |
上面显示的结果类似一个电子表格,这个结构称为Pandas的数据帧(data frame)。
pandas的两个主要数据结构:Series和DataFrame:
- Series类似于一维数组,它有一组数据以及一组与之相关的数据标签(即索引)组成。
- DataFrame是一个表格型的数据结构,它含有一组有序的列,每列可以是不同的值类型。DataFrame既有行索引也有列索引,它可以被看做由Series组成的字典。 | # display the last 5 rows
data.tail()
# check the shape of the DataFrame(rows, colums)
data.shape | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
特征:
- TV:对于一个给定市场中单一产品,用于电视上的广告费用(以千为单位)
- Radio:在广播媒体上投资的广告费用
- Newspaper:用于报纸媒体的广告费用
响应:
- Sales:对应产品的销量
在这个案例中,我们通过不同的广告投入,预测产品销量。因为响应变量是一个连续的值,所以这个问题是一个回归问题。数据集一共有200个观测值,每一组观测对应一个市场的情况。 | import seaborn as sns
%matplotlib inline
# visualize the relationship between the features and the response using scatterplots
sns.pairplot(data, x_vars=['TV','Radio','Newspaper'], y_vars='Sales', size=7, aspect=0.8) | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
seaborn的pairplot函数绘制X的每一维度和对应Y的散点图。通过设置size和aspect参数来调节显示的大小和比例。可以从图中看出,TV特征和销量是有比较强的线性关系的,而Radio和Sales线性关系弱一些,Newspaper和Sales线性关系更弱。通过加入一个参数kind='reg',seaborn可以添加一条最佳拟合直线和95%的置信带。 | sns.pairplot(data, x_vars=['TV','Radio','Newspaper'], y_vars='Sales', size=7, aspect=0.8, kind='reg') | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
2. 线性回归模型
优点:快速;没有调节参数;可轻易解释;可理解
缺点:相比其他复杂一些的模型,其预测准确率不是太高,因为它假设特征和响应之间存在确定的线性关系,这种假设对于非线性的关系,线性回归模型显然不能很好的对这种数据建模。
线性模型表达式:
$y = \beta_0 + \beta_1x_1 + \beta_2x_2 + ... + \beta_nx_n$
其中
- y是响应
- $\beta_0是截距$
- $\beta_1是x1的系数,以此类推$
在这个案例中:
$y = \beta_0 + \beta_1TV + \beta_2Radio + ... + \beta_n*Newspaper$
(1)使用pandas来构... | # create a python list of feature names
feature_cols = ['TV', 'Radio', 'Newspaper']
# use the list to select a subset of the original DataFrame
X = data[feature_cols]
# equivalent command to do this in one line
X = data[['TV', 'Radio', 'Newspaper']]
# print the first 5 rows
X.head()
# check the type and shape of X
... | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
(2)构造训练集和测试集 | from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=1)
# default split is 75% for training and 25% for testing
print X_train.shape
print y_train.shape
print X_test.shape
print y_test.shape | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
(3)Scikit-learn的线性回归 | from sklearn.linear_model import LinearRegression
linreg = LinearRegression()
linreg.fit(X_train, y_train)
print linreg.intercept_
print linreg.coef_
# pair the feature names with the coefficients
zip(feature_cols, linreg.coef_) | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
$y = 2.88 + 0.0466 * TV + 0.179 * Radio + 0.00345 * Newspaper$
如何解释各个特征对应的系数的意义?
- 对于给定了Radio和Newspaper的广告投入,如果在TV广告上每多投入1个单位,对应销量将增加0.0466个单位
- 更明确一点,加入其它两个媒体投入固定,在TV广告上没增加1000美元(因为单位是1000美元),销量将增加46.6(因为单位是1000)
(4)预测 | y_pred = linreg.predict(X_test) | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
3. 回归问题的评价测度
对于分类问题,评价测度是准确率,但这种方法不适用于回归问题。我们使用针对连续数值的评价测度(evaluation metrics)。
下面介绍三种常用的针对回归问题的评价测度 | # define true and predicted response values
true = [100, 50, 30, 20]
pred = [90, 50, 50, 30] | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
(1)平均绝对误差(Mean Absolute Error, MAE)
$\frac{1}{n}\sum_{i=1}^{n}|y_i - \hat{y_i}|$
(2)均方误差(Mean Squared Error, MSE)
$\frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y_i})^2$
(3)均方根误差(Root Mean Squared Error, RMSE)
$\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y_i})^2}$ | from sklearn import metrics
import numpy as np
# calculate MAE by hand
print "MAE by hand:",(10 + 0 + 20 + 10)/4.
# calculate MAE using scikit-learn
print "MAE:",metrics.mean_absolute_error(true, pred)
# calculate MSE by hand
print "MSE by hand:",(10**2 + 0**2 + 20**2 + 10**2)/4.
# calculate MSE using scikit-learn
p... | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
计算Sales预测的RMSE | print np.sqrt(metrics.mean_squared_error(y_test, y_pred)) | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
4. 特征选择
在之前展示的数据中,我们看到Newspaper和销量之间的线性关系比较弱,现在我们移除这个特征,看看线性回归预测的结果的RMSE如何? | feature_cols = ['TV', 'Radio']
X = data[feature_cols]
y = data.Sales
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=1)
linreg.fit(X_train, y_train)
y_pred = linreg.predict(X_test)
print np.sqrt(metrics.mean_squared_error(y_test, y_pred)) | Scikit-learn/.ipynb_checkpoints/(3)linear_regression-checkpoint.ipynb | jasonding1354/pyDataScienceToolkits_Base | mit |
Now, if we have two classes of data, we might be able to classify the
data well with just the projection onto just one eigenvector. Could
be either eigenvector.
First, with second class having mean [-5,3] and
$\Sigma=\begin{bmatrix} 0.9 & 0.8\ -0.8 & 0.9 \end{bmatrix}$. | N = 200
data1 = mvNormalRand(N,[0,4],[[0.9,0.8],[0.8,0.9]])
data2 = mvNormalRand(N,[-5,3],[[0.9,0.8],[-0.8,0.9]])
data = np.vstack((data1,data2))
means = np.mean(data,axis=0)
U,S,V = np.linalg.svd(data-means)
V = V.T
plotOriginalAndTransformed(data,V) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
And again, with first class
$\Sigma=\begin{bmatrix} 0.9 & 0.2\ 0.2 & 20 \end{bmatrix}$
and second class having
$\Sigma=\begin{bmatrix} 0.9 & 0.2\ -0.2 & 20 \end{bmatrix}$. | N = 200
data1 = mvNormalRand(N,[0,4],[[0.9,0.2],[0.2,0.9]])
data2 = mvNormalRand(N,[-5,3],[[0.9,0.2],[-0.2,20]])
data = np.vstack((data1,data2))
means = np.mean(data,axis=0)
U,S,V = np.linalg.svd(data - means)
V = V.T
plotOriginalAndTransformed(data,V) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
Sammon Mapping
Introductions to Sammon Mapping are found at
* Sammon Mapping in Wikipedia
* Sammon Mapping, by Paul Henderson
A Sammon Mapping is one that maps each data sample $d_i$ to a location in two dimensions, $p_i$, such that distances between pairs of points are preserved. The objective defined by Sammon is... | X = np.array([ [0,1], [4,5], [10,20]])
X
N = X.shape[0] # number of rows
[(i,j) for i in range(N-1) for j in range(i+1,N)]
[X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)]
np.array([X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)]) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
To convert these differences to distances, just | diffs = np.array([X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)])
np.sqrt(np.sum(diffs*diffs, axis=1)) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
And to calculate the projection, a call to np.dot is all that is needed. Let's make a function to do the projection, and one to convert differences to distances. | def diffToDist(dX):
return np.sqrt(np.sum(dX*dX, axis=1))
def proj(X,theta):
return np.dot(X,theta)
diffToDist(diffs)
proj(X,np.array([[1,0.2],[0.3,0.8]])) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
Now, to follow the negative gradient of the objective function, we need its gradient, with respect to $\theta$. With a little work, you can derive it to find
$$
\begin{align}
\nabla_\theta &= \frac{1}{2} \sum_{i=1}^{N-1} \sum_{j=i+1}^N \left (\frac{||d_i - d_j||}{s} - ||p_i - p_j|| \right )^2 \
&= 2 \frac{1}{2} \su... | def objective(X,proj,theta,s):
N = X.shape[0]
P = proj(X,theta)
dX = np.array([X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)])
dP = np.array([P[i,:] - P[j,:] for i in range(N-1) for j in range(i+1,N)])
return 1/N * np.sum( (diffToDist(dX)/s - diffToDist(dP))**2) | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
Now for the gradient
$$
\begin{align}
\nabla_\theta &= - \sum_{i=1}^{N-1} \sum_{j=i+1}^N \left (\frac{||d_i - d_j||}{s} - ||f(d_i;\theta) - f(d_j;\theta)|| \right ) \frac{(d_i-d_j)^T (p_i - p_j)}{||p_i - p_j||}
\end{align}
$$ | def gradient(X,proj,theta,s):
N = X.shape[0]
P = proj(X,theta)
dX = np.array([X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)])
dP = np.array([P[i,:] - P[j,:] for i in range(N-1) for j in range(i+1,N)])
distX = diffToDist(dX)
distP = diffToDist(dP)
return -1/N * np.dot((((distX/s -... | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
This last line has the potential for dividing by zero! Let's avoid this, in a very ad-hoc manner, by replacing zeros in distP by its smallest nonzero value | def gradient(X,proj,theta,s):
N = X.shape[0]
P = proj(X,theta)
dX = np.array([X[i,:] - X[j,:] for i in range(N-1) for j in range(i+1,N)])
dP = np.array([P[i,:] - P[j,:] for i in range(N-1) for j in range(i+1,N)])
distX = diffToDist(dX)
distP = diffToDist(dP)
minimumNonzero = np.min(distP[dis... | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
Let's watch the mapping develop. One way to do this is to save the values of $\theta$ after each iteration, then use interact to step through the interations. | from IPython.html.widgets import interact
n = 10
X = np.random.multivariate_normal([2,3], 0.5*np.eye(2), n)
X = np.vstack((X,
np.random.multivariate_normal([1,-1], 0.2*np.eye(2), n)))
X = X - np.mean(X,axis=0)
s = 0.5 * np.sqrt(np.max(np.var(X,axis=0)))
print('s',s)
u,svalues,v = np.linalg.svd(X)
V = v... | cs480/23 Linear Dimensionality Reduction.ipynb | atlury/deep-opencl | lgpl-3.0 |
Document Table of Contents
1. Key Properties
2. Key Properties --> Time Stepping Framework --> Passive Tracers Transport
3. Key Properties --> Time Stepping Framework --> Biology Sources Sinks
4. Key Properties --> Transport Scheme
5. Key Properties --> Boundary Forcing
6. Key Properties --> Gas Ex... | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.model_overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.2. Model Name
Is Required: TRUE Type: STRING Cardinality: 1.1
Name of ocean biogeochemistry model code (PISCES 2.0,...) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.model_name')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.3. Model Type
Is Required: TRUE Type: ENUM Cardinality: 1.1
Type of ocean biogeochemistry model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.model_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Geochemical"
# "NPZD"
# "PFT"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.4. Elemental Stoichiometry
Is Required: TRUE Type: ENUM Cardinality: 1.1
Describe elemental stoichiometry (fixed, variable, mix of the two) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.elemental_stoichiometry')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Fixed"
# "Variable"
# "Mix of both"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.5. Elemental Stoichiometry Details
Is Required: TRUE Type: STRING Cardinality: 1.1
Describe which elements have fixed/variable stoichiometry | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.elemental_stoichiometry_details')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.6. Prognostic Variables
Is Required: TRUE Type: STRING Cardinality: 1.N
List of all prognostic tracer variables in the ocean biogeochemistry component | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.prognostic_variables')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.7. Diagnostic Variables
Is Required: TRUE Type: STRING Cardinality: 1.N
List of all diagnotic tracer variables in the ocean biogeochemistry component | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.diagnostic_variables')
# PROPERTY VALUE(S):
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
1.8. Damping
Is Required: FALSE Type: STRING Cardinality: 0.1
Describe any tracer damping used (such as artificial correction or relaxation to climatology,...) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.damping')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
2. Key Properties --> Time Stepping Framework --> Passive Tracers Transport
Time stepping method for passive tracers transport in ocean biogeochemistry
2.1. Method
Is Required: TRUE Type: ENUM Cardinality: 1.1
Time stepping framework for passive tracers | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.time_stepping_framework.passive_tracers_transport.method')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "use ocean model transport time step"
# "use specific time step"
# TODO - please enter ... | notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
2.2. Timestep If Not From Ocean
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Time step for passive tracers (if different from ocean) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.time_stepping_framework.passive_tracers_transport.timestep_if_not_from_ocean')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3. Key Properties --> Time Stepping Framework --> Biology Sources Sinks
Time stepping framework for biology sources and sinks in ocean biogeochemistry
3.1. Method
Is Required: TRUE Type: ENUM Cardinality: 1.1
Time stepping framework for biology sources and sinks | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.time_stepping_framework.biology_sources_sinks.method')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "use ocean model transport time step"
# "use specific time step"
# TODO - please enter valu... | notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
3.2. Timestep If Not From Ocean
Is Required: FALSE Type: INTEGER Cardinality: 0.1
Time step for biology sources and sinks (if different from ocean) | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.time_stepping_framework.biology_sources_sinks.timestep_if_not_from_ocean')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4. Key Properties --> Transport Scheme
Transport scheme in ocean biogeochemistry
4.1. Type
Is Required: TRUE Type: ENUM Cardinality: 1.1
Type of transport scheme | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.transport_scheme.type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Offline"
# "Online"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.2. Scheme
Is Required: TRUE Type: ENUM Cardinality: 1.1
Transport scheme used | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.transport_scheme.scheme')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Use that of ocean model"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
4.3. Use Different Scheme
Is Required: FALSE Type: STRING Cardinality: 0.1
Decribe transport scheme if different than that of ocean model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.transport_scheme.use_different_scheme')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5. Key Properties --> Boundary Forcing
Properties of biogeochemistry boundary forcing
5.1. Atmospheric Deposition
Is Required: TRUE Type: ENUM Cardinality: 1.1
Describe how atmospheric deposition is modeled | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.boundary_forcing.atmospheric_deposition')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "from file (climatology)"
# "from file (interannual variations)"
# "from Atmospheric Chemistry mode... | notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.2. River Input
Is Required: TRUE Type: ENUM Cardinality: 1.1
Describe how river input is modeled | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.boundary_forcing.river_input')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "from file (climatology)"
# "from file (interannual variations)"
# "from Land Surface model"
# TODO - please... | notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.3. Sediments From Boundary Conditions
Is Required: FALSE Type: STRING Cardinality: 0.1
List which sediments are speficied from boundary condition | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.boundary_forcing.sediments_from_boundary_conditions')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
5.4. Sediments From Explicit Model
Is Required: FALSE Type: STRING Cardinality: 0.1
List which sediments are speficied from explicit sediment model | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.boundary_forcing.sediments_from_explicit_model')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6. Key Properties --> Gas Exchange
*Properties of gas exchange in ocean biogeochemistry *
6.1. CO2 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is CO2 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CO2_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.2. CO2 Exchange Type
Is Required: FALSE Type: ENUM Cardinality: 0.1
Describe CO2 gas exchange | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CO2_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "OMIP protocol"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.3. O2 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is O2 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.O2_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.4. O2 Exchange Type
Is Required: FALSE Type: ENUM Cardinality: 0.1
Describe O2 gas exchange | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.O2_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "OMIP protocol"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.5. DMS Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is DMS gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.DMS_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.6. DMS Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify DMS gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.DMS_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.7. N2 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is N2 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.N2_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.8. N2 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify N2 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.N2_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.9. N2O Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is N2O gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.N2O_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.10. N2O Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify N2O gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.N2O_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.11. CFC11 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is CFC11 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CFC11_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.12. CFC11 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify CFC11 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CFC11_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.13. CFC12 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is CFC12 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CFC12_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.14. CFC12 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify CFC12 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.CFC12_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.15. SF6 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is SF6 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.SF6_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.16. SF6 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify SF6 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.SF6_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.17. 13CO2 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is 13CO2 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.13CO2_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.18. 13CO2 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify 13CO2 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.13CO2_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.19. 14CO2 Exchange Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is 14CO2 gas exchange modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.14CO2_exchange_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.20. 14CO2 Exchange Type
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify 14CO2 gas exchange scheme type | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.14CO2_exchange_type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
6.21. Other Gases
Is Required: FALSE Type: STRING Cardinality: 0.1
Specify any other gas exchange | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.gas_exchange.other_gases')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7. Key Properties --> Carbon Chemistry
Properties of carbon chemistry biogeochemistry
7.1. Type
Is Required: TRUE Type: ENUM Cardinality: 1.1
Describe how carbon chemistry is modeled | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.carbon_chemistry.type')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "OMIP protocol"
# "Other protocol"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.2. PH Scale
Is Required: FALSE Type: ENUM Cardinality: 0.1
If NOT OMIP protocol, describe pH scale. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.carbon_chemistry.pH_scale')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# Valid Choices:
# "Sea water"
# "Free"
# "Other: [Please specify]"
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
7.3. Constants If Not OMIP
Is Required: FALSE Type: STRING Cardinality: 0.1
If NOT OMIP protocol, list carbon chemistry constants. | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.key_properties.carbon_chemistry.constants_if_not_OMIP')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
8. Tracers
Ocean biogeochemistry tracers
8.1. Overview
Is Required: TRUE Type: STRING Cardinality: 1.1
Overview of tracers in ocean biogeochemistry | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.tracers.overview')
# PROPERTY VALUE:
# Set as follows: DOC.set_value("value")
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
8.2. Sulfur Cycle Present
Is Required: TRUE Type: BOOLEAN Cardinality: 1.1
Is sulfur cycle modeled ? | # PROPERTY ID - DO NOT EDIT !
DOC.set_id('cmip6.ocnbgchem.tracers.sulfur_cycle_present')
# PROPERTY VALUE:
# Set as follows: DOC.set_value(value)
# Valid Choices:
# True
# False
# TODO - please enter value(s)
| notebooks/uhh/cmip6/models/sandbox-2/ocnbgchem.ipynb | ES-DOC/esdoc-jupyterhub | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.