Breast Cancer Machine Learning Prediction
October 29, 2017
scikit-learn machine learning feature selection PCA cross-validationIn this study, advanced machine learning methods will be utilized to build and test the performance of a selected algorithm for breast cancer diagnosis.
Dataset Description
The Breast Cancer Wisconsin (Diagnostic) DataSet, obtained from Kaggle, contains features computed from a digitized image of a fine needle aspirate (FNA) of a breast mass and describe characteristics of the cell nuclei present in the image.
Number of instances: 569
Number of attributes: 32 (ID, diagnosis, 30 real-valued input features)
Attribute information
- ID number
- Diagnosis (M = malignant, B = benign)
- Ten real-valued features are computed for each cell nucleus:
- radius (mean of distances from center to points on the perimeter)
- texture (standard deviation of gray-scale values)
- perimeter
- area
- smoothness (local variation in radius lengths)
- compactness (perimeter^2 / area - 1.0)
- concavity (severity of concave portions of the contour)
- concave points (number of concave portions of the contour)
- symmetry
- fractal dimension (“coastline approximation” - 1)
The mean, standard error, and “worst” or largest (mean of the three largest values) of these features were computed for each image, resulting in 30 features. For instance, field 3 is Mean Radius, field 13 is Radius SE, field 23 is Worst Radius.
Data Loading and Cleaning
Show/Hide code
import pandas as pd
from IPython.display import HTML
df = pd.read_csv("breast_cancer.csv")
HTML(df.to_html())
print(df.shape)
print(df.dtypes)
df.head(n=3)
(569, 33)
id int64
diagnosis object
radius_mean float64
texture_mean float64
perimeter_mean float64
area_mean float64
smoothness_mean float64
compactness_mean float64
concavity_mean float64
concave points_mean float64
symmetry_mean float64
fractal_dimension_mean float64
radius_se float64
texture_se float64
perimeter_se float64
area_se float64
smoothness_se float64
compactness_se float64
concavity_se float64
concave points_se float64
symmetry_se float64
fractal_dimension_se float64
radius_worst float64
texture_worst float64
perimeter_worst float64
area_worst float64
smoothness_worst float64
compactness_worst float64
concavity_worst float64
concave points_worst float64
symmetry_worst float64
fractal_dimension_worst float64
Unnamed: 32 float64
dtype: object
3 rows × 33 columnsShow/Hide Table
id
diagnosis
radius_mean
texture_mean
perimeter_mean
area_mean
smoothness_mean
compactness_mean
concavity_mean
concave points_mean
…
texture_worst
perimeter_worst
area_worst
smoothness_worst
compactness_worst
concavity_worst
concave points_worst
symmetry_worst
fractal_dimension_worst
Unnamed: 32
0
842302
M
17.99
10.38
122.8
1001.0
0.11840
0.27760
0.3001
0.14710
…
17.33
184.6
2019.0
0.1622
0.6656
0.7119
0.2654
0.4601
0.11890
NaN
1
842517
M
20.57
17.77
132.9
1326.0
0.08474
0.07864
0.0869
0.07017
…
23.41
158.8
1956.0
0.1238
0.1866
0.2416
0.1860
0.2750
0.08902
NaN
2
84300903
M
19.69
21.25
130.0
1203.0
0.10960
0.15990
0.1974
0.12790
…
25.53
152.5
1709.0
0.1444
0.4245
0.4504
0.2430
0.3613
0.08758
NaN
The id
and Unnamed: 32
columns should be removed, since they are unnecessary. The dataset will be also examined for missing values, duplicated entries and unique values of ‘diagnosis’ column.
Show/Hide code
# Remove unnecessary columns
df.drop(['id', 'Unnamed: 32'], axis=1, inplace=True)
# Find missing values
print('Missing values:\n{}'.format(df.isnull().sum()))
# Find duplicated records
print('\nNumber of duplicated records: {}'.format(df.duplicated().sum()))
# Find the unique values of 'diagnosis'.
print('\nUnique values of "diagnosis": {}'.format(df['diagnosis'].unique()))
Missing values:
diagnosis 0
radius_mean 0
texture_mean 0
perimeter_mean 0
area_mean 0
smoothness_mean 0
compactness_mean 0
concavity_mean 0
concave points_mean 0
symmetry_mean 0
fractal_dimension_mean 0
radius_se 0
texture_se 0
perimeter_se 0
area_se 0
smoothness_se 0
compactness_se 0
concavity_se 0
concave points_se 0
symmetry_se 0
fractal_dimension_se 0
radius_worst 0
texture_worst 0
perimeter_worst 0
area_worst 0
smoothness_worst 0
compactness_worst 0
concavity_worst 0
concave points_worst 0
symmetry_worst 0
fractal_dimension_worst 0
dtype: int64
Number of duplicated records: 0
Unique values of "diagnosis": ['M' 'B']
There are no missing values or duplicated records. Next the diagnosis
distribution is checked.
Show/Hide code
total = df['diagnosis'].count()
malignant = df[df['diagnosis'] == "M"]['diagnosis'].count()
print("Malignant: ", malignant)
print("Benign: ", total - malignant)
Malignant: 212
Benign: 357
Data Exploration
Show/Hide code
# Generate statistics
df.describe()
8 rows × 30 columnsShow/Hide Table
radius_mean
texture_mean
perimeter_mean
area_mean
smoothness_mean
compactness_mean
concavity_mean
concave points_mean
symmetry_mean
fractal_dimension_mean
…
radius_worst
texture_worst
perimeter_worst
area_worst
smoothness_worst
compactness_worst
concavity_worst
concave points_worst
symmetry_worst
fractal_dimension_worst
count
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
…
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
569.000000
mean
14.127292
19.289649
91.969033
654.889104
0.096360
0.104341
0.088799
0.048919
0.181162
0.062798
…
16.269190
25.677223
107.261213
880.583128
0.132369
0.254265
0.272188
0.114606
0.290076
0.083946
std
3.524049
4.301036
24.298981
351.914129
0.014064
0.052813
0.079720
0.038803
0.027414
0.007060
…
4.833242
6.146258
33.602542
569.356993
0.022832
0.157336
0.208624
0.065732
0.061867
0.018061
min
6.981000
9.710000
43.790000
143.500000
0.052630
0.019380
0.000000
0.000000
0.106000
0.049960
…
7.930000
12.020000
50.410000
185.200000
0.071170
0.027290
0.000000
0.000000
0.156500
0.055040
25%
11.700000
16.170000
75.170000
420.300000
0.086370
0.064920
0.029560
0.020310
0.161900
0.057700
…
13.010000
21.080000
84.110000
515.300000
0.116600
0.147200
0.114500
0.064930
0.250400
0.071460
50%
13.370000
18.840000
86.240000
551.100000
0.095870
0.092630
0.061540
0.033500
0.179200
0.061540
…
14.970000
25.410000
97.660000
686.500000
0.131300
0.211900
0.226700
0.099930
0.282200
0.080040
75%
15.780000
21.800000
104.100000
782.700000
0.105300
0.130400
0.130700
0.074000
0.195700
0.066120
…
18.790000
29.720000
125.400000
1084.000000
0.146000
0.339100
0.382900
0.161400
0.317900
0.092080
max
28.110000
39.280000
188.500000
2501.000000
0.163400
0.345400
0.426800
0.201200
0.304000
0.097440
…
36.040000
49.540000
251.200000
4254.000000
0.222600
1.058000
1.252000
0.291000
0.663800
0.207500
Plot pairwise relationships to check the correlations between the mean features.
Show/Hide code
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
g = sns.PairGrid(df.iloc[:, 0:11], hue="diagnosis", palette="Set2")
g = g.map_diag(plt.hist, edgecolor="w")
g = g.map_offdiag(plt.scatter, edgecolor="w", s=40)
plt.show()
It seems that:
There are strong correlations between many variables. Next, a heatmap will be used to present the numerical correlations.
The univariate distributions on the diagonal show a separation of malignant and benign cells for several mean features. Malignant cells tend to have larger mean values of:
- radius
- perimeter
- area
- compactness
- concavity
- concave points
Show/Hide code
df_corr = df.iloc[:, 1:11].corr()
plt.figure(figsize=(8,8))
sns.heatmap(df_corr, cmap="Blues", annot=True)
plt.show()
As it was expected there are very strong correlations between radius, perimeter and area.
Compactness, concavity and and concave points are also highly correlated.
These highly correlated features result in redundant information. It is suggested to remove highly correlated features to avoid a predictive bias for the information contained in these features.
Encode “diagnosis” to numerical values
df['diagnosis'] = df['diagnosis'].map({'M':1,'B':0})
Machine Learning
Split Data to Train/Test Sets
Create train/test sets using the train_test_split
function. The test_size=0.3
inside the function indicates the percentage of the data that should be held over for testing.
Show/Hide code
from sklearn.model_selection import train_test_split
array = df.values
# Define the independent variables as features.
features = array[:,1:]
# Define the target (dependent) variable as labels.
labels = array[:,0]
# Create a train/test split using 30% test size.
features_train, features_test, labels_train, labels_test = train_test_split(features,
labels,
test_size=0.3,
random_state=42)
# Check the split printing the shape of each set.
print(features_train.shape, labels_train.shape)
print(features_test.shape, labels_test.shape)
(398, 30) (398,)
(171, 30) (171,)
K Nearest Neighbors (K-NN) Classifier
K-NN was chosen amongst other algorithms (e.g. Support Vector Machines, Decision Trees and Naive Bayes), because it is quite fast and produces acceptable results. The speed of K-NN can be explained by the fact that this algorithm is a lazy learner and does not do much during training process unlike other classifiers that build the models. The performance of K-NN will be examined tuning the algorithm and applying various preprocessing steps.
Evaluation of the algorithm
Accuracy, i.e. the fraction of correct predictions is typically not enough information to evaluate a model. Although it is a starting point, it can lead to invalid decisions. Models with high accuracy may have inadequate precision or recall scores. For this reason the evaluation metrics that were also assessed are:
Precision or the ability of the classifier not to label as positive a sample that is negative. The best value is 1 and the worst value is 0. In our study case, precision is when the algorithm guesses that a cell is malignant and actually measures how certain we are that this cell is a true malignant. For example, a precision of 0.9 means that if the model predicts 100 malignant cells, the 90 of them are malignant and the rest 10 are benign (false).
Recall or the ability of the classifier to find all the positive samples. The best value is 1 and the worst value is 0. In context to the study, recall shows how well our identifier can find the malignant cells. For example, a low recall score of 0.8 indicates that our identifier finds only 80% of all the real malignant cells in the prediction. The rest 20% of real malignant cells will not be found by the diagnosis based on this algorithm, something that is unacceptable.
F1 score, a weighted average of the precision and recall, where an F1 score reaches its best value at 1 and worst score at 0. The relative contribution of precision and recall to the F1 score are equal. The formula for the F1 score is: F1 = 2 x (precision x recall) / (precision + recall).
Show/Hide code
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from time import time
def print_ml_results():
t0 = time()
# Create classifier.
clf = KNeighborsClassifier()
# Fit the classifier on the training features and labels.
t0 = time()
clf.fit(features_train, labels_train)
print("Training time:", round(time()-t0, 3), "s")
# Make predictions.
t1 = time()
predictions = clf.predict(features_test)
print("Prediction time:", round(time()-t1, 3), "s")
# Evaluate the model.
accuracy = clf.score(features_test, labels_test)
report = classification_report(labels_test, predictions)
# Print the reports.
print("\nReport:\n")
print("Accuracy: {}".format(accuracy))
print("\n", report)
print(confusion_matrix(labels_test, predictions))
print_ml_results()
Training time: 0.002 s
Prediction time: 0.003 s
Report:
Accuracy: 0.9590643274853801
precision recall f1-score support
0.0 0.95 0.99 0.97 108
1.0 0.98 0.90 0.94 63
avg / total 0.96 0.96 0.96 171
[[107 1]
[ 6 57]]
- The algorithm will be tuned to achieve an improved performance, especially a better recall score for the malignant class, since 90% can be considered a low recall score in this case.
Remove Highly Correlated Features and Run Again
Investigate if removing manually features with a correlation higher than 0.8, can benefit the algorithm performance, although later this will be handled automatically by dimensionality reduction.
Show/Hide code
df_new = df[['diagnosis', 'radius_mean', 'texture_mean', 'smoothness_mean',
'compactness_mean', 'symmetry_mean', 'fractal_dimension_mean',
'radius_se', 'texture_se', 'smoothness_se',
'compactness_se', 'concave points_se', 'symmetry_se',
'fractal_dimension_se', 'concavity_worst', 'symmetry_worst',
'fractal_dimension_worst']]
array = df_new.values
# Define the independent variables as features.
features_new = array[:,1:]
# Define the target (dependent) variable as labels.
labels_new = array[:,0]
# Create a train/test split using 30% test size.
features_train, features_test, labels_train, labels_test = train_test_split(features_new, labels_new, \
test_size=0.3, random_state=42)
print_ml_results()
Training time: 0.001 s
Prediction time: 0.002 s
Report:
Accuracy: 0.9005847953216374
precision recall f1-score support
0.0 0.88 0.97 0.93 108
1.0 0.94 0.78 0.85 63
avg / total 0.90 0.90 0.90 171
[[105 3]
[ 14 49]]
There is a significant decrease in algorithm’s accuracy and recall mostly for the malignant class. It’s difficult to select manually the best features especially for datasets with many features correlated. Sometimes, ambiguity can occur when three or more variables are correlated. For example, if feature 1 is correlated with feature 2, while feature 2 is correlated with feature 3 but not feature 1, which one is better to remove? To resolve this automatically, dimensionality reduction methods are used such as Principal Component Analysis.
Cross Validation
Train/test split has a lurking danger if the split isn’t random and when one subset of our data has only observations from one class, i.e. our data are imbalanced. This will result in overfitting. To avoid this, cross validation is applied. There are several cross validation methods such as K-Fold and Stratified K-Fold.
In K-Fold cross-validation, the original sample is randomly partitioned into k equal sized subsamples. Of the k subsamples, a single subsample is retained as the validation data for testing the model, and the remaining k-1 subsamples are used as training data. The cross-validation process is then repeated k times (the folds), with each of the k subsamples used exactly once as the validation data. The k results from the folds can then be averaged to produce a single estimation. The advantage of this method over repeated random sub-sampling is the increased accuracy because all observations are used for both training and validation, and each observation is used for validation exactly once.
If the original data comes in some sort of sorted shape, a shuffle of the order of the data points is necessary before splitting them up into folds. This can be done in KFold()
, setting the shuffle
parameter to True
. If there are concerns about class imbalance, then the StratifiedKFold()
class should be used instead. Where KFold()
assigns points to folds without attention to output class, StratifiedKFold()
assigns data points to folds so that each fold has approximately the same number of data points of each output class. This is most useful for when we have imbalanced numbers of data points in the outcome classes (e.g. one is rare compared to the others). For this class as well, it can be used shuffle=True
to shuffle the data points’ order before splitting into folds.
Scale Features
A common good practice in machine learning is feature scaling, normalization, standardization or binarization of the predictor variables. The main purposes of these methods are two:
Create comparable features in terms of units, e.g. if there are values in different units, then, the scaled data will be the same.
Create comparable features in terms of size, e.g. if two variables have vastly different ranges, the one with the larger range may dominate the predictive model, even though it may be less important to the target variable than the variable with the smaller range.
Feature scaling was applied here, since it is useful for algorithms that weigh inputs like regression and neural networks, as well as algorithms that use distance measures like K-NN.
Show/Hide code
from sklearn.preprocessing import MinMaxScaler
import numpy as np
np.set_printoptions(precision=2, suppress=True)
scaler = MinMaxScaler(feature_range=(0,1))
features_scaled = scaler.fit_transform(features)
print("Unscaled data\n", features_train)
print("\nScaled data\n", features_scaled)
Unscaled data
[[ 13.74 17.91 0.08 ..., 0.16 0.23 0.07]
[ 13.37 16.39 0.07 ..., 0.33 0.2 0.08]
[ 14.69 13.98 0.1 ..., 0.32 0.28 0.09]
...,
[ 14.29 16.82 0.06 ..., 0.04 0.25 0.06]
[ 13.98 19.62 0.11 ..., 0.41 0.32 0.11]
[ 12.18 20.52 0.08 ..., 0.11 0.27 0.07]]
Scaled data
[[ 0.52 0.02 0.55 ..., 0.91 0.6 0.42]
[ 0.64 0.27 0.62 ..., 0.64 0.23 0.22]
[ 0.6 0.39 0.6 ..., 0.84 0.4 0.21]
...,
[ 0.46 0.62 0.45 ..., 0.49 0.13 0.15]
[ 0.64 0.66 0.67 ..., 0.91 0.5 0.45]
[ 0.04 0.5 0.03 ..., 0. 0.26 0.1 ]]
Principal Component Analysis (PCA)
PCA is a preprocessing step, which decomposes a multivariate dataset in a set of successive orthogonal components that explain a maximum amount of the variance. It is used when we need to tackle datasets with a large number of features with different scales, some of which might be correlated. These correlations and the high dimension of the dataset bring a redudancy in the information. Applying PCA, the original features are transformed to linear combinations of new independent variables, which reduce the complexity of the dataset and thus, the computational cost.
Summarizing, the main purpose of principal component analysis is to:
identify hidden pattern in a data set,
reduce the dimensionnality of the data by removing the noise and redundancy in the data,
identify correlated variables
Show/Hide code
from sklearn.decomposition import PCA
pca = PCA(30)
projected = pca.fit_transform(features)
pca_inversed_data = pca.inverse_transform(np.eye(30))
plt.style.use('seaborn')
def plot_pca():
plt.figure(figsize=(10, 4))
plt.plot(pca_inversed_data.mean(axis=0), '--o', label = 'mean')
plt.plot(np.square(pca_inversed_data.std(axis=0)), '--o', label = 'variance')
plt.ylabel('Feature Contribution')
plt.xlabel('Feature Index')
plt.legend(loc='best')
plt.xticks(np.arange(0, 30, 1.0))
plt.show()
plt.figure(figsize = (10, 4))
plt.plot(np.cumsum(pca.explained_variance_ratio_), '--o')
plt.xlabel('Principal Component')
plt.ylabel('Cumulative Explained Variance')
plt.xticks(np.arange(0, 30, 1.0))
plt.show()
plot_pca()
Applying PCA on the unscaled dataset, it seems that more than 99% of the variance is explained by only one component, which is too good to be true. The feature contribution plot depicts that principal components 3 (area_mean
) and 23 (area_worst
) dominate the PCA. This is explained by the large variance of area_mean
and area_worst
(see std values of the Data Exploration section). To avoid this, feature scaling prior to PCA is highly recommended.
Show/Hide code
projected_scaled = pca.fit_transform(features_scaled)
pca_inversed_data = pca.inverse_transform(np.eye(30))
plot_pca()
After applying scaling before PCA, 5 principal components are required to explain more than 90% of the variance. This shows a better handle on the variation within the dataset.
Univariate Feature Selection
This preprocessing step is used to select the best features based on univariate statistical tests. Most common methods are:
SelectKBest()
, which removes all but the k highest scoring features, andSelectPercentile()
, which removes all but a user-specified highest scoring percentage of features.
Note: First the dataset must be splitted into train and test sets, since performing feature selection on the whole dataset would lead to prediction bias.
Show/Hide code
from sklearn.feature_selection import SelectKBest
select = SelectKBest()
select.fit(features_train, labels_train)
scores = select.scores_
# Show the scores in a table
feature_scores = zip(df.columns.values.tolist(), scores)
ordered_feature_scores = sorted(feature_scores, key=lambda x: x[1], reverse=True)
for feature, score in ordered_feature_scores:
print(feature, score)
diagnosis<PHONE_NUMBER>91
perimeter_se<PHONE_NUMBER>68
perimeter_mean<PHONE_NUMBER>73
compactness_mean<PHONE_NUMBER>37
area_se 91.7932292151
radius_mean 78.2141419938
fractal_dimension_mean 73.0964305619
texture_mean 57.9040462077
area_mean 55.6815629466
smoothness_se 36.5031400131
symmetry_mean 31.5442869773
texture_se 1.43610838765
concave points_mean 0.963553272104
radius_se 0.441799916915
smoothness_mean 0.407997081673
concavity_mean 0.181306268427
Tune the algorithm
Putting it all together with GridSearchCV and Pipeline
Algorithm tuning is a process in which we optimize the parameters that impact the model in order to enable the algorithm to perform with an improved performance. If we don’t tune the algorithms well, performance will be poor with low accuracy, precision or recall. Most of the machine learning algorithms contain a set of parameters (hyperparameters), which should be set up adequately to perform the best. While all of the algorithms attempt to set reasonable default hyperparameters, they can often fail to provide optimal results for many real world datasets in practice. To find an optimized combination of hyperparameters, a metric is chosen to measure the algorithm’s performance on an independent data set and hyperparameters that maximize this measure are adopted.
Tuning the models is a tedious, time-consuming process and there can sometimes be interactions between the choices we make in one step and the optimal value for a downstream step. Hopefully, there are two simple and easy tuning strategies, grid search and random search. Scikit-learn provides these two methods for algorithm parameter tuning. GridSearchCV()
allows us to construct a grid of all the combinations of parameters passing one classifier to pipeline each time, tries each combination, and then reports back the best combination. So, instead of trying numerous values for each tuning parameter, GridSearchCV()
will apply all the combinations of parameters - not just vary them independently - avoiding local optima.
The power of GridSearchCV()
is that it multiplies out all the combinations of parameters and tries each one, making a k-fold cross-validated model for each combination. Then, we can ask for predictions and parameters from our GridSearchCV()
object and it will automatically return to us the best set of predictions, as well as the best parameters.
Show/Hide code
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.model_selection import GridSearchCV
# Create the scaler.
scaler = MinMaxScaler(feature_range=(0,1))
# Scale down all the features (both train and test dataset).
features = scaler.fit_transform(features)
# Create a train/test split using 30% test size.
features_train, features_test, labels_train, labels_test = train_test_split(features,
labels,
test_size=0.3,
random_state=42)
# Create the classifier.
clf = KNeighborsClassifier()
# Create the pipeline.
pipeline = Pipeline([('reduce_dim', PCA()),
('clf', clf)])
# Create the parameters.
n_features_options = [1, 3, 5, 7]
n_neighbors = [2, 4, 6]
algorithm = ['auto', 'ball_tree', 'kd_tree', 'brute']
parameters = [
{
'reduce_dim': [PCA(iterated_power=7)],
'reduce_dim__n_components': n_features_options,
'clf__n_neighbors': n_neighbors,
'clf__algorithm': algorithm
},
{
'reduce_dim': [SelectKBest()],
'reduce_dim__k': n_features_options,
'clf__n_neighbors': n_neighbors,
'clf__algorithm': algorithm
}]
# Create a function to find the best estimator.
def get_best_estimator(n_splits):
t0 = time()
# Create Stratified ShuffleSplit cross-validator.
sss = StratifiedShuffleSplit(n_splits=n_splits, test_size=0.3, random_state=3)
# Create grid search.
grid = GridSearchCV(pipeline, param_grid=parameters, scoring=('f1'), cv=sss, refit='f1')
# Fit pipeline on features_train and labels_train.
grid.fit(features_train, labels_train)
# Make predictions.
predictions = grid.predict(features_test)
# Test predictions using sklearn.classification_report().
report = classification_report(labels_test, predictions)
# Find the best parameters and scores.
best_parameters = grid.best_params_
best_score = grid.best_score_
# Print the reports.
print("\nReport:\n")
print(report)
print("Best f1-score:")
print(best_score)
print("Best parameters:")
print(best_parameters)
print(confusion_matrix(labels_test, predictions))
print("Time passed: ", round(time() - t0, 3), "s")
return grid.best_estimator_
get_best_estimator(n_splits=20)
Report:
precision recall f1-score support
0.0 0.97 0.98 0.98 108
1.0 0.97 0.95 0.96 63
avg / total 0.97 0.97 0.97 171
Best f1-score:
0.943663253206
Best parameters:
{'clf__algorithm': 'auto', 'clf__n_neighbors': 6, 'reduce_dim': PCA(copy=True, iterated_power=7, n_components=5, random_state=None,
svd_solver='auto', tol=0.0, whiten=False), 'reduce_dim__n_components': 5}
[[106 2]
[ 3 60]]
Time passed: 13.792 s
Pipeline(memory=None,
steps=[('reduce_dim', PCA(copy=True, iterated_power=7, n_components=5, random_state=None,
svd_solver='auto', tol=0.0, whiten=False)), ('clf', KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',
metric_params=None, n_jobs=1, n_neighbors=6, p=2,
weights='uniform'))])
Combine PCA and Feature Selection with FeatureUnion
Often it is beneficial to combine several methods to obtain good performance. FeatureUnion()
will be used to combine features obtained by PCA and univariate selection, SelectKBest()
. Combining features using this transformer has the advantage that it allows cross validation and grid searches over the whole process. Datasets that benefit from this can often:
consist of heterogeneous data types (e.g. raster images and text captions),
are stored in a Pandas DataFrame and different columns require different processing pipelines.
Show/Hide code
# Build the estimator from PCA and univariate selection.
combined_features = FeatureUnion([('pca', PCA()), ('univ_select', SelectKBest())])
# Do grid search over k, n_components and K-NN parameters.
pipeline = Pipeline([('features', combined_features),
('clf', clf)])
# Create the parameters.
n_features_options = [1, 3, 5, 7]
n_neighbors = [2, 4, 6]
algorithm = ['auto', 'ball_tree', 'kd_tree', 'brute']
parameters = [
{
'features__pca': [PCA(iterated_power=7)],
'features__pca__n_components': n_features_options,
'features__univ_select__k': n_features_options,
'clf__n_neighbors': n_neighbors,
'clf__algorithm': algorithm
}]
get_best_estimator(20)
Report:
precision recall f1-score support
0.0 0.96 0.99 0.98 108
1.0 0.98 0.94 0.96 63
avg / total 0.97 0.97 0.97 171
Best f1-score:
0.949037467804
Best parameters:
{'clf__algorithm': 'auto', 'clf__n_neighbors': 6, 'features__pca': PCA(copy=True, iterated_power=7, n_components=5, random_state=None,
svd_solver='auto', tol=0.0, whiten=False), 'features__pca__n_components': 5, 'features__univ_select__k': 3}
[[107 1]
[ 4 59]]
Time passed: 39.809 s
Pipeline(memory=None,
steps=[('features', FeatureUnion(n_jobs=1,
transformer_list=[('pca', PCA(copy=True, iterated_power=7, n_components=5, random_state=None,
svd_solver='auto', tol=0.0, whiten=False)), ('univ_select', SelectKBest(k=3, score_func=<function f_classif at 0x1a26133b70>))],
transformer_weights=None)), ('clf', KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',
metric_params=None, n_jobs=1, n_neighbors=6, p=2,
weights='uniform'))])
Conclusions
In this study, K-NN algorithm was applied for the diagnosis of the Breast Cancer Wisconsin DataSet. It was found that precision and recall scores can be considerably improved applying the following steps:
Feature Scaling
Dimensionality Reduction
Cross Validation
Hyperparameter Optimization
For better results more data are required and other algorithms should be used.


Lightweight vanilla js modal component
This is just 2kb Lightweight vanilla js modal component with zero dependencies , with option esc close , outside click close , tab key focus inside Modal custom height , widht : check code in github : vanilla js modal github repo


Hello, I'm ka'ki. I'm 27 years old. I am a Digital Product Designer with software education and later training in design and 3 years of experience. I am currently working as photographer and also working on freelance jobs and side projects. In my spare time, I make videos and montages about League of Legends and other games .
“What we are doing to the forests of the world is but a mirror reflection of what we are doing to ourselves and to one another.” ― Chris Maser
“Sometimes tradition and habit are just that, comfortable excuses to leave things be, even when they are unjust and unworthy. Sometimes--not often, but sometimes--the cranks and radicals turn out to be right. Sometimes Everyone is wrong.”
In nature, nothing is perfect and everything is perfect. Trees can be contorted, bent in weird ways, and they’re still beautiful. –Alice Walker
See AllNorma
Digital Product Designer
Mar 21 — Now
Enrich Mobile
UI Designer
Apr 2020 — Mar 21
ASDC
UI Designer
Jun 2020 — Mar 20
Talent Mondo
Contract UI Designer
Mar 20 — Jun 20
MobileUpp
iOS Developer & UI Designer
Mar 21 — Now


Hello, this is my first attempt to make a game.
It was built using Javascript and a new HTML5 feature called <canvas>, and that's why it only works in modern browers like Firefox, Chrome or Internet Explorer 9
It is a very simple casual game. If you enjoyed it, hated it or have any suggestions, please contact me:


% if(supportIE8) { %> <% } %> <% if(useJquery){ %><% } %>
Check the source of this page to make sure everything was loaded successfully!


{% extends 'base.html' %} {% block content %}
I feel totally overwhelmed, surprised and very, very grateful. Thank you for caring. You are unbelievable.  You inspire me to give back to community even more. I wish I could express properly what I'm feeling right now...
May it always rain stroopwafels on you. But not all the time, that could be inconvenient. Only when you feel like having stroopwafels.  Or you just want to make it rain stroopwafels.
Sending hugs, you crazy, amazing people!
Thank you for writing such a great article. I’ve seen some of your other writing and ideas and you seem to capture difficult concepts very well. I’m really happy that you’re part of our community, and aspire to be as great in some of these things as you are some day :){% endblock content %}


Local Change List
A list of all changes made to models in local storage.
No local changes have been made.
| Model ID |
Type |
Checkpoint |
Revision |
Prev Revision |
| {{change.modelId}} |
{{change.type()}} |
{{change.checkpoint}} |
{{change.rev}} |
{{change.prev}} |
Local to Server Deltas
Below is list of changes required to replicate local data to the server.
No changes required to replicate the local data to the server.
| Model ID |
Revision |
Prev Revision |
| {{delta.modelId}} |
{{delta.rev}} |
{{delta.prev}} |
Local Storage Data
There is no data in local storage.
| Model ID |
Sequence |
Client |
Status |
Driver |
| {{job.getId()}} |
{{job.mobjobSeq}} |
{{job.mobjobClientCode}} |
{{job.mobjobStatus}} |
{{job.mobjobDriver}} |
Local to Server Conflicts
Below is list of changes that cannot be replicated to the server.
No conflicts
| Model ID |
Checkpoint |
Revision |
Prev Revision |
| {{conflict.modelId}} |
{{conflict.checkpoint}} |
{{conflict.rev}} |
{{conflict.prev}} |


Amount: {{ request.amount + ' ' + request.currency}}
Email: {{ request.email }}
Date of expire: {{ request.targetDate | date: 'yyyy-MM-dd' }}
HINT
We recommend you to save the code to clipboard by clicking the COPY icon. You can get this code anytime later in 'My transactions' page.


--- title: "GARDEN YOGA FOR KIDS" date: "2000-01-01 21:01:02 -06:00" categories: - boredom-busters subtitle: "Backyard Fun" event-notes: "Free Stay-At-Home Activity" layout: "free-events" event-image: "garden-yoga-for-kids.jpg" event-dates: "" event-location: "Your backyard" button-type: "register" tickets-link: "" tickets-button: "hide" registration-info: "" instructor-info: "Nature" member-cost: "" public-cost: "" published: true ---
What do yoga and spending time in nature have in common? They both help calm the mind and strengthen the body. Try these garden-inspired yoga poses to help bring peace to your mind and health to your body. For added fun, try the moves outside in a garden, park, or other natural setting. Don't forget to share your workout with us on social media using #redbuttegarden. Namaste!
Download, print, and cut out the yoga cards.
Click HERE for 18 larger, printable yoga cards.


Home
Products
Product 1
Product 2
About
Contact
My Cool Site Menu
Now you can add a cool menu to your websites


{% load static %}
The main goal of this page is to display tweets, twitter users and apply analytics on them The page is divided into 3 parts. The first line of controls in the settings part, in this part query parameters are defined by the user. The second line of controls is the actions part, here the user can pick which query to run. The last part, That is all that remains from the page, is the results part. Here the results of the query the user has run are displayed.
The locations that are used in this part are configured in the "Configure Locations" page. The first control is a dropdown that enables selecting multiple regions and called "select Region". When a region is selected, the second dropdown "Select Place", contains all places inside of that region that were configured in the "Configure Locations" page. Then these places can be selected and the user will be able to run queries on the twitter data saved on these places. The next controls are the "Start Date" and "End Date". In this controls the user can define on what dated the data he wants to see was created in twitter. All queries are time bases, so this effects every action the user does. The final control is the search words, here the user can configure what search words to use in his queries using the dropdown list. Also, in the last control the user can add or remove a search word. Search words can also be phrases, and they can contains whitespace. Example search words can be: "Hamburger", "Good Icecream", etc..
In this part, based on the setting the user has picked in the settings part, he can run queries on the data saved by our server. The data will show on the results part. Next, The functionality of every control will be explained and then what the results looks like.
This button lets the user view tweets that are saved in our database. Tweets are filtered using the settings. Tweets shown are from the locations selected based on twitter search, published in the dates that were picked and Containing One of the search words chosen. Tweets are displayed in a table. The first column of the table is the id of the tweet, and it's also a link to the original tweet on twitter. The second column is the text of the tweet (what the user wrote). The third column is the screen name of the user, with a link to his profile page on twitter. The third column is the location the user wrote in his profile on twitter. The coordinated column is the coordinated in the geo part of the tweet if they are present. If twitter recognized a place that the tweet is connected to, it will appear in the place full name column. Created at is the date and time the tweet was created. the other columns are a paid feature, And they are calculated by ibm watson text understanding.


Greatship and Greatship's subsidiary contract to sell a Platform Supply Vessel (PSV) and a Platform/ROV Support Vessel (ROVSV), respectively.
December 29, 2009—Mumbai
Greatship (India) Limited (GIL), a wholly owned subsidiary of The Great Eastern Shipping Co. Ltd. has contracted to sell its Platform Supply Vessel - "Greatship Diya". This 2003 built, 3350 dwt PSV is expected to be delivered to the buyers in Q1 FY11.
Greatship Global Offshore Services Pte. Ltd. (GGOS), a Singapore incorporated subsidiary of GIL, has also contracted to sell its Platform/ROV Support Vessel identified as Hull No. NC 0215 (tbn "Greatship Rekha") which is currently under construction. This 3000 dwt ROVSV is expected to be delivered to the buyers in Q4 FY10.
The current owned and / or operated fleet of GIL and its subsidiaries stands at six PSVs, eight AHTSVs, two jack up rigs and one MPSSV. The current order book of GIL and its subsidiaries comprises of eleven vessels - three MPSSVs in Singapore, two MSVs in India, four ROVSVs in Sri Lanka and two 150 TBP AHTSVs in Batam.


If you're seeing this page via a web browser, it means you've installed a PURL server successfully. Congratulations!
To finish the setup process visit The User Setup Page and choose an administrator password. This page is only accessable from the local machine and only until an administrator password is choosen.
To get started click the Persistent URLs link at the left and then click the edit tab. In the edit screen click on the chevrons to create a new domain origin. Fill in the form to create a PURL authority that will be served by this server. Once a domain has been created assign it to the server, save the changes. This process may take a few moments, please be patient.
Click on the top level domain to continue to create the PURL hierarchy.
Domains are logical folders that assign access control lists and PURL authorities. Partials are folders in the hierarchy that may use regular expressions to auto complete targets. PURLs are persistent URLs within domains or partials that resolve to an explicit target.
Share your experience or ask questions on the mailing list.


Computer | Software Methodology, Principals of Programming Languages, Database Processing, Computer & Network Security, Computer Graphics, Operating Systems, Intro Software Engineering, C/C++ & Unix, Computer Organization, Intermediate Algorithms, Intermediate Data Structures, Computer Science I&II&III
Economics | Urban Economics, Labor Market Issues, Intermediate Macro Economic Theory, Intermediate Micro Economic Theory, Micro Economic Analysis, Macro Economic Analysis, Intro to Business
Math | Calculus I&II&III, Discrete I&II, Probability and Statistics in Computer Science, Linear Algebra
Other | Brain to Artificial Intelligence, The World & Big Data, GIScience I, History of Life, Environmental Natural Sciences, Dynamic Planet Earth, Earth’s Surface and Environment, Scientific & Technical Writing
Python, C++, C, Java, SQL, NodeJS, ReactJS, JavaScript, HTML, CSS, PHP, C#, Visual Basic
Windows, Linux, Mac, Unix
Flask, IOS/Android Mobile Development, MongoDB, Firebase, AWS, Google Cloud, Dialogflow, Quantopian, MeteorJS, Unity, SEO, WordPress, Oculus, XCode, Arduino, Dreamweaver, Photoshop, Pandas, Jupyter, Bootstrap, Git
Los Angeles, CA
Los Angeles, CA
Marin County, CA
Los Angeles, CA
Santa Monica, CA
Marin County, CA
San Francisco, CA


byway.
Choose Destinations
choose interests
View route
Tips:
To get started, select some of your interests or places you want to visit.
Next


//= template/head.html
About
#CoinsGang
Program
Speakers
Sponsorship
Share your story at #CoinsGang
Become a speaker
SEND REQUEST
Thank you for your request
One of us will get back in touch with you soon!
//= template/footer_add.html


Topics
Often the result of a play may depend on the value of a variable, fact (something learned about the remote system), or previous task result. In some cases, the values of variables may depend on other variables. Additional groups can be created to manage hosts based on whether the hosts match other criteria. This topic covers how conditionals are used in playbooks.
Note
There are many options to control execution flow in Ansible. More examples of supported conditionals can be located here: http://jinja.pocoo.org/docs/dev/templates/#comparisons.
Sometimes you will want to skip a particular step on a particular host. This could be something as simple as not installing a certain package if the operating system is a particular version, or it could be something like performing some cleanup steps if a filesystem is getting full.
This is easy to do in Ansible with the when clause, which contains a raw Jinja2 expression without double curly braces (see group_by – Create Ansible groups based on facts). It’s actually pretty simple:
tasks:
- name: "shut down Debian flavored systems"
command: /sbin/shutdown -t now
when: ansible_facts['os_family'] == "Debian"
# note that all variables can be used directly in conditionals without double curly braces
You can also use parentheses to group conditions:
tasks:
- name: "shut down CentOS 6 and Debian 7 systems"
command: /sbin/shutdown -t now
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "6") or
(ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "7")
Multiple conditions that all need to be true (a logical ‘and’) can also be specified as a list:
tasks:
- name: "shut down CentOS 6 systems"
command: /sbin/shutdown -t now
when:
- ansible_facts['distribution'] == "CentOS"
- ansible_facts['distribution_major_version'] == "6"
A number of Jinja2 “tests” and “filters” can also be used in when statements, some of which are unique and provided by Ansible. Suppose we want to ignore the error of one statement and then decide to do something conditionally based on success or failure:
tasks:
- command: /bin/false
register: result
ignore_errors: True
- command: /bin/something
when: result is failed
# In older versions of ansible use ``success``, now both are valid but succeeded uses the correct tense.
- command: /bin/something_else
when: result is succeeded
- command: /bin/still/something_else
when: result is skipped
Note
both success and succeeded work (fail/failed, etc).
To see what facts are available on a particular system, you can do the following in a playbook:
- debug: var=ansible_facts
Tip: Sometimes you’ll get back a variable that’s a string and you’ll want to do a math operation comparison on it. You can do this like so:
tasks:
- shell: echo "only on Red Hat 6, derivatives, and later"
when: ansible_facts['os_family'] == "RedHat" and ansible_facts['lsb']['major_release']|int >= 6
Note
the above example requires the lsb_release package on the target host in order to return the ‘lsb major_release’ fact.
Variables defined in the playbooks or inventory can also be used. An example may be the execution of a task based on a variable’s boolean value:
vars:
epic: true
Then a conditional execution might look like:
tasks:
- shell: echo "This certainly is epic!"
when: epic
or:
tasks:
- shell: echo "This certainly isn't epic!"
when: not epic
If a required variable has not been set, you can skip or fail using Jinja2’s defined test. For example:
tasks:
- shell: echo "I've got '{{ foo }}' and am not afraid to use it!"
when: foo is defined
- fail: msg="Bailing out. this play requires 'bar'"
when: bar is undefined
This is especially useful in combination with the conditional import of vars files (see below). As the examples show, you don’t need to use {{ }} to use variables inside conditionals, as these are already implied.
Combining when with loops (see Loops), be aware that the when statement is processed separately for each item. This is by design:
tasks:
- command: echo {{ item }}
loop: [ 0, 2, 4, 6, 8, 10 ]
when: item > 5
If you need to skip the whole task depending on the loop variable being defined, used the |default filter to provide an empty iterator:
- command: echo {{ item }}
loop: "{{ mylist|default([]) }}"
when: item > 5
If using a dict in a loop:
- command: echo {{ item.key }}
loop: "{{ query('dict', mydict|default({})) }}"
when: item.value > 5
It’s also easy to provide your own facts if you want, which is covered in Should you develop a module?. To run them, just make a call to your own custom fact gathering module at the top of your list of tasks, and variables returned there will be accessible to future tasks:
tasks:
- name: gather site specific fact data
action: site_facts
- command: /usr/bin/thingy
when: my_custom_fact_just_retrieved_from_the_remote_system == '1234'
Note that if you have several tasks that all share the same conditional statement, you can affix the conditional to a task include statement as below. All the tasks get evaluated, but the conditional is applied to each and every task:
- import_tasks: tasks/sometasks.yml
when: "'reticulating splines' in output"
Note
In versions prior to 2.0 this worked with task includes but not playbook includes. 2.0 allows it to work with both.
Or with a role:
- hosts: webservers
roles:
- role: debian_stock_config
when: ansible_facts['os_family'] == 'Debian'
You will note a lot of ‘skipped’ output by default in Ansible when using this approach on systems that don’t match the criteria.
In many cases the group_by
module (see Working With Modules) can be a more streamlined way to accomplish the same thing; see
Operating System and Distribution Variance.
When a conditional is used with include_*
tasks instead of imports, it is applied only to the include task itself and not
to any other tasks within the included file(s). A common situation where this distinction is important is as follows:
# We wish to include a file to define a variable when it is not
# already defined
# main.yml
- import_tasks: other_tasks.yml # note "import"
when: x is not defined
# other_tasks.yml
- set_fact:
x: foo
- debug:
var: x
This expands at include time to the equivalent of:
- set_fact:
x: foo
when: x is not defined
- debug:
var: x
when: x is not defined
Thus if x
is initially undefined, the debug
task will be skipped. By using include_tasks
instead of import_tasks
,
both tasks from other_tasks.yml
will be executed as expected.
For more information on the differences between include
v import
see Creating Reusable Playbooks.
Note
This is an advanced topic that is infrequently used.
Sometimes you will want to do certain things differently in a playbook based on certain criteria. Having one playbook that works on multiple platforms and OS versions is a good example.
As an example, the name of the Apache package may be different between CentOS and Debian, but it is easily handled with a minimum of syntax in an Ansible Playbook:
---
- hosts: all
remote_user: root
vars_files:
- "vars/common.yml"
- [ "vars/{{ ansible_facts['os_family'] }}.yml", "vars/os_defaults.yml" ]
tasks:
- name: make sure apache is started
service: name={{ apache }} state=started
Note
The variable “ansible_facts[‘os_family’]” is being interpolated into the list of filenames being defined for vars_files.
As a reminder, the various YAML files contain just keys and values:
---
# for vars/RedHat.yml
apache: httpd
somethingelse: 42
How does this work? For Red Hat operating systems (‘CentOS’, for example), the first file Ansible tries to import is ‘vars/RedHat.yml’. If that file does not exist, Ansible attempts to load ‘vars/os_defaults.yml’. If no files in the list were found, an error is raised.
On Debian, Ansible first looks for ‘vars/Debian.yml’ instead of ‘vars/RedHat.yml’, before falling back on ‘vars/os_defaults.yml’.
Ansible’s approach to configuration – separating variables from tasks, keeping your playbooks from turning into arbitrary code with nested conditionals - results in more streamlined and auditable configuration rules because there are fewer decision points to track.
Note
This is an advanced topic that is infrequently used. You can probably skip this section.
Sometimes a configuration file you want to copy, or a template you will use may depend on a variable. The following construct selects the first available file appropriate for the variables of a given host, which is often much cleaner than putting a lot of if conditionals in a template.
The following example shows how to template out a configuration file that was very different between, say, CentOS and Debian:
- name: template a file
template:
src: "{{ item }}"
dest: /etc/myapp/foo.conf
loop: "{{ query('first_found', { 'files': myfiles, 'paths': mypaths}) }}"
vars:
myfiles:
- "{{ansible_facts['distribution']}}.conf"
- default.conf
mypaths: ['search_location_one/somedir/', '/opt/other_location/somedir/']
Often in a playbook it may be useful to store the result of a given command in a variable and access it later. Use of the command module in this way can in many ways eliminate the need to write site specific facts, for instance, you could test for the existence of a particular program.
Note
Registration happens even when a task is skipped due to the conditional. This way you can query the variable for `` is skipped`` to know if task was attempted or not.
The ‘register’ keyword decides what variable to save a result in. The resulting variables can be used in templates, action lines, or when statements. It looks like this (in an obviously trivial example):
- name: test play
hosts: all
tasks:
- shell: cat /etc/motd
register: motd_contents
- shell: echo "motd contains the word hi"
when: motd_contents.stdout.find('hi') != -1
As shown previously, the registered variable’s string contents are accessible with the ‘stdout’ value. The registered result can be used in the loop of a task if it is converted into a list (or already is a list) as shown below. “stdout_lines” is already available on the object as well though you could also call “home_dirs.stdout.split()” if you wanted, and could split by other fields:
- name: registered variable usage as a loop list
hosts: all
tasks:
- name: retrieve the list of home directories
command: ls /home
register: home_dirs
- name: add home dirs to the backup spooler
file:
path: /mnt/bkspool/{{ item }}
src: /home/{{ item }}
state: link
loop: "{{ home_dirs.stdout_lines }}"
# same as loop: "{{ home_dirs.stdout.split() }}"
As shown previously, the registered variable’s string contents are accessible with the ‘stdout’ value. You may check the registered variable’s string contents for emptiness:
- name: check registered variable for emptiness
hosts: all
tasks:
- name: list contents of directory
command: ls mydir
register: contents
- name: check contents for emptiness
debug:
msg: "Directory is empty"
when: contents.stdout == ""
The following Facts are frequently used in Conditionals - see above for examples.
Possible values (sample, not complete list):
Alpine
Altlinux
Amazon
Archlinux
ClearLinux
Coreos
Debian
Fedora
Gentoo
Mandriva
NA
OpenWrt
OracleLinux
RedHat
Slackware
SMGL
SUSE
VMwareESX
This will be the major version of the operating system. For example, the value will be 16 for Ubuntu 16.04.
Possible values (sample, not complete list):
AIX
Alpine
Altlinux
Archlinux
Darwin
Debian
FreeBSD
Gentoo
HP-UX
Mandrake
RedHat
SGML
Slackware
Solaris
Suse
Windows
See also


Qpid Broker-J 9.0.0 Release Notes
Qpid Broker-J is a message broker written in Java that stores, routes,
and forwards messages using AMQP.
For more information about this release, including download links and
documentation, see the release overview.
New features and improvements
- QPID-8368 - [Broker-J] Graylog support
- QPID-8456 - [Broker-J] Configurable shutdown timeout
- QPID-8484 - [Broker-J] Reimplementation of the limit number of connections per user
- QPID-8487 - [Broker-J] Enhance ACL rule evaluation
- QPID-8488 - [Broker-J] Enhance ACL rule with multi-value properties
- QPID-8545 - [Broker-J] SSL Engine looping circuit breaker
- QPID-8547 - [Broker-J] Configurable parameters for CoalescingCommiter
- QPID-8548 - [Broker-J] Enhance ACL file loading and parsing
- QPID-8558 - [Broker-J] Enhancement of sole connection enforcement policy evaluation
- QPID-8563 - [Broker-J] Purge all queues
- QPID-8565 - [Broker-J] Enhancement of ACL rule predicates evaluation
- QPID-8566 - [Broker-J] Implement composite authentication provider
- QPID-8573 - [Broker-J] Logging enhancement of Sole Connection Enforcement Policy events
- QPID-8578 - [Broker-J] ACL firewall predicates should be applied to HTTP(S) connections
- QPID-8581 - [Broker-J] Query REST API improvements
- QPID-8590 - [Broker-J] Purge on flow to disk queue
- QPID-8591 - [Broker-J] Missing message id for add/update/delete user
- QPID-8592 - [Broker-J] Pass context value from parent query into the subquery
- QPID-8596 - [Broker-J] Migrate build process to JDK 11/17
- QPID-8601 - [Broker-J] Instrumentation agent
- QPID-8602 - [Broker-J] Show producer details in REST API
- QPID-8603 - [Broker-J] Reset statistics
- QPID-8612 - [Broker-J] Change default GC from CMS to G1
Bugs fixed
- QPID-8452 - [Broker-J] Message larger than 2GB
- QPID-8536 - [Broker-J] Incorrect check of maximum open connections
- QPID-8568 - [Broker-J] Context variables disappear from All list in GUI context editor
- QPID-8572 - [Broker-J] The binding is broken when queue and exchange have the same name
- QPID-8588 - [Broker-J] NullPointerException in AbstractVirtualHost.autoCreateNode
Apache Qpid, Messaging built on AMQP; Copyright © 2015
The Apache Software Foundation; Licensed under
the Apache
License, Version 2.0; Apache Qpid, Qpid, Qpid Proton,
Proton, Apache, the Apache feather logo, and the Apache Qpid
project logo are trademarks of The Apache Software
Foundation; All other marks mentioned may be trademarks or
registered trademarks of their respective owners


Handles Haml version-reporting. Haml not only reports the standard three version numbers, but its Git revision hash as well, if it was installed from Git.
Returns a hash representing the version of Haml. The `:major`, `:minor`, and `:teeny` keys have their respective numbers as Fixnums. The `:name` key has the name of the version. The `:string` key contains a human-readable string representation of the version. The `:number` key is the major, minor, and teeny keys separated by periods. If Haml is checked out from Git, the `:rev` key will have the revision hash. For example:
{ :string => "<IP_ADDRESS>16393", :rev => "9616393b8924ef36639c7e82aa88a51a24d16949", :number => "2.1.0", :major => 2, :minor => 1, :teeny => 0 }
@return [{Symbol => String/Fixnum}] The version hash
# File lib/haml/version.rb, line 27 27: def version 28: return @@version if defined?(@@version) 29: 30: numbers = File.read(scope('VERSION')).strip.split('.').map { |n| n.to_i } 31: name = File.read(scope('VERSION_NAME')).strip 32: @@version = { 33: :major => numbers[0], 34: :minor => numbers[1], 35: :teeny => numbers[2], 36: :name => name 37: } 38: @@version[:number] = [:major, :minor, :teeny].map { |comp| @@version[comp] }.compact.join('.') 39: @@version[:string] = @@version[:number].dup 40: 41: if rev = revision_number 42: @@version[:rev] = rev 43: unless rev[0] == (( 44: @@version[:string] << "." << rev[0...7] 45: end 46: end 47: 48: @@version[:string] << " (#{name})" 49: @@version 50: end
# File lib/haml/version.rb, line 54 54: def revision_number 55: if File.exists?(scope('REVISION')) 56: rev = File.read(scope('REVISION')).strip 57: return rev unless rev =~ /^([a-f0-9]+|\(.*\))$/ || rev == '(unknown)' 58: end 59: 60: return unless File.exists?(scope('.git/HEAD')) 61: rev = File.read(scope('.git/HEAD')).strip 62: return rev unless rev =~ /^ref: (.*)$/ 63: 64: ref_name = $1 65: ref_file = scope(".git/#{ref_name}") 66: info_file = scope(".git/info/refs") 67: return File.read(ref_file).strip if File.exists?(ref_file) 68: return unless File.exists?(info_file) 69: File.open(info_file) do |f| 70: f.each do |l| 71: sha, ref = l.strip.split("\t", 2) 72: next unless ref == ref_name 73: return sha 74: end 75: end 76: return nil 77: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.


Glucagon levels are increasingly being included as endpoints in clinical study design and more than 400 current diabetes-related clinical trials have glucagon as an outcome measure. The reliability of immune-based technologies used to measure endogenous glucagon concentrations is, therefore, important. We studied the ability of immunoassays based on four different technologies to detect changes in levels of glucagon under conditions where glucagon levels are strongly suppressed. To our surprise, the most advanced technological methods, employing electrochemiluminescence or homogeneous time resolved fluorescence (HTRF) detection, were not capable of detecting the suppression induced by a glucose clamp (6 mmol/L) with or without atropine in five healthy male participants, whereas a radioimmunoassay and a spectrophotometry-based ELISA were. In summary, measurement of glucagon is challenging even when state-of-the-art immune-based technologies are used. Clinical researchers using glucagon as outcome measures may need to reconsider the validity of their chosen glucagon assay. The current study demonstrates that the most advanced approach is not necessarily the best when measuring a low-abundant peptide such as glucagon in humans.
Glucagon, a 29-amino-acid peptide secreted from the pancreatic alpha cells in response to hypoglycemia [ 1 ], is derived from the proglucagon molecule, which is also expressed in the intestine and brain [ 2 ]. Glucagon has stimulatory effect on hepatic glucose production, and dysregulation of its secretion may contribute to the development of diabetes [ 3 – 6 ]. Glucagon measurements are, therefore, often an important study outcome; according to clinicaltrials.gov, it is included as an endpoint in more than 400 clinical studies. However, measurement of glucagon is a delicate matter and the validity of the data relies on sufficient specificity and sensitivity of the assay. Differential tissue-specific processing of proglucagon results in molecular heterogeneity, meaning that assay specificity with respect to the different molecular forms is important. Thus, in addition to glucagon itself, proglucagon gives rise to several peptides containing the glucagon sequence, including oxyntomodulin, glicentin, and proglucagon 1–61, as well as molecules with some sequence homology to glucagon, including glucagon-like peptide-1 (GLP-1) and glucagon-like peptide-2 (GLP-2) and major proglucagon fragment [ 7 ]. Furthermore, each of these molecular forms may occur in extended or truncated forms, which may or may not be biologically active [ 2 ]. The immediate specificity problem is therefore of considerable magnitude. Sensitivity is equally important, since glucagon occurs in low picomolar concentrations in the circulation. Its concentration rises in response to hypoglycemia and falls in response to rising glucose (e.g., after carbohydrate meals), with the rate of as well as the absolute magnitude of the decrease being of considerable importance for the resulting glucose tolerance. The ability of assays to register these decreases from already low levels is, therefore, critical [ 8 ].
In the current study, we investigated assays based on four widely applied immune-based technologies: a radioimmunoassay (RIA), a spectrophotometric enzyme-linked immunoassay (ELISA), and ELISAs based on electrochemiluminescence (ECL), and homogeneous time-resolved fluorescence (HTRF) detection. We hypothesized that the assay type might influence measured glucagon concentrations. To address this, we analyzed glucagon levels during a glucose clamp with or without atropine (atropine blocks cholinergic signaling through the muscarinic receptors and leads to further suppression of glucagon secretion) in five healthy male participants using these four different approaches; previous measurements indicated that the clamp + atropine protocol resulted in pronounced suppression of glucagon levels [ 9 ].
Samples were derived from a previously published study by Plamboeck et al. [ 9 ]. The study was conducted in accordance with the Helsinki Declaration II and was approved by the Scientific-Ethical Committee of the Capital Region of Denmark (registration number: H-2-2011-062) and by the Danish Data Protection Agency (journal number: 2011-41-6381) and registered at clinicaltrials.gov (ID:
We used four immune-based assays for measurement of glucagon: (A) an in-house C-terminal RIA (codename 4305) [ 6 , 8 , 10 ]; (B) Mercodia sandwich ELISA (spectrophotometry) (cat# 10-1271-01, Uppsala, Sweden); (C) sandwich ELISA from MSD (chemiluminescence) (cat# K151HCC-1, MD 21201, USA); and (D) sandwich ELISA from Cis-Bio (homogeneous time-resolved fluorescence) (cat# 62GLCPEK, Codolet, France). Assays were carried out as per protocol according to the manufacturers' instructions. Samples were kept cold (ice-bath) at all times, and all samples were measured simultaneously in a single run to eliminate interassay variance.
To analyze changes in glucagon levels over time, a one-way ANOVA for repeated measurements followed by a Bonferroni post hoc analysis was performed for each of the four assays. To compare the ability of the assays to detect changes in glucagon levels, we created a generalized regression model (ANCOVA) with glucagon as dependent variable and time (minutes) and method (assay) as independent variables. Net area under the curve (delta changes from time zero to 160 minutes relative to the individual baselines) (nAUC) was calculated using the trapezoidal rule and differences were tested using a two-sided test. A power calculation was made based on the following assumptions: normality of data distribution, homoscedasticity, one-sample t-test, quantification limits and coefficient of variations provided by the manufacturers, an alpha value of 0.05, and a sample size of five. The calculation showed that the power to detect significant changes (of 5%) in glucagon levels ranged from 79% to 84% across the four assays. P < 0.05 was considered significant. Calculations were made using GraphPad Prism version 6.04 for Windows, GraphPad Software, La Jolla, California, USA,
The recoveries of synthetic glucagon in pooled human plasma ( N = 4) were 95 ± 11% (assay A), 104 ± 5% (assay B), 75 ± 15% (assay C), and 67 ± 21% (assay D). Glucagon levels dropped significantly compared to baseline (time = 0 min) in both saline and atropine treated groups ( P < 0.01) when samples were measured using assay A ( Figure 1(a)) and assay B ( Figure 1(b)) but not with assay C ( Figure 1(c), P = 0.31) and assay D ( Figure 1(d), P = 0.24). Assay A was significantly different ( P < 0.05) from assays C and D but not assay B ( P = 0.43). Assay B was significantly different from assays C and D ( P < 0.05) whereas there were no differences between assays C and D ( P = 0.27). nAUCs during infusion of saline and atropine, respectively, for assay A and assay B were significantly different ( P < 0.001), indicating further suppression of glucagon secretion with atropine addition. For assays C and D, nAUCs were significantly different between atropine ( P < 0.01) and saline, indicating that atropine weakly suppressed glucagon levels compared to the clamp alone, where nAUCs did not show significance compared to baseline (zero) by one-side t-test ( P = 0.11 and P = 0.17).
Immune-based detection methods utilize the extreme binding energy of antibodies which may have equilibrium constants reaching values of 10 12 L/mol, providing these methods with a potential to measure very low concentrations. However, the use of antibodies relies on their specificity and the antigen-antibody reaction may also may be sensitive to the so-called matrix effects, that is, interference from components in plasma including a variety of high-abundant plasma molecules or proteins (e.g., albumin and immunoglobulins), leading to unspecific interference in antibody-antigen interaction [ 11 ].
Assay D uses the homogeneous time-resolved fluorescence technology which combines fluorescence resonance energy transfer technology (FRET) with time-resolved measurement (TR) [ 12 ]. HRTF is mainly used in ( in vitro) primary and secondary screening phases of drug development. However, its usefulness in highly sensitive immunoassays required for detection of 1 pmol/L differences in glucagon levels may be questioned. In contrast, assay C applies an electrochemiluminescence approach: when excited by electrical stimulation, labeled molecules emit light, which then is detected by cameras. The most generic ELISA used in our study is assay B, involving spectrophotometry detection; a chromogenic substrate is added to sample wells, which is then cleaved by an enzyme, for example, horseradish peroxidase, coupled to the detection antibody. Assay A is a radioimmunoassay utilizing competition between radioactively labeled antigen and unlabeled antigen (peptide standard or sample with unknown concentration) for binding to a limited number of specific antibody binding sites. Although it is the most simple, with regard to technology, the data clearly shows that assays A and B perform significantly better than assays C and D. However, a requirement for such a performance is the application of antibodies with sufficient binding energy (and specificity), which is often the crucial step in assay development.
In this study, we highlight the crucial importance of choosing the “right” immune-based method when analyzing endogenous glucagon. We have exemplified the challenge by demonstrating that changes in measured glucagon levels depend on the assay used ( Figure 1); where assays A and B clearly register the attenuation of glucagon levels during a glucose clamp, assays C and D did not. The basal levels measured were comparable, around 15 pmol/L (although assay C showed slightly higher levels, around 20 pmol/L). This may reflect a specificity problem in assay C; for example, this assay could be cross-reacting with glucagon-like molecules (oxyntomodulin, glicentin, or glucagon-like peptide-1 [ 7 , 11 ]) although not stated by the manufacturers. Otherwise, the difference between the assays, although not formally tested here, most likely reflects differences in sensitivity and therefore ability to detect dynamic changes in the very low picomolar range. In a previous study [ 6 ], a sensitivity analysis was carried out for assays A and B (where assay A was more sensitive), and, in another study of other commercially available assays [ 7 ], sensitivity was clearly insufficient to allow analysis in this concentration range. In addition, we recently demonstrated that measured glucagon levels in subjects with renal dysfunction may erroneously appear elevated, probably due to cross-reactions with N-terminal elongated inactive isoforms of the glucagon molecule (1–61) when analyzed with conventional single antibody C-terminal radioimmunoassays [ 6 ]. Importantly for interpretation of clinical studies, the potential instability of glucagon during inappropriate sample preparation and storage, such as multiple freeze-thaw cycles or storing plasma samples at room temperature for more than 1 hour, should also be considered [ 8 ].
Novel mass-spectrometry based detection (e.g., selected reaction monitoring (SRM)) of low-abundant peptides as glucagon [ 13 ] may in the future facilitate validation of immune-based detection methods. Unfortunately, current mass-spectrometry based methods still depend on 2D-gel extraction techniques or bead-coupled antibodies [ 14 ] both of which have questionable recoveries and specificity. However, in the future mass-spectrometry based detection methods may involve label-free (be it chemical or antibody based) purification steps as recently demonstrated [ 15 ] and may therefore provide accurate validation.
In conclusion, levels of glucagon are increasingly being used as outcome measures in clinical trials and the reliability of the glucagon assays employed is therefore critical for appropriate interpretation of the data.
The authors acknowledge support from NNF Center for Basic Metabolic Research, University of Copenhagen, NNF Application no. 13563 (Novo Nordisk Foundation, Denmark), The Danish Council for Independent Research (DFF, 1333-00206A), Augustinus Foundation 14-0962, European Molecular Biology Organisation, and the European Foundation for the Study of Diabetes.
Cis-Bio provided assay kits without imposing restrictions on the study design or interpretation of results. Otherwise the authors have no dualities of interest to declare.
Nicolai J. Wewer Albrechtsen, Simon Veedfald, Astrid Plamboeck, Carolyn F. Deacon, Filip K. Knop, Tina Vilsboll, Bolette Hartmann, and Jens J. Holst provided substantial contribution to the concept and design; Nicolai J. Wewer Albrechtsen, Simon Veedfald, and Jens J. Holst substantially contributed to analysis and interpretation of data; Nicolai J. Wewer Albrechtsen, Simon Veedfald, and Jens J. Holst drafted the paper; Astrid Plamboeck, Carolyn F. Deacon, Bolette Hartmann, Tina Vilsboll, and Filip K. Knop revised the paper critically for important intellectual content. All authors have provided final approval of the version to be published. Jens J. Holst is responsible for the integrity of the work as a whole. Nicolai J. Wewer Albrechtsen and Simon Veedfald contributed equally to the study and are co-first authors.
Plasma glucagon levels of five healthy participants during a 6 mmol/L glucose clamp with simultaneous infusion of either saline (black) or atropine (red). (a) depicts assay A, a radioimmunoassay; (b) depicts assay B, a spectrophotometrically based ELISA; (c) depicts assay C, a chemiluminescence based ELISA; and (d) depicts assay D, a homogeneous time-resolved fluorescence based ELISA. Net area under the curve (nAUC) is depicted separately at upper right quadrant on (a), (b), (c), and (d). ∗ represents a significant two-sided t-test comparing saline nAUC to atropine nAUC. Data illustrated as mean ± standard deviation.


Can you resolve the conflict in you? If so, you’re most welcome to try.Be confused, be messed up, be twisted as you try to debate both for and against a topic on a simple flip
Captions can be to pictures, as trailers are to movies.You are given the opportunity to display your prowess in wordplay by giving appropriate captions to a wide variety of illustrations
When mind and action are separate, zen is lost. We keep the two in sync by paying attention.Inspired from the online phenomenon, Musically.


Lessons from cooperative economics, Part 3
This is part 3 of "14 lessons from A Cooperative Species By Samuel Bowles & Herbert Gintis, 2011.
Part i presents the key takeaways.
Part 0 explores each of the 14 lessons.
Part 1 gives a broad brush introduction to competing theories.
Part 2 shows that correlated equilibrium is better than Nash equilibrium, and that some correlating signal is needed to maintain human civility as we know it.
This part touches briefly on the concepts that are covered in the latter half of the book.
Overview of chapters 6 through 9
Chapter 6 covers how cooperation got bootstrapped in ancient times.
Chapter 7 is on the coevolution of institutions and behaviors -- essentially suggesting the co-evolution of culture and genetics.
Chapter 8 covers parochialism and war.
The fact that altruism and parochialism may have a common evolutionary origin, whether cultural or genetic, does not mean that the two are inseparable. Examples of tolerant, even anti-parochial, altruism include subjects in some intergroup behavioral experiments, the electoral support in many countries for tax-supported economic aid to the people of poor nations, and the participation of people of all ancestral groups in political movements against racism.
One thing covered in this chapter that I don't surface very much in my summary overview is the importance of war in evolutionary biology, according to the authors. The book seems to suggest that warfare played a substantial role in the evolution of altruism. Kind of ironic, but there you have it -- becoming good at warfare improved in-group cooperation, and helped those groups compete better against other groups. Ultimately, they argue, the outcome was the evolution of altruism.
Chapter 9 does some computer simulations, showing how “Opportunists” ruin a group. It then goes on to demonstrate that Punishers are necessary to stamp out not only infiltrators, free-loaders, and shirkers, but also eliminate Opportunists and Cooperative Nonpunishers. Some theory is provided arguing why Punishers prevail in terms of Darwinian selection.
The latter part of chapter 9 delves deeper into what I consider to be the most interesting part of the book -- their model for a decentralized social order.
Evolution of Strong Reciprocity
A predisposition to cooperate and a willingness to punish defectors is what we have termed strong reciprocity, and it is the combination of the two that is essential to the large-scale cooperation exhibited by our species.
Punishment
- Reduces the gain that can be had by free-riding.
- Encourages self-interested individuals to cooperate.
Coordinated Punishment
Here is where things get interested from the perspective of decentralized consensus.
Previously it was argued that punishment improves group effectiveness, and that centralized punishment over large groups is a recent cultural evolution and still quite ineffective. This section shows how decentralized punishment works.
Outline of the model
The initial period in the life of a group has three stages.
- A signaling stage in which at cost q, punishers can signal their intent to punish any defector. The cost of signaling is high enough that it does not pay to signal and then not to punish.
- A cooperation stage, during which individuals can choose to cooperate or defect.
- A stage where defectors are detected and punished.
Cooperation costs the cooperator c and benefits each member of the group b=n. We assume b > c > b=n. Were there no punishment option, the interaction would be a public goods game (n-person prisoners’ dilemma) in which the dominant strategy would be to not cooperate. This is both why punishment is necessary and cooperative game theory + correlated equilibrium are good explanations, because people DO cooperate, but WOULD NOT if not for punishment along with a correlating device (say, our norms or a centralized institutional enforcement agency).
The punishment stage is decentralized -- individuals coordinate with other punishers to administer punishment. Individuals that do not do their part in helping monitor compliance or to mete out punishment can also be punished for shirking their duty.
Hunting and Warefare benefit greatly from coordinated behaviors.
Humans are excellent at clubbing and throwing projectile weapons compared to other animals.
While size, strength, and vigor generally determine the outcome of animal disputes, victory often involving great cost even to the winner, in human societies, through the use of coordination, stealth and deadly weapons, even a small number of attackers can defeat the most formidable single enemy at very low fitness cost to the attackers.
While hunting and warfare are clearly important to survival, much of the challenge is in getting in-group behaviors to be more cooperative than competitive. The reasons non-cooperative game theory works so hard at ensuring the truthful operation of participants is because of the following:
(a) Self-interested members will typically have something to gain by misrepresenting the actions taken by others. (b) Mistakes happen, and with classical game theory this causes the group to spiral into anarchy.
Modern large-scale societies, we observed, convert private to public information by judicial processes that took centuries to evolve and that presuppose that court officials, jury members, and law enforcement officers adhere to standards of professional conduct that preclude the unrestrained pursuit of self-interest.
Smaller scale ancestral groups devised other ways to convert private to public information. Gossip, group discussions with all or most members present, and taking meals in public are examples.
For larger groups, a decentralized approach is required, along with an internalized correlating device combined with social norms.
Socialization
Individuals who developed the capacity to internalize group-beneficial norms would feel chastened when punished for violating these norms. This is less costly to the group overall than punishment that would diminish the individual's ability to contribute. To persuade group members to internalize these norms entails some degree of socialization, which takes some effort. Groups that devote their socialization practices to this end would thrive.
Conformist cultural transmission may arise for a variety of reasons, ranging from an evolved social learning strategy in which individuals regard the population frequency of a trait as a measure of its desirability, all the way to population-level institutional arrangements for the deliberate socialization of the young, in which the content reflects which types are prevalent in the population. We stress the latter for empirical reasons: most societies devote substantial time and resources to deliberately socializing the young to act in ways that are beneficial to others, and an adequate explanation of social preferences needs to take account of this fact
At some point along the way, cultural learning results in effective norms, and eventually these norms are internalized, either by socialization, or for certain powerful norms, genetically resulting in Gene-Culture Coevolution.
A considerable fraction of the total available time of the members of most societies is spent teaching the young the proper way to behave, rather than providing for the nutritional and other needs of its members. But in addition to the cost of acquiring such a norm (u>0), there is a further cost: the rule will not be ideally suited to all situations, and its internalization deprives the individual of flexibility in dealing with such situations on a case-by-case basis
Why, then, are humans so susceptible to internalizing general rules? because it relieves the individual from calculating the costs and benefits in each situation and reduces the likelihood of making costly errors. [ precomputing frequently needed results for rapid access … similarly as with other more primary emotional reasoning ]
A similar argument led John Stuart Mill to remark, “Being rational creatures [sailors] go to sea with it [the Nautical Almanac] already calculated; and all rational creatures go out upon the sea of life with their minds made up on the common questions of right and wrong, as well as on many of the far more difficult questions of wise and foolish”
Social Emotions
Individuals maximize a utility function that includes five distinct motives:
- one’s individual material payoffs,
- how much one values the payoffs to others,
- this depending on both one’s unconditional altruism
- and one’s degree of reciprocity, as well as
- one’s sense of guilt or shame in response to one’s own and others’ actions.
Punishment not only reduces material payoffs of those who transgress norms, but also may recruit emotions of shame toward the modification of behavior.
In some societies many defectors react to being punished by increasing their contribution to the group, even when the punishment does not affect material payoffs. This is evidence of a shame response.
In other societies the punished react by counterpunishing contributors, consistent with an anger response.
Social emotions in response to sanctions can thus either foster or undermine cooperation.
Reacting to sanctions, then, is often not a dispassionate calculation of material costs and benefits, but rather involves the deployment of culturally specific social emotions. The altruistic punishment of shirkers by strong reciprocators can proliferate in a population and sustain high levels of cooperation. Social emotions and punishment of miscreants may be synergistic, each enhancing the effects of the other.
Conclusion
“Any animal whatever, endowed with well-marked social instincts, the parental and filial affections being here included, would inevitably acquire a moral sense or conscience, as soon as its intellectual powers had become as well developed, or nearly as well developed, as in man.” -- Charles Darwin, The Descent of Man Chapter IV (1873)
How did it get started?
The authors propose that their model of decentralized social preference arose due to small tweak to previously existing mechanisms, that improved upon the existing mechanisms.
- kin-based altruism
- ceased discriminating against the non-kin members
- reciprocal altruism
- deleting the proviso that one should condition one’s behavior on expectations of future reciprocation
These traits evolved over tens of thousands of generations and approximately 150,000 foraging bands. This number of generations combined with this number of competing groups provided ample opportunity for nature to tweak the competitive behaviors and yield the progenitors of modern cooperative behaviors. They believe that the group structured nature of human populations played an important role on human evolution.
They believe that another major contributor to evolution of these valued traits was the cultural transmission of empirically well-documented behaviors such as the internalization of norms, within-group leveling, and * between-group hostility.
They believe that contrary to what the theories based on self-regard may say, that genuine altruism provides a more accurate explanation of much of human cooperation. This means a willingness to sacrifice one’s own interest to help others, including those who are not family members, and not simply in return for anticipated reciprocation in the future.
The challenge of explaining the origins of human cooperation has resulted in the following:
- Led them to study social and environmental conditions of life of mobile foraging bands and other stateless small-scale societies that arguably made up most of human society for most of the history of anatomically modern humans.
- Made noncooperative game theory (which assumes the absence of enforceable contracts) an essential tool.
But most forms of contemporary cooperation are supported by incentives and sanctions based on a mixture of multilateral peer interactions and third-party enforcement, often accomplished by the modern nation-state.
It would thus be wise to resist drawing strong conclusions about cooperation in the 21st century solely on the basis of our thinking about the origins of cooperation in the Late Pleistocene.
But the fundamental challenges of social living and sustaining a livelihood that our distant ancestors faced are in many respects not fundamentally different from those we face today. Modern states and global markets have provided conditions for mutualistic cooperation among strangers on a massive scale.
Altruistic cooperation remains an essential requirement of economic and social life.
The reason is that neither private contract or governmental fiat singly or in combination provides an adequate basis for the governance of modern societies.
- Social interactions in modern economies are typically at best quasi-contractual.
- Some aspects of what is being transacted are regulated by complete and readily enforceable contracts, while others are not.
- Transactions concerning credit, employment, information, and goods and services where quality is difficult to monitor provide examples of quasi-contractual exchanges.
- Where contracting is absent or incomplete, the logic of Adam Smith’s invisible hand no longer holds.
- Decentralized markets fail to implement efficient allocations.
- Governments typically lack the information, and often the motivation, necessary to provide adequate governance where markets fail or are absent.
We now know from laboratory experiments that subjects in marketlike situations with complete contracts tend to behave like the Homo economicus of the Adam Smith of The Wealth of Nations, but when their contracts are not complete their behavior fortunately resembles more the virtuous citizens of the Adam Smith of The Theory of Moral Sentiments.
Quotable
Thus, where the invisible hand fails, the handshake may succeed
Social preferences such as a concern for the well-being of others and for fair procedures remain essential to sustaining society and enhancing the quality of life.
Closing
In a world increasingly connected not just by trade in goods but also by the exchange of violence, information, viruses, and emissions, the importance of social preferences in underwriting human cooperation, even survival, may now be greater even than it was among that small group of foragers that began the exodus from Africa 55,000 years ago to spread this particular cooperative species to the far corners of the world.
Part i : Introduction.
Part 0 : Overview of 14 key lessons of cooperative economics.
Part 1 : Overview of competing alternatives.
Part 2 : Failures of non-cooperative theory.


--- layout: data_model title: DataSegmentType this_version: 1.0.1 ---
The DataSegmentType is intended to provide a relatively abstract way of characterizing data segments that may be written/read/transmitted or otherwise utilized in actions or behaviors.
| Field Name | Type | Description |
|---|---|---|
| @idoptional | QName |
The id field specifies a unique id for this data segment. |
| Data_Format0..1 | DataFormatEnum |
The Data_Format field refers to the type of data contained in the Data_Segment element. |
| Data_Size0..1 | DataSizeType |
The Data_Size field contains the size of the data contained in this element. |
| Data_Segment0..1 | StringObjectPropertyType |
The Data_Segment field contains the actual segment of data being characterized. |
| Offset0..1 | IntegerObjectPropertyType |
The Offset field allows for the specification of where to start searching for the specified data segment in an object, in bytes. |
| Search_Distance0..1 | IntegerObjectPropertyType |
The Search_Distance field specifies how far into an object should be ignored, in bytes, before starting to search for the specified data segment relative to the end of the previous data segment. |
| Search_Within0..1 | IntegerObjectPropertyType |
The Search_Within field specifies that at most N bytes are between data segments in related objects. |


This table gives an indication of each participant's understanding of the descriptions.
The green cells indicate that participants 2, 3, 4, 5 mostly perceived the descriptions as understandable, while the yellow cell indicates that participant 1 mostly felt unsure about the understandability of the descriptions.
The results suggest that an average participant percieved the descriptions as understandable and the average number of exact matches per participant is 5 (± 1.58).
Table Comparing Each Participant’s Most Common Rating and the Total Number of Exact Matches Between Their Input Formula and the Expected Formula, and the Overall Average Rating and Matches between Participants.
A Stacked Chart Comparing the Proportion of Ratings and the Total Exact Matches (out of 5) of Each Formula; and Displays the Total Percentage of Each Rating and the Total Exact Matches for the 50 Responses.
The expressions that performed the best included those with power, equals, multiplication, plus and divide operators.
The descriptions for the complex expressions y=mx+c and (xyz)^3 were rated as understandable by 100% of the responses, which coincides with all five participants typing out the formulae correctly.
The descriptions that did not perform as well, were those that contained square root, integral and minus operators. The description for the expression (x-y)/2 was interpreted as (y-x)/2 (reversed order of operands for the minus sign) by 3 of the 5 participants. The same issue with the minus operator occurred with the expression x-(y/2), it was understood as (y/2)-x by 4 out of 5 participants and received zero exact matches.
Descriptions containing a square root received mixed ratings and few exact matches. The expression sqrt(a-b)/2c could not be answered correctly by any of the participants. The L1 speaker was the only participant able to distinguish between sqrt(a)+b and sqrt(a+b). One participant, an L2 speaker, commented that they were confused by the wording ‘Umaziphinde’, in the square root description.
There was a single description containing an integral, int(x+1), which was answered correctly only by the L1 speaker. This description received the most mixed ratings, with a different rating from each of the five participants.
There were two types of issues uncovered by the formula input section of the evaluation; suspected problems with terminology
for the square root and integral templates; and issues with the order of operands for the minus template.
Asking participants to type out the expression’s formula was a way to determine if a participant’s perceived understandability matches with their actual understandability. Although the participants perceived the descriptions as understandable, the results show that on average a participant was only able to accurately replicate the formulae 50% of the time.
A good example of why this check was necessary is seen in the stacked chart; 80% of participants agreed that the description for (x-y)/2 was understandable; however, three participants wrote down the same incorrect formula. Since there was a consistent error across these three participants, it’s likely that the error came from the semantics of the template, and not a misunderstanding from the participants.
A recommendation for going forward is that the templates for the minus, square root, and integral operators require improvements; we consider that during the corpus creation stage, collecting more output samples from a wider range of isiZulu speakers and then basing our templates off the most popular responses, could be a more comprehensive approach to building templates, as shown by (Ferres and Sepúlveda, 2011) in their template-based system.
created with
Website Builder Software .


Epicodus Wiki
HTML and CSS
Markdown
Block Elements
Inline Elements
CSS
Bootstrap
Divs and Spans
Floats
Box Model
Cascading Styles
Grid System
Responsive Design
JavaScript and jQuery
JavaScript (js) arithmetic
JS variables
JS methods
JS strings
JS functions
jQuery
DOM manipulation and traversal
Forms
Branching
Arrays
Looping


Dennou-OGCM_reflist.bib
@article{gent1990isopycnal,
title = {Isopycnal mixing in ocean circulation models},
author = {Gent, Peter R and Mcwilliams, James C},
journal = {Journal of Physical Oceanography},
volume = {20},
number = {1},
pages = {150--155},
year = {1990}
}
@article{jackett1995minimal,
title = {Minimal adjustment of hydrographic profiles to achieve
static stability},
author = {Jackett, David R and McDougall, Trevor J},
journal = {Journal of Atmospheric and Oceanic Technology},
volume = {12},
number = {2},
pages = {381--389},
year = {1995}
}
@article{marshall2007mean,
title = {Mean climate and variability of the atmosphere and ocean
on an aquaplanet},
author = {Marshall, John and Ferreira, David and Campin, JM and
Enderton, Daniel},
journal = {Journal of the Atmospheric Sciences},
volume = {64},
number = {12},
pages = {4270--4286},
year = {2007}
}
@book{vallis2006atmospheric,
title = {Atmospheric and oceanic fluid dynamics: fundamentals and
large-scale circulation},
author = {Vallis, Geoffrey K},
year = {2006},
publisher = {Cambridge University Press}
}


---
layout: post
title: Drawers surplus
date: '2013-05-21T07:10:00+02:00'
categories:
- Sketches
picture_url: https://film-Storyboards.tumblr.com/post/50984561692/until-now-this-tumblr-was-mostly-a-repository-for
---
Until now, this blog was mostly a repository for the visual work, animatic and Storyboards done for the Atoleiros Battle Interpretation Centre.
Now something completely different, testing commercial Storyboards line with Alchemy, combined with photoshop colouring.


Server will use the designated port and the three following ports
Message of the day. Shown to players when connected
Difficulty that is always used unless mission rotation states otherwise
Number of headless clients that will be launched
Additional configuration options that will be appended to the generated server.cfg config file. Avoid (re)declaring any of the options above here.


Maluleka Visits The Academy Of A Former Chiefs Star
by SL SocialTaking time out of his hectic schedule, Kaizer Chiefs midfielder George Maluleka this week visited The Football Factory, an academy owned by a former Chiefs star.
Maluleka & Co are gearing up for a tough midweek encounter against Chippa United. Before jetting out to Port Elizabeth, the midfielder paid a visit to some rising stars.
Former Amakhosi striker Stanton Lewis, along with his brother Steven, are honing the prospective talents of Mzansi, in hopes that one day they get to reach the heights of the likes of Maluleka.
Download The Soccer Laduma Social Media App & Earn Airtime for Selfies!
The duo who spent time together in the Ajax Cape Town set up took to Instagram to share details of the visit.
Dressed casually in a vest, caps and shorts the Amakhosi number 12 can be seen addressing a group of youngsters.
Check it out.
Do you think Maluleka can inspire Chiefs to victory over Chippa United on Wednesday?


--- layout: post status: publish published: true title: Predictably and Irrationally Persuasive - Slides author: display_name: Fabio Pereira login: admin email<EMAIL_ADDRESS>url: http://fabiopereira.me author_login: admin author_email<EMAIL_ADDRESS>author_url: http://fabiopereira.me wordpress_id: 337 wordpress_url: http://fabiopereira.me/blog/2010/09/26/predictably-and-irrationally-persuasive-slides/ date: '2010-09-26 22:25:14 +1000' date_gmt: '2010-09-27 05:25:14 +1000' categories: - Technical tags: - Presentation - Speaking comments: - id: 9663 author: provides access author_email<EMAIL_ADDRESS>author_url: http://www.providesaccess.com/provides-access date: '2011-01-17 21:19:16 +0' date_gmt: '2011-01-18 04:19:16 +0' content: I think it would be FABULOUS! - id: 14984 author: Fabio Pereira » Ignite Sydney 7 author_email: '' author_url: http://fabiopereira.me/blog/2011/07/28/ignite-sydney-7/ date: '2011-07-28 06:29:35 +1000' date_gmt: '2011-07-28 13:29:35 +1000' content: '[...] Predictably and Irrationally Persuasive [...]' - id: 184772 author: Ibo author_email<EMAIL_ADDRESS>author_url: http://www.facebook.com/profile.php?id=100003469641742 date: '2015-07-22 01:55:53 +1000' date_gmt: '2015-07-22 08:55:53 +1000' content: Dear Afshin,Thanks again.Dear Nargess,I had sent many posts you at past .they were nice power point files .the files were interesting for me and I deeidcd to send them for you too . I hope the files be nice for you .I will be glad if you sometimes send me programs similar to those if you have .Best Regards,Abbas. ---
At the last TW TeamHug, I did a talk on Persuasion. It’s a summary of the two books I read recently: Predictably Irrational and Yes! 50 Secrets from the science of persuasion.


| Defaults {quantmod} | R Documentation |
Use globally specified defaults, if set, in place of formally specified default argument values. Allows user to specify function defaults different than formally supplied values, e.g. to change poorly performing defaults, or satisfy a different preference.
setDefaults(name, ...) unsetDefaults(name, confirm = TRUE) getDefaults(name = NULL, arg = NULL) importDefaults(calling.fun)
name |
name of function, quoted or unquoted (see Details) |
... |
name=value default pairs |
confirm |
prompt before unsetting defaults |
arg |
values to retrieve |
calling.fun |
name of function to act upon |
Provides a wrapper to R options
that allows the user to
specify any name=value pair for a function's formal arguments.
Only formal name=value pairs specified will be updated.
Values do not have to be respecified in subsequent calls to
setDefaults
, so it is possible to add new defaults for each
function one at a time, without having to retype all previous values.
Assigning NULL
to any argument will remove the argument from
the defaults list.
name
can be an unquoted, bare symbol only at the top-level. It
must be a quoted character string if you call setDefaults
inside
a function.
Removes name=value pairs from the defaults list.
Provides access to the stored user defaults. Single arguments need not be quoted, multiple arguments must be in a character vector.
A call to importDefaults
should be placed on the first line
in the body of the function. It checks the user's environment for
globally specified default values for the called function. These
defaults can be specified by the user with a call to
setDefaults
, and will override any default formal
parameters, in effect replacing the original defaults with user
supplied values instead. Any user-specified values in the parent
function (that is, the function containing importDefaults
)
will override the values set in the global default environment.
setDefaults |
None. Used for it's side effect of setting a list of default arguments by function. |
unsetDefaults |
None. Used for it's side effect of unsetting default arguments by function. |
getDefaults |
A named list of defaults and associated values, similar to
This does not imply that the returned function names are able
to accept defaults (via |
importDefaults |
None. Used for its side-effect of loading all non- |
At present it is not possible to specify NULL
as a replacement
for a non-NULL
default, as the process interprets NULL
values as being not set, and will simply use the value specified
formally in the function. If NULL
is what is desired, it is
necessary to include this in the function call itself.
Any arguments included in the actual function call will take
precedence over setDefaults
values, as well as the standard
formal function values. This conforms to the current user
experience in R.
Like options
, default settings are not kept across
sessions. Currently, it is not possible to pass values for
... arguments, only formally specified arguments in the original
function definition.
unsetDefaults
removes the all entries from the
options
lists for the specified function. To remove single
function default values simply set the name of the argument to
NULL
in setDefaults
.
When a function implements importDefaults
, non-named
arguments may be ignored if a global default has been set
(i.e. not NULL
). If this is the case, simply name the
arguments in the calling function.
This should also work for functions retrieving formal
parameter values from options
, as it assigns a value to the
parameter in a way that looks like it was passed in the function
call. So any check on options
would presumably disregard
importDefaults
values if an argument was passed to the
function.
Jeffrey A. Ryan
my.fun <- function(x=3) { importDefaults('my.fun') x^2 } my.fun() # returns 9 setDefaults(my.fun, x=10) my.fun() # returns 100 my.fun(x=4) # returns 16 getDefaults(my.fun) formals(my.fun) unsetDefaults(my.fun, confirm=FALSE) getDefaults(my.fun) my.fun() # returns 9


{% include modals/canary.html %}
{% include modals/chef.html %}
{% include modals/envoy.html %}
{% include modals/jumpgate.html %}
{% include modals/metis.html %}
{% include modals/opus.html %}
{% include modals/osiris.html %}
{% include modals/silhouette.html %}
{% include modals/simone.html %}