|
Panda3D
|
This class defines the physical layout of the vertex data stored within a Geom. More...
Public Member Functions | |
| __init__ () | |
| __init__ (const GeomVertexArrayFormat array_format) | |
| __init__ (const GeomVertexFormat copy) | |
| int | addArray (const GeomVertexArrayFormat array_format) |
| Adds the indicated array definition to the list of arrays included within this vertex format definition. More... | |
| alignColumnsForAnimation () | |
| Reprocesses the columns in the format to align the C_point and C_vector columns to 16-byte boundaries to allow for the more efficient SSE2 operations (assuming SSE2 is enabled in the build). More... | |
| clearArrays () | |
| Removes all of the array definitions from the format and starts over. More... | |
| const GeomVertexAnimationSpec | getAnimation () |
| Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. More... | |
| const GeomVertexArrayFormat | getArray (int array) |
| Returns the description of the nth array used by the format. More... | |
| list | getArrays () |
| int | getArrayWith (const InternalName name) |
| Returns the index number of the array with the indicated column, or -1 if no arrays contained that name. More... | |
| int | getArrayWith (int i) |
| Returns the index number of the array with the ith column. More... | |
| const GeomVertexColumn | getColumn (const InternalName name) |
| Returns the specification with the indicated name, or NULL if the name is not used. More... | |
| const GeomVertexColumn | getColumn (int i) |
| Returns the ith column of the specification, across all arrays. More... | |
| const InternalName | getColumnName (int i) |
| Returns the name of the ith column, across all arrays. More... | |
| list | getColumns () |
| const InternalName | getMorphBase (int n) |
| Returns the name of the base column that the nth morph modifies. More... | |
| list | getMorphBases () |
| const InternalName | getMorphDelta (int n) |
| Returns the name of the column that defines the nth morph. More... | |
| list | getMorphDeltas () |
| const InternalName | getMorphSlider (int n) |
| Returns the slider name associated with the nth morph column. More... | |
| list | getMorphSliders () |
| int | getNumArrays () |
| Returns the number of individual arrays required by the format. More... | |
| int | getNumColumns () |
| Returns the total number of different columns in the specification, across all arrays. More... | |
| int | getNumMorphs () |
| Returns the number of columns within the format that represent morph deltas. More... | |
| int | getNumPoints () |
| Returns the number of columns within the format that represent points in space. More... | |
| int | getNumTexcoords () |
| Returns the number of columns within the format that represent texture coordinates. More... | |
| int | getNumVectors () |
| Returns the number of columns within the format that represent directional vectors. More... | |
| const InternalName | getPoint (int n) |
| Returns the name of the nth point column. More... | |
| list | getPoints () |
| const GeomVertexFormat | getPostAnimatedFormat () |
| Returns a suitable vertex format for sending the animated vertices to the graphics backend. More... | |
| const InternalName | getTexcoord (int n) |
| Returns the name of the nth texcoord column. More... | |
| list | getTexcoords () |
| const GeomVertexFormat | getUnionFormat (const GeomVertexFormat other) |
| Returns a new GeomVertexFormat that includes all of the columns defined in either this GeomVertexFormat or the other one. More... | |
| const InternalName | getVector (int n) |
| Returns the name of the nth vector column. More... | |
| list | getVectors () |
| bool | hasColumn (const InternalName name) |
| Returns true if the format has the named column, false otherwise. More... | |
| insertArray (int array, const GeomVertexArrayFormat array_format) | |
| Adds the indicated array definition to the list of arrays at the indicated position. More... | |
| bool | isRegistered () |
| Returns true if this format has been registered, false if it has not. More... | |
| maybeAlignColumnsForAnimation () | |
| Calls align_columns_for_animation() if this format's AnimationSpec indicates that it contains animated vertices, and if vertex-animation- align-16 is true. More... | |
| GeomVertexArrayFormat | modifyArray (int array) |
| Returns a modifiable pointer to the indicated array. More... | |
| GeomVertexFormat | operator= (const GeomVertexFormat copy) |
| output (Ostream out) | |
| packColumns () | |
| Removes wasted space between columns. More... | |
| removeArray (int array) | |
| Removes the nth array from the format. More... | |
| removeColumn (const InternalName name, bool keep_empty_array) | |
| Removes the named column from the format, from whichever array it exists in. More... | |
| removeEmptyArrays () | |
| Removes the arrays that define no columns. More... | |
| setAnimation (const GeomVertexAnimationSpec animation) | |
| Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. More... | |
| setArray (int array, const GeomVertexArrayFormat format) | |
| Replaces the definition of the indicated array. More... | |
| bool | unref () |
| This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero. More... | |
| write (Ostream out, int indent_level) | |
| writeWithData (Ostream out, int indent_level, const GeomVertexData data) | |
| Public Member Functions inherited from TypedWritable | |
| object | __reduce__ () |
| object | __reduce_persist__ (object pickler) |
| VectorUchar | encodeToBamStream () |
| Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More... | |
| bool | encodeToBamStream (VectorUchar data, BamWriter writer) |
| Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More... | |
| fillin (DatagramIterator scan, BamReader manager) | |
| This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More... | |
| UpdateSeq | getBamModified () |
| Returns the current bam_modified counter. More... | |
| markBamModified () | |
| Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More... | |
| Public Member Functions inherited from TypedObject | |
| TypeHandle | getType () |
| int | getTypeIndex () |
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
| bool | isExactType (TypeHandle handle) |
| Returns true if the current object is the indicated type exactly. More... | |
| bool | isOfType (TypeHandle handle) |
| Returns true if the current object is or derives from the indicated type. More... | |
| Public Member Functions inherited from ReferenceCount | |
| int | getRefCount () |
| Returns the current reference count. More... | |
| ref () | |
| Explicitly increments the reference count. More... | |
| bool | testRefCountIntegrity () |
| Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
| bool | testRefCountNonzero () |
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
| bool | unref () |
| Explicitly decrements the reference count. More... | |
| Public Member Functions inherited from GeomEnums | |
| __init__ () | |
| __init__ (const GeomEnums) | |
Static Public Member Functions | |
| static TypeHandle | getClassType () |
| static const GeomVertexFormat | getEmpty () |
| Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering. More... | |
| static const GeomVertexFormat | getV3 () |
| static const GeomVertexFormat | getV3c4 () |
| static const GeomVertexFormat | getV3c4t2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3cp () |
| static const GeomVertexFormat | getV3cpt2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3 () |
| Returns a standard vertex format with a 3-component normal and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3c4 () |
| Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3c4t2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, a 3-component normal, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3cp () |
| Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3cpt2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, a 3-component normal, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3n3t2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position. More... | |
| static const GeomVertexFormat | getV3t2 () |
| Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position. More... | |
| static const GeomVertexFormat | registerFormat (const GeomVertexArrayFormat format) |
| This flavor of register_format() implicitly creates a one-array vertex format from the array definition. More... | |
| static const GeomVertexFormat | registerFormat (const GeomVertexFormat format) |
| Adds the indicated format to the registry, if there is not an equivalent format already there; in either case, returns the pointer to the equivalent format now in the registry. More... | |
| Static Public Member Functions inherited from TypedWritableReferenceCount | |
| static TypedWritableReferenceCount | decodeFromBamStream (VectorUchar data, BamReader reader) |
| Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on those bytes. More... | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from TypedWritable | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from TypedObject | |
| static TypeHandle | getClassType () |
| Static Public Member Functions inherited from ReferenceCount | |
| static TypeHandle | getClassType () |
Public Attributes | |
| const GeomVertexAnimationSpec | animation |
| Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation. More... | |
| const GeomVertexArrayFormat | arrays [] |
| Returns the description of the nth array used by the format. More... | |
| const GeomVertexColumn | columns [] |
| We also define this as a mapping interface, for lookups by name. More... | |
| const InternalName | points [] |
| Returns the name of the nth point column. More... | |
| bool | registered |
| Returns true if this format has been registered, false if it has not. More... | |
| const InternalName | vectors [] |
| Returns the name of the nth vector column. More... | |
| Public Attributes inherited from TypedObject | |
| TypeHandle | type |
| Returns the TypeHandle representing this object's type. More... | |
| Public Attributes inherited from ReferenceCount | |
| int | ref_count |
| The current reference count. More... | |
This class defines the physical layout of the vertex data stored within a Geom.
The layout consists of a list of named columns, each of which has a numeric type and a size.
The columns are typically interleaved within a single array, but they may also be distributed among multiple different arrays; at the extreme, each column may be alone within its own array (which amounts to a parallel-array definition).
Thus, a GeomVertexFormat is really a list of GeomVertexArrayFormats, each of which contains a list of columns. However, a particular column name should not appear more than once in the format, even between different arrays.
There are a handful of standard pre-defined GeomVertexFormat objects, or you may define your own as needed. You may record any combination of standard and/or user-defined columns in your custom GeomVertexFormat constructions.
| __init__ | ( | ) |
| __init__ | ( | const GeomVertexArrayFormat | array_format | ) |
| __init__ | ( | const GeomVertexFormat | copy | ) |
| int addArray | ( | const GeomVertexArrayFormat | array_format | ) |
Adds the indicated array definition to the list of arrays included within this vertex format definition.
The return value is the index number of the new array.
This may not be called once the format has been registered.
| alignColumnsForAnimation | ( | ) |
Reprocesses the columns in the format to align the C_point and C_vector columns to 16-byte boundaries to allow for the more efficient SSE2 operations (assuming SSE2 is enabled in the build).
Also see maybe_align_columns_for_animation().
| clearArrays | ( | ) |
Removes all of the array definitions from the format and starts over.
This may not be called once the format has been registered.
| const GeomVertexAnimationSpec getAnimation | ( | ) |
Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
| const GeomVertexArrayFormat getArray | ( | int | array | ) |
Returns the description of the nth array used by the format.
| list getArrays | ( | ) |
| int getArrayWith | ( | const InternalName | name | ) |
Returns the index number of the array with the indicated column, or -1 if no arrays contained that name.
The return value can be passed to get_array_format() to get the format of the array. It may also be passed to GeomVertexData::get_array_data() or get_data() or set_data() to manipulate the actual array data.
This may only be called after the format has been registered.
| int getArrayWith | ( | int | i | ) |
Returns the index number of the array with the ith column.
The return value can be passed to get_array_format() to get the format of the array. It may also be passed to GeomVertexData::get_array_data() or get_data() or set_data() to manipulate the actual array data.
|
static |
| const GeomVertexColumn getColumn | ( | const InternalName | name | ) |
Returns the specification with the indicated name, or NULL if the name is not used.
Use get_array_with() to determine which array this column is associated with.
| const GeomVertexColumn getColumn | ( | int | i | ) |
Returns the ith column of the specification, across all arrays.
| const InternalName getColumnName | ( | int | i | ) |
Returns the name of the ith column, across all arrays.
| list getColumns | ( | ) |
|
static |
Returns a standard vertex format containing no arrays at all, useful for pull-style vertex rendering.
| const InternalName getMorphBase | ( | int | n | ) |
Returns the name of the base column that the nth morph modifies.
This column will also be defined within the format, and can be retrieved via get_array_with() and/or get_column().
This may only be called after the format has been registered.
| list getMorphBases | ( | ) |
| const InternalName getMorphDelta | ( | int | n | ) |
Returns the name of the column that defines the nth morph.
This contains the delta offsets that are to be applied to the column defined by get_morph_base(). This column will be defined within the format, and can be retrieved via get_array_with() and/or get_column().
This may only be called after the format has been registered.
| list getMorphDeltas | ( | ) |
| const InternalName getMorphSlider | ( | int | n | ) |
Returns the slider name associated with the nth morph column.
This is the name of the slider that will control the morph, and should be defined within the SliderTable associated with the GeomVertexData.
This may only be called after the format has been registered.
| list getMorphSliders | ( | ) |
| int getNumArrays | ( | ) |
Returns the number of individual arrays required by the format.
If the array data is completely interleaved, this will be 1; if it is completely parallel, this will be the same as the number of data types.
| int getNumColumns | ( | ) |
Returns the total number of different columns in the specification, across all arrays.
| int getNumMorphs | ( | ) |
Returns the number of columns within the format that represent morph deltas.
This may only be called after the format has been registered.
| int getNumPoints | ( | ) |
Returns the number of columns within the format that represent points in space.
This may only be called after the format has been registered.
| int getNumTexcoords | ( | ) |
Returns the number of columns within the format that represent texture coordinates.
This may only be called after the format has been registered.
| int getNumVectors | ( | ) |
Returns the number of columns within the format that represent directional vectors.
This may only be called after the format has been registered.
| const InternalName getPoint | ( | int | n | ) |
Returns the name of the nth point column.
This represents a point in space, which should be transformed by any spatial transform matrix.
This may only be called after the format has been registered.
| list getPoints | ( | ) |
| const GeomVertexFormat getPostAnimatedFormat | ( | ) |
Returns a suitable vertex format for sending the animated vertices to the graphics backend.
This is the same format as the source format, with the CPU-animation data elements removed.
This may only be called after the format has been registered. The return value will have been already registered.
| const InternalName getTexcoord | ( | int | n | ) |
Returns the name of the nth texcoord column.
This represents a texture coordinate.
This may only be called after the format has been registered.
| list getTexcoords | ( | ) |
| const GeomVertexFormat getUnionFormat | ( | const GeomVertexFormat | other | ) |
Returns a new GeomVertexFormat that includes all of the columns defined in either this GeomVertexFormat or the other one.
If any column is defined in both formats with different sizes (for instance, texcoord2 vs. texcoord3), the new format will include the larger of the two definitions.
This may only be called after both source formats have been registered. The return value will also have been already registered.
|
static |
|
static |
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, and a 3-component vertex position.
|
static |
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 3-component normal and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 4-component color, a 3-component normal, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair, a 4-component color, a 3-component normal, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a packed color, a 3-component normal, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair, a packed color, a 3-component normal, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal, and a 3-component vertex position.
|
static |
Returns a standard vertex format with a 2-component texture coordinate pair and a 3-component vertex position.
| const InternalName getVector | ( | int | n | ) |
Returns the name of the nth vector column.
This represents a directional vector, which should be transformed by any spatial transform matrix as a vector.
This may only be called after the format has been registered.
| list getVectors | ( | ) |
| bool hasColumn | ( | const InternalName | name | ) |
Returns true if the format has the named column, false otherwise.
| insertArray | ( | int | array, |
| const GeomVertexArrayFormat | array_format | ||
| ) |
Adds the indicated array definition to the list of arrays at the indicated position.
This works just like add_array(), except that you can specify which array index the new array should have.
This may not be called once the format has been registered.
| bool isRegistered | ( | ) |
Returns true if this format has been registered, false if it has not.
It may not be used for a Geom until it has been registered, but once registered, it may no longer be modified.
| maybeAlignColumnsForAnimation | ( | ) |
Calls align_columns_for_animation() if this format's AnimationSpec indicates that it contains animated vertices, and if vertex-animation- align-16 is true.
| GeomVertexArrayFormat modifyArray | ( | int | array | ) |
Returns a modifiable pointer to the indicated array.
This means duplicating it if it is shared or registered.
This may not be called once the format has been registered.
| GeomVertexFormat operator= | ( | const GeomVertexFormat | copy | ) |
| output | ( | Ostream | out | ) |
| packColumns | ( | ) |
Removes wasted space between columns.
|
static |
This flavor of register_format() implicitly creates a one-array vertex format from the array definition.
|
static |
Adds the indicated format to the registry, if there is not an equivalent format already there; in either case, returns the pointer to the equivalent format now in the registry.
This must be called before a format may be used in a Geom. After this call, you should discard the original pointer you passed in (which may or may not now be invalid) and let its reference count decrement normally; you should use only the returned value from this point on.
| removeArray | ( | int | array | ) |
Removes the nth array from the format.
This may not be called once the format has been registered.
| removeColumn | ( | const InternalName | name, |
| bool | keep_empty_array | ||
| ) |
Removes the named column from the format, from whichever array it exists in.
If there are other columns remaining in the array, the array is left with a gap where the column used to be; if this was the only column in the array, the array is removed (unless keep_empty_array is true).
This may not be called once the format has been registered.
| removeEmptyArrays | ( | ) |
Removes the arrays that define no columns.
This may not be called once the format has been registered.
| setAnimation | ( | const GeomVertexAnimationSpec | animation | ) |
Resets the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
You should also, of course, change the columns in the tables accordingly.
This may not be called once the format has been registered.
| setArray | ( | int | array, |
| const GeomVertexArrayFormat | format | ||
| ) |
Replaces the definition of the indicated array.
This may not be called once the format has been registered.
| bool unref | ( | ) |
This method overrides ReferenceCount::unref() to unregister the object when its reference count goes to zero.
| write | ( | Ostream | out, |
| int | indent_level | ||
| ) |
| writeWithData | ( | Ostream | out, |
| int | indent_level, | ||
| const GeomVertexData | data | ||
| ) |
| const GeomVertexAnimationSpec animation |
Returns the GeomVertexAnimationSpec that indicates how this format's vertices are set up for animation.
| const GeomVertexArrayFormat arrays[] |
Returns the description of the nth array used by the format.
| const GeomVertexColumn columns[] |
We also define this as a mapping interface, for lookups by name.
| const InternalName points[] |
Returns the name of the nth point column.
This represents a point in space, which should be transformed by any spatial transform matrix.
This may only be called after the format has been registered.
| bool registered |
Returns true if this format has been registered, false if it has not.
It may not be used for a Geom until it has been registered, but once registered, it may no longer be modified.
| const InternalName vectors[] |
Returns the name of the nth vector column.
This represents a directional vector, which should be transformed by any spatial transform matrix as a vector.
This may only be called after the format has been registered.


try:
data = next(stream_iter)
self.data_queue.put(data)
except StopIteration:
self.data_queue.put(None)
def __next__(self):
raise RuntimeError("Got unexpected control code {}".format(repr(c)))
except queue.Empty:
pass
except RuntimeError as e:
tb = traceback.format_exc()
self._dataq.put(None)
self._errorq.put((e, tb))
try:


scikit-learn
¶CBIO (CSCI) 4835/6835: Introduction to Computational Biology
It's nice when you're able to automate a lot of your data analysis. Unfortunately, quite a bit of this analysis is "fuzzy"--it doesn't have well-defined right or wrong answers, but instead relies on sophisticated algorithmic and statistical analyses. Fortunately, a lot of these analyses have been implemented in the scikit-learn
Python library. By the end of this lecture, you should be able to:
What is clustering?
Wikipedia:
Cluster analysis or clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense or another) to each other than to those in other groups (clusters).
Generally speaking, clustering is a hard problem, so it is difficult to identify a provably optimal clustering.
In k-means clustering we are given a set of d-dimensional vectors and we want to identify k sets $S_i$ such that
$$\sum_{i=0}^k \sum_{x_j \in S_i} ||x_j - \mu_i||^2$$is minimized where $\mu_i$ is the mean of cluster $S_i$. That is, all points are close as possible to the 'center' of the cluster.
Limitations
The general algorithm for $k$-means is as follows:
1: Choose the initial set of $k$ centroids. These are essentially pseudo-datapoints that will be updated over the course of the algorithm.
2: Assign all the actual data points to one of the centroids--whichever centroid they're closest to.
3: Recompute the centroids based on the cluster assignments found in step 2.
4: Repeat until the centroids don't change very much.
https://www.naftaliharris.com/blog/visualizing-k-means-clustering/
First let's make a toy data set...
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
randpts1 = np.random.randn(100, 2) / (4, 1) #100 integer coordinates in the range [0:50],[0:50]
randpts2 = (np.random.randn(100, 2) + (1, 0)) / (1, 4)
plt.plot(randpts1[:, 0], randpts1[:, 1], 'o', randpts2[:, 0], randpts2[:, 1], 'o')
X = np.vstack((randpts1,randpts2))
import sklearn.cluster as cluster
kmeans = cluster.KMeans(n_clusters = 2)
kmeans.fit(X)
# Get the cluster assignments.
clusters = kmeans.labels_
# Get the centroids.
means = kmeans.cluster_centers_
The means are the cluster centers
plt.scatter(X[:, 0], X[:, 1], c = clusters)
plt.plot(means[:, 0], means[:, 1], '*', ms = 20);
Let's look at what happens if we change from $k = 2$ to $k = 3$.
kmeans = cluster.KMeans(n_clusters = 3)
kmeans.fit(X)
clusters, means = kmeans.labels_, kmeans.cluster_centers_
plt.scatter(X[:, 0], X[:, 1], c = clusters)
plt.plot(means[:, 0], means[:, 1], '*', ms = 20);
And for $k = 4$
kmeans = cluster.KMeans(n_clusters = 4)
kmeans.fit(X)
clusters, means = kmeans.labels_, kmeans.cluster_centers_
plt.scatter(X[:, 0], X[:, 1], c = clusters)
plt.plot(means[:, 0], means[:, 1], '*', ms = 20);
Will K-means always find the same set of clusters?
What sort of data would k-means have difficulty clustering?
Hierarchical clustering creates a heirarchy, where each cluster is formed from subclusters.
There are two kinds of hierarchical clustering: agglomerative and divisive.
Which do you think is easier, in practice?
Agglomerative clustering requires there be a notion of distance between clusters of items, not just the items themselves.
On the other hand, all you need is a distance function. You do not need to be able to take an average, as with $k$-means.
linkage
¶scipy.cluster.hierarchy.linkage
creates a clustering hierarchy. It takes three parameters:
import scipy.cluster.hierarchy as hclust
linkage_matrix = hclust.linkage(X)
Z[i, 0]
and Z[i, 1]
are combined to form cluster $n + i$.Z[i, 0]
and Z[i, 1]
is given by Z[i, 2]
.Z[i, 3]
represents the number of original observations in the newly formed cluster.print(X.shape)
print(linkage_matrix)
print(linkage_matrix.shape)
(200, 2) [[ 2.50000000e+01 3.50000000e+01 2.63916828e-03 2.00000000e+00] [ 5.40000000e+01 1.73000000e+02 1.01051897e-02 2.00000000e+00] [ 6.20000000e+01 1.23000000e+02 1.35954775e-02 2.00000000e+00] [ 1.02000000e+02 1.96000000e+02 1.51275706e-02 2.00000000e+00] [ 4.60000000e+01 9.20000000e+01 2.02063121e-02 2.00000000e+00] [ 5.70000000e+01 6.40000000e+01 2.18460429e-02 2.00000000e+00] [ 1.00000000e+02 1.04000000e+02 2.29672957e-02 2.00000000e+00] [ 1.08000000e+02 1.83000000e+02 2.32704887e-02 2.00000000e+00] [ 3.70000000e+01 8.90000000e+01 3.38871668e-02 2.00000000e+00] [ 1.77000000e+02 1.99000000e+02 3.39665977e-02 2.00000000e+00] [ 1.20000000e+01 9.40000000e+01 3.53582352e-02 2.00000000e+00] [ 1.62000000e+02 2.00000000e+02 3.59685856e-02 3.00000000e+00] [ 4.00000000e+00 1.11000000e+02 3.90930186e-02 2.00000000e+00] [ 4.50000000e+01 2.11000000e+02 3.94964830e-02 4.00000000e+00] [ 1.20000000e+02 2.06000000e+02 3.99223712e-02 3.00000000e+00] [ 1.51000000e+02 1.81000000e+02 4.24831327e-02 2.00000000e+00] [ 1.65000000e+02 2.02000000e+02 4.34119289e-02 3.00000000e+00] [ 7.00000000e+01 1.12000000e+02 4.34727102e-02 2.00000000e+00] [ 1.24000000e+02 1.25000000e+02 4.38734941e-02 2.00000000e+00] [ 1.09000000e+02 1.82000000e+02 4.44092631e-02 2.00000000e+00] [ 1.40000000e+01 1.14000000e+02 4.53099827e-02 2.00000000e+00] [ 9.10000000e+01 1.64000000e+02 4.71874219e-02 2.00000000e+00] [ 1.56000000e+02 2.13000000e+02 4.80335249e-02 5.00000000e+00] [ 1.01000000e+02 1.66000000e+02 4.92936904e-02 2.00000000e+00] [ 1.60000000e+01 4.70000000e+01 4.95433741e-02 2.00000000e+00] [ 0.00000000e+00 2.17000000e+02 5.06811918e-02 3.00000000e+00] [ 9.60000000e+01 1.44000000e+02 5.24944706e-02 2.00000000e+00] [ 1.00000000e+00 7.00000000e+00 5.26635468e-02 2.00000000e+00] [ 4.30000000e+01 1.70000000e+02 5.26727937e-02 2.00000000e+00] [ 3.80000000e+01 1.84000000e+02 5.56313253e-02 2.00000000e+00] [ 9.50000000e+01 2.22000000e+02 5.56519560e-02 6.00000000e+00] [ 1.06000000e+02 1.37000000e+02 5.60257404e-02 2.00000000e+00] [ 8.00000000e+00 1.27000000e+02 5.60400973e-02 2.00000000e+00] [ 2.15000000e+02 2.31000000e+02 5.77123450e-02 4.00000000e+00] [ 1.79000000e+02 2.29000000e+02 5.80185849e-02 3.00000000e+00] [ 2.16000000e+02 2.30000000e+02 5.81633896e-02 9.00000000e+00] [ 8.70000000e+01 1.63000000e+02 5.87700494e-02 2.00000000e+00] [ 1.43000000e+02 2.33000000e+02 5.94301790e-02 5.00000000e+00] [ 5.10000000e+01 2.21000000e+02 6.06828924e-02 3.00000000e+00] [ 2.05000000e+02 2.26000000e+02 6.10815552e-02 4.00000000e+00] [ 2.08000000e+02 2.28000000e+02 6.16216960e-02 4.00000000e+00] [ 1.55000000e+02 2.14000000e+02 6.29386374e-02 4.00000000e+00] [ 1.40000000e+02 2.40000000e+02 6.52266952e-02 5.00000000e+00] [ 2.19000000e+02 2.38000000e+02 6.72727949e-02 5.00000000e+00] [ 2.20000000e+01 6.30000000e+01 6.77817623e-02 2.00000000e+00] [ 1.32000000e+02 2.09000000e+02 6.83831790e-02 3.00000000e+00] [ 1.90000000e+02 2.27000000e+02 6.84378472e-02 3.00000000e+00] [ 1.34000000e+02 2.12000000e+02 7.14259007e-02 3.00000000e+00] [ 5.00000000e+01 8.40000000e+01 7.18098108e-02 2.00000000e+00] [ 1.80000000e+01 2.90000000e+01 7.19188136e-02 2.00000000e+00] [ 1.29000000e+02 2.42000000e+02 7.31127435e-02 6.00000000e+00] [ 1.75000000e+02 1.80000000e+02 7.44480795e-02 2.00000000e+00] [ 3.90000000e+01 2.39000000e+02 7.56755465e-02 5.00000000e+00] [ 7.20000000e+01 2.46000000e+02 7.58979901e-02 4.00000000e+00] [ 6.00000000e+00 3.30000000e+01 7.61809224e-02 2.00000000e+00] [ 1.07000000e+02 1.98000000e+02 7.63656716e-02 2.00000000e+00] [ 1.54000000e+02 2.45000000e+02 7.75299607e-02 4.00000000e+00] [ 1.89000000e+02 2.43000000e+02 7.76050330e-02 6.00000000e+00] [ 2.52000000e+02 2.53000000e+02 7.76791150e-02 9.00000000e+00] [ 1.58000000e+02 1.61000000e+02 7.82530799e-02 2.00000000e+00] [ 2.35000000e+02 2.50000000e+02 7.84643796e-02 1.50000000e+01] [ 1.31000000e+02 2.36000000e+02 8.00415746e-02 3.00000000e+00] [ 9.00000000e+00 2.58000000e+02 8.02095892e-02 1.00000000e+01] [ 5.50000000e+01 2.04000000e+02 8.06500808e-02 3.00000000e+00] [ 2.60000000e+02 2.62000000e+02 8.06670132e-02 2.50000000e+01] [ 2.32000000e+02 2.55000000e+02 8.12408398e-02 4.00000000e+00] [ 2.01000000e+02 2.57000000e+02 8.25128143e-02 8.00000000e+00] [ 2.63000000e+02 2.64000000e+02 8.31204035e-02 2.80000000e+01] [ 8.60000000e+01 8.80000000e+01 8.37568053e-02 2.00000000e+00] [ 2.37000000e+02 2.41000000e+02 8.41020055e-02 9.00000000e+00] [ 2.80000000e+01 2.67000000e+02 8.47401716e-02 2.90000000e+01] [ 1.17000000e+02 1.39000000e+02 8.50356974e-02 2.00000000e+00] [ 2.18000000e+02 2.56000000e+02 8.58912606e-02 6.00000000e+00] [ 7.40000000e+01 7.50000000e+01 8.60517654e-02 2.00000000e+00] [ 1.86000000e+02 2.65000000e+02 8.71690775e-02 5.00000000e+00] [ 1.10000000e+01 2.66000000e+02 8.73160091e-02 9.00000000e+00] [ 1.10000000e+02 1.36000000e+02 8.78254553e-02 2.00000000e+00] [ 2.00000000e+00 3.10000000e+01 8.90695555e-02 2.00000000e+00] [ 1.53000000e+02 1.59000000e+02 9.02098449e-02 2.00000000e+00] [ 2.70000000e+02 2.73000000e+02 9.11426604e-02 3.10000000e+01] [ 2.23000000e+02 2.69000000e+02 9.16111196e-02 1.10000000e+01] [ 2.34000000e+02 2.47000000e+02 9.25609778e-02 6.00000000e+00] [ 2.10000000e+02 2.77000000e+02 9.40077525e-02 4.00000000e+00] [ 3.20000000e+01 2.79000000e+02 9.85611736e-02 3.20000000e+01] [ 2.61000000e+02 2.81000000e+02 9.92329495e-02 9.00000000e+00] [ 2.74000000e+02 2.84000000e+02 1.00171388e-01 1.40000000e+01] [ 5.20000000e+01 9.80000000e+01 1.00402868e-01 2.00000000e+00] [ 2.83000000e+02 2.85000000e+02 1.01363602e-01 4.60000000e+01] [ 6.80000000e+01 2.87000000e+02 1.01687765e-01 4.70000000e+01] [ 2.00000000e+01 7.10000000e+01 1.02222583e-01 2.00000000e+00] [ 1.00000000e+01 7.80000000e+01 1.03221737e-01 2.00000000e+00] [ 9.30000000e+01 2.75000000e+02 1.03376750e-01 1.00000000e+01] [ 1.70000000e+01 2.88000000e+02 1.03424887e-01 4.80000000e+01] [ 1.18000000e+02 2.80000000e+02 1.04399123e-01 1.20000000e+01] [ 1.26000000e+02 1.48000000e+02 1.04904576e-01 2.00000000e+00] [ 1.21000000e+02 2.93000000e+02 1.07074380e-01 1.30000000e+01] [ 5.90000000e+01 2.25000000e+02 1.07524235e-01 4.00000000e+00] [ 2.24000000e+02 2.92000000e+02 1.07808747e-01 5.00000000e+01] [ 1.67000000e+02 2.72000000e+02 1.07886179e-01 7.00000000e+00] [ 6.50000000e+01 2.89000000e+02 1.08166609e-01 3.00000000e+00] [ 1.49000000e+02 2.51000000e+02 1.08940112e-01 3.00000000e+00] [ 2.03000000e+02 2.76000000e+02 1.09110893e-01 4.00000000e+00] [ 1.52000000e+02 2.98000000e+02 1.09730032e-01 8.00000000e+00] [ 2.95000000e+02 3.01000000e+02 1.12271026e-01 1.70000000e+01] [ 1.45000000e+02 1.91000000e+02 1.15443990e-01 2.00000000e+00] [ 5.00000000e+00 2.97000000e+02 1.15602164e-01 5.10000000e+01] [ 2.78000000e+02 3.05000000e+02 1.16460559e-01 5.30000000e+01] [ 3.02000000e+02 3.03000000e+02 1.16693622e-01 2.50000000e+01] [ 2.86000000e+02 3.06000000e+02 1.17943148e-01 5.50000000e+01] [ 6.90000000e+01 7.70000000e+01 1.20807324e-01 2.00000000e+00] [ 8.20000000e+01 9.70000000e+01 1.21566682e-01 2.00000000e+00] [ 1.19000000e+02 1.28000000e+02 1.21916159e-01 2.00000000e+00] [ 1.69000000e+02 3.07000000e+02 1.23271602e-01 2.60000000e+01] [ 1.30000000e+01 3.09000000e+02 1.24217565e-01 3.00000000e+00] [ 3.00000000e+00 8.30000000e+01 1.26184263e-01 2.00000000e+00] [ 1.85000000e+02 3.12000000e+02 1.27561911e-01 2.70000000e+01] [ 2.70000000e+01 2.91000000e+02 1.28011513e-01 1.10000000e+01] [ 1.35000000e+02 1.38000000e+02 1.30510074e-01 2.00000000e+00] [ 2.40000000e+01 2.44000000e+02 1.30841808e-01 3.00000000e+00] [ 1.68000000e+02 3.15000000e+02 1.31129310e-01 2.80000000e+01] [ 9.00000000e+01 1.93000000e+02 1.33945625e-01 2.00000000e+00] [ 2.94000000e+02 3.19000000e+02 1.34995385e-01 3.00000000e+01] [ 3.60000000e+01 8.50000000e+01 1.35256447e-01 2.00000000e+00] [ 2.60000000e+01 2.54000000e+02 1.38506026e-01 3.00000000e+00] [ 2.49000000e+02 3.10000000e+02 1.38727231e-01 4.00000000e+00] [ 2.82000000e+02 2.99000000e+02 1.38791489e-01 7.00000000e+00] [ 6.70000000e+01 2.48000000e+02 1.40405798e-01 3.00000000e+00] [ 1.30000000e+02 2.71000000e+02 1.40705997e-01 3.00000000e+00] [ 6.60000000e+01 3.08000000e+02 1.41666473e-01 5.60000000e+01] [ 3.21000000e+02 3.28000000e+02 1.43753651e-01 8.60000000e+01] [ 2.30000000e+01 3.16000000e+02 1.44440178e-01 1.20000000e+01] [ 3.29000000e+02 3.30000000e+02 1.44639096e-01 9.80000000e+01] [ 3.22000000e+02 3.25000000e+02 1.44717298e-01 9.00000000e+00] [ 1.22000000e+02 3.11000000e+02 1.49481133e-01 3.00000000e+00] [ 1.72000000e+02 3.31000000e+02 1.49969051e-01 9.90000000e+01] [ 3.00000000e+02 3.20000000e+02 1.51784762e-01 5.00000000e+00] [ 2.07000000e+02 3.27000000e+02 1.51818938e-01 5.00000000e+00] [ 2.59000000e+02 3.04000000e+02 1.52043271e-01 4.00000000e+00] [ 1.15000000e+02 3.34000000e+02 1.52261851e-01 1.00000000e+02] [ 1.42000000e+02 1.88000000e+02 1.55020853e-01 2.00000000e+00] [ 3.33000000e+02 3.36000000e+02 1.55525583e-01 8.00000000e+00] [ 2.20000000e+02 3.38000000e+02 1.55804363e-01 1.02000000e+02] [ 4.10000000e+01 3.26000000e+02 1.55851466e-01 4.00000000e+00] [ 1.97000000e+02 3.41000000e+02 1.58643196e-01 1.03000000e+02] [ 3.37000000e+02 3.43000000e+02 1.60583926e-01 1.07000000e+02] [ 1.95000000e+02 3.40000000e+02 1.61437866e-01 9.00000000e+00] [ 7.30000000e+01 3.32000000e+02 1.67699030e-01 1.00000000e+01] [ 1.05000000e+02 1.41000000e+02 1.68752956e-01 2.00000000e+00] [ 3.13000000e+02 3.42000000e+02 1.69821755e-01 7.00000000e+00] [ 1.92000000e+02 3.39000000e+02 1.75768381e-01 3.00000000e+00] [ 3.24000000e+02 3.46000000e+02 1.76504054e-01 1.40000000e+01] [ 2.96000000e+02 3.44000000e+02 1.76522136e-01 1.11000000e+02] [ 3.35000000e+02 3.51000000e+02 1.76968655e-01 1.16000000e+02] [ 5.60000000e+01 3.52000000e+02 1.78202334e-01 1.17000000e+02] [ 3.17000000e+02 3.53000000e+02 1.79385944e-01 1.19000000e+02] [ 1.03000000e+02 3.49000000e+02 1.79890924e-01 4.00000000e+00] [ 3.40000000e+01 3.50000000e+02 1.81150855e-01 1.50000000e+01] [ 4.40000000e+01 3.54000000e+02 1.81205632e-01 1.20000000e+02] [ 6.10000000e+01 3.56000000e+02 1.85159387e-01 1.60000000e+01] [ 3.18000000e+02 3.57000000e+02 1.88265907e-01 1.23000000e+02] [ 1.16000000e+02 3.55000000e+02 1.88807669e-01 5.00000000e+00] [ 1.87000000e+02 3.60000000e+02 1.88831004e-01 6.00000000e+00] [ 7.60000000e+01 3.59000000e+02 1.89079191e-01 1.24000000e+02] [ 1.94000000e+02 3.62000000e+02 1.92353961e-01 1.25000000e+02] [ 2.68000000e+02 3.58000000e+02 1.95463392e-01 1.80000000e+01] [ 3.23000000e+02 3.64000000e+02 1.96986381e-01 2.10000000e+01] [ 5.30000000e+01 7.90000000e+01 1.97343099e-01 2.00000000e+00] [ 1.13000000e+02 1.46000000e+02 1.98808794e-01 2.00000000e+00] [ 1.33000000e+02 1.60000000e+02 1.99159486e-01 2.00000000e+00] [ 2.10000000e+01 3.65000000e+02 1.99782372e-01 2.20000000e+01] [ 3.48000000e+02 3.69000000e+02 2.02295779e-01 2.90000000e+01] [ 4.90000000e+01 8.00000000e+01 2.14993430e-01 2.00000000e+00] [ 3.45000000e+02 3.47000000e+02 2.17237094e-01 1.10000000e+01] [ 3.68000000e+02 3.72000000e+02 2.18142509e-01 1.30000000e+01] [ 4.20000000e+01 3.66000000e+02 2.20453898e-01 3.00000000e+00] [ 1.90000000e+01 3.70000000e+02 2.34968663e-01 3.00000000e+01] [ 6.00000000e+01 3.14000000e+02 2.35362941e-01 3.00000000e+00] [ 3.00000000e+01 3.63000000e+02 2.36983192e-01 1.26000000e+02] [ 1.78000000e+02 3.73000000e+02 2.38489242e-01 1.40000000e+01] [ 1.50000000e+01 3.77000000e+02 2.41028929e-01 1.27000000e+02] [ 3.78000000e+02 3.79000000e+02 2.41788798e-01 1.41000000e+02] [ 1.76000000e+02 3.80000000e+02 2.43365688e-01 1.42000000e+02] [ 3.61000000e+02 3.81000000e+02 2.51632469e-01 1.48000000e+02] [ 3.74000000e+02 3.76000000e+02 2.58255913e-01 6.00000000e+00] [ 4.80000000e+01 3.82000000e+02 2.62669005e-01 1.49000000e+02] [ 1.57000000e+02 3.84000000e+02 2.72339104e-01 1.50000000e+02] [ 2.90000000e+02 3.83000000e+02 2.86373094e-01 8.00000000e+00] [ 5.80000000e+01 3.86000000e+02 3.37169183e-01 9.00000000e+00] [ 3.85000000e+02 3.87000000e+02 3.53341131e-01 1.59000000e+02] [ 3.75000000e+02 3.88000000e+02 3.59894279e-01 1.89000000e+02] [ 8.10000000e+01 3.89000000e+02 3.63424368e-01 1.90000000e+02] [ 1.71000000e+02 3.67000000e+02 3.97093317e-01 3.00000000e+00] [ 3.71000000e+02 3.90000000e+02 4.08900160e-01 1.92000000e+02] [ 4.00000000e+01 3.92000000e+02 4.48383841e-01 1.93000000e+02] [ 3.91000000e+02 3.93000000e+02 4.97996946e-01 1.96000000e+02] [ 1.47000000e+02 3.94000000e+02 5.59668104e-01 1.97000000e+02] [ 1.74000000e+02 3.95000000e+02 6.35576164e-01 1.98000000e+02] [ 1.50000000e+02 3.96000000e+02 9.10077509e-01 1.99000000e+02] [ 9.90000000e+01 3.97000000e+02 9.58559881e-01 2.00000000e+02]] (199, 4)
hclust.dendrogram(linkage_matrix,p=4,truncate_mode='level');#show first 4 levels
fcluster
: extracting clusters from a hierarchy¶fcluster
takes a linkage matrix and returns a cluster assignment. It takes a threshold value and a string specifying what method to use to form the cluster.
help(hclust.fcluster)
Help on function fcluster in module scipy.cluster.hierarchy: fcluster(Z, t, criterion='inconsistent', depth=2, R=None, monocrit=None) Forms flat clusters from the hierarchical clustering defined by the given linkage matrix. Parameters ---------- Z : ndarray The hierarchical clustering encoded with the matrix returned by the `linkage` function. t : float The threshold to apply when forming flat clusters. criterion : str, optional The criterion to use in forming flat clusters. This can be any of the following values: ``inconsistent`` : If a cluster node and all its descendants have an inconsistent value less than or equal to `t` then all its leaf descendants belong to the same flat cluster. When no non-singleton cluster meets this criterion, every node is assigned to its own cluster. (Default) ``distance`` : Forms flat clusters so that the original observations in each flat cluster have no greater a cophenetic distance than `t`. ``maxclust`` : Finds a minimum threshold ``r`` so that the cophenetic distance between any two original observations in the same flat cluster is no more than ``r`` and no more than `t` flat clusters are formed. ``monocrit`` : Forms a flat cluster from a cluster node c with index i when ``monocrit[j] <= t``. For example, to threshold on the maximum mean distance as computed in the inconsistency matrix R with a threshold of 0.8 do:: MR = maxRstat(Z, R, 3) cluster(Z, t=0.8, criterion='monocrit', monocrit=MR) ``maxclust_monocrit`` : Forms a flat cluster from a non-singleton cluster node ``c`` when ``monocrit[i] <= r`` for all cluster indices ``i`` below and including ``c``. ``r`` is minimized such that no more than ``t`` flat clusters are formed. monocrit must be monotonic. For example, to minimize the threshold t on maximum inconsistency values so that no more than 3 flat clusters are formed, do:: MI = maxinconsts(Z, R) cluster(Z, t=3, criterion='maxclust_monocrit', monocrit=MI) depth : int, optional The maximum depth to perform the inconsistency calculation. It has no meaning for the other criteria. Default is 2. R : ndarray, optional The inconsistency matrix to use for the 'inconsistent' criterion. This matrix is computed if not provided. monocrit : ndarray, optional An array of length n-1. `monocrit[i]` is the statistics upon which non-singleton i is thresholded. The monocrit vector must be monotonic, i.e. given a node c with index i, for all node indices j corresponding to nodes below c, ``monocrit[i] >= monocrit[j]``. Returns ------- fcluster : ndarray An array of length ``n``. ``T[i]`` is the flat cluster number to which original observation ``i`` belongs.
clusters = hclust.fcluster(linkage_matrix,0.3,'distance')
len(set(clusters))
13
plt.scatter(X[:, 0], X[:, 1], c = clusters)
<matplotlib.collections.PathCollection at 0x11b0db1d0>
clusters = hclust.fcluster(linkage_matrix,4,'maxclust')
len(set(clusters))
4
plt.scatter(X[:, 0], X[:, 1], c = clusters)
<matplotlib.collections.PathCollection at 0x11affe710>
fclusterdata
¶fclusterdata
does both linkage and fcluster in one step. Let's try out different linkage methods.
clusters = hclust.fclusterdata(X, 4, 'maxclust', method = 'complete')
plt.scatter(X[:, 0], X[:, 1], c = clusters)
<matplotlib.collections.PathCollection at 0x114738d68>
clusters = hclust.fclusterdata(X, 4, 'maxclust', method = 'average')
plt.scatter(X[:, 0], X[:, 1], c = clusters)
<matplotlib.collections.PathCollection at 0x11473e0b8>
You can even use a non-Euclidean metric.
clusters = hclust.fclusterdata(X, 4, 'maxclust', method = 'average', metric = 'cityblock')
plt.scatter(X[:, 0], X[:, 1], c = clusters)
<matplotlib.collections.PathCollection at 0x11af775f8>
leaves_list
¶A hierarchical cluster imposes an order on the leaves. You can retrieve this ordering from the linkage matrix with leaves_list
hclust.leaves_list(linkage_matrix)
array([ 99, 150, 174, 147, 171, 113, 146, 40, 49, 80, 81, 19, 13, 69, 77, 41, 67, 50, 84, 21, 26, 6, 33, 86, 88, 61, 34, 18, 29, 82, 97, 73, 36, 85, 12, 94, 2, 31, 65, 20, 71, 157, 48, 187, 116, 103, 192, 142, 188, 176, 178, 133, 160, 195, 122, 119, 128, 108, 183, 130, 117, 139, 105, 141, 15, 30, 194, 76, 24, 22, 63, 44, 135, 138, 56, 149, 175, 180, 90, 193, 59, 0, 70, 112, 158, 161, 145, 191, 197, 14, 114, 115, 172, 126, 148, 168, 185, 169, 152, 167, 124, 125, 154, 132, 177, 199, 121, 118, 101, 166, 143, 151, 181, 106, 137, 155, 120, 100, 104, 102, 196, 110, 136, 66, 52, 98, 153, 159, 5, 16, 47, 17, 68, 32, 28, 55, 46, 92, 165, 62, 123, 95, 156, 45, 162, 25, 35, 129, 140, 37, 89, 43, 170, 9, 39, 57, 64, 96, 144, 72, 190, 1, 7, 74, 75, 186, 8, 127, 107, 198, 131, 87, 163, 179, 38, 184, 134, 4, 111, 23, 27, 93, 11, 54, 173, 189, 109, 182, 51, 91, 164, 58, 10, 78, 42, 53, 79, 60, 3, 83], dtype=int32)
from matplotlib.pylab import cm
data = np.genfromtxt('Spellman.csv',skip_header=1,delimiter=',')[:,1:]
Z = hclust.linkage(data,method='complete')
leaves = hclust.leaves_list(Z)
ordered = data[leaves]
plt.matshow(ordered, aspect = 0.01, cmap=cm.seismic);
plt.colorbar()
<matplotlib.colorbar.Colorbar at 0x11b8cc080>
What is machine learning?
Wikipedia:
Machine learning is a subfield of computer science that evolved from the study of pattern recognition and computational learning theory in artificial intelligence. Machine learning explores the study and construction of algorithms that can learn from and make predictions on data.
Dr. David Koes, University of Pittsburgh:
Creating useful and/or predictive computational models from data.
Machine Learning can be considered a subfield of Artificial Intelligence.
These algorithms can be seen as building blocks to make computers learn to behave more intelligently by somehow generalizing rather that just storing and retrieving data items like a database system would do.
Here's an overly simple example:
This may seem like a trivial task, but it is a simple version of a very important concept. By drawing this separating line, we have learned a model which can generalize to new data.
If you were to drop another point onto the plane which is unlabeled, this algorithm could now predict whether it's a blue or a red point.
scikit-learn
¶Scikit-Learn is a Python package designed to give access to well-known machine learning algorithms within Python code, through a clean, well-thought-out API. It has been built by hundreds of contributors from around the world, and is used across industry and academia.
Scikit-Learn is built upon Python's NumPy (Numerical Python) and SciPy (Scientific Python) libraries, which enable efficient in-core numerical and scientific computation within Python.
Machine learning is about creating models from data, and scikit-learn
uses a particular layout for building its models.
Most machine learning algorithms implemented in scikit-learn expect data to be stored in a
two-dimensional array or matrix, typically as numpy
arrays. The shape of the array is expected to be [n_samples, n_features]
As an example of a simple dataset, we're going to take a look at the iris data (stored in scikit-learn
, along with dozens of other sample datasets).
The data consists of measurements of three different species of irises.
There are three species of iris in the dataset, which we can picture here:
from IPython.core.display import Image, display
display(Image(filename = 'Lecture26/iris_setosa.jpg'))
print("Iris Setosa\n")
display(Image(filename = 'Lecture26/iris_versicolor.jpg'))
print("Iris Versicolor\n")
display(Image(filename = 'Lecture26/iris_virginica.jpg'))
print("Iris Virginica")
Iris Setosa
Iris Versicolor
Iris Virginica
The iris data consists of the following:
Features in the Iris dataset:
Target classes to predict:
Accessing the iris data in scikit-learn
is pretty easy:
from sklearn.datasets import load_iris
iris = load_iris()
We can examine this data more closely, using the properties of the various Python objects storing it:
iris.keys()
dict_keys(['feature_names', 'data', 'DESCR', 'target_names', 'target'])
n_samples, n_features = iris.data.shape
print((n_samples, n_features))
print(iris.data[0])
(150, 4) [ 5.1 3.5 1.4 0.2]
print(iris.data.shape)
print(iris.target.shape)
(150, 4) (150,)
print(iris.target)
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2]
print(iris.target_names)
['setosa' 'versicolor' 'virginica']
This data is four dimensional, but we can visualize two of the dimensions at a time using a simple scatter-plot:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
x_index = 0
y_index = 1
# this formatter will label the colorbar with the correct target names
formatter = plt.FuncFormatter(lambda i, *args: iris.target_names[int(i)])
plt.scatter(iris.data[:, x_index], iris.data[:, y_index],
c=iris.target, cmap=plt.cm.get_cmap('RdYlBu', 3))
plt.colorbar(ticks=[0, 1, 2], format=formatter)
plt.clim(-0.5, 2.5)
plt.xlabel(iris.feature_names[x_index])
plt.ylabel(iris.feature_names[y_index]);
Imagine we didn't have the target data (i.e., iris species) available, and wanted to cluster the data into similar groups.
In this case, we're discovering an underlying structure in the data without any a priori knowledge of categories or "ground truth". Hence, unsupervised.
Other forms of unsupervised learning include:
This is what we do in order to build models from data that DO include some form of "ground truth" labels.
The data consists of a set of examples X where each example has a label y.
Our assumption is that the label is a function of the data; our goal is to learn that function that maps X to y as accurately as possible: $y = f(X)$
There are two types of supervised learning.
Classification maps an example to a discrete labels. This answers questions such as
Regression maps an example to a continuous number. This answers questions such as
This is a flow chart created by scikit-learn super-contributor Andreas Mueller which gives a nice summary of which algorithms to choose in various situations. Keep it around as a handy reference!
from IPython.display import Image
Image("http://scikit-learn.org/dev/_static/ml_map.png")
Given we have ground truth information (iris species), are we performing supervised or unsupervised learning on the iris data?
What if we didn't have grouth truth information? What kind of algorithms could we use?
What kind of supervised learning are we performing?
The iris data are 4-dimensional; can't exactly visualize that directly. We can, however, plot each pair of features in turn (this is called "getting a feel for the data").
import itertools
features = iris.data
feature_names = iris.feature_names
classes = iris.target
feature_combos = itertools.combinations([0, 1, 2, 3], 2)
for i, (x1, x2) in enumerate(feature_combos):
fig = plt.subplot(2, 3, i + 1)
fig.set_xticks([])
fig.set_yticks([])
for t, marker, c in zip(range(3), ">ox", "rgb"):
plt.scatter(features[classes == t, x1],
features[classes == t, x2],
marker = marker, c = c)
plt.xlabel(feature_names[x1])
plt.ylabel(feature_names[x2])
The features, X, are what make each example distinct. Ideally they contain enough information to predict y. In the case of the iris dataset, the features have to do with petal and sepal measurements.
The pairwise feature plots give us some good intuition for the data. For example:
Still, for any given pair of features, we can't get a perfect classification rule.
But that's ok!
Another algorithm with a $k$ in the name--this time, a supervised algorithm--is the simplest classifier you can design.
It asks, for any given data point $x$: What are the labels of the $k$ data points closest to $x$?
It then performs a majority vote, based on those labels. The winning label is assigned to the new data point $x$. The end!
Let's try it on the iris dataset.
from sklearn import neighbors
X, y = iris.data, iris.target
X = iris.data[:, :2] # For ease of interpretation
# create the model
knn = neighbors.KNeighborsClassifier(n_neighbors = 5)
# fit the model
knn.fit(X, y)
KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski', metric_params=None, n_jobs=1, n_neighbors=5, p=2, weights='uniform')
That's it. We've trained our classifier! Now let's try to predict a new, previously-unobserved iris:
# What kind of iris has 3cm x 5cm sepal?
# call the "predict" method:
result = knn.predict([[3, 5],])
print(iris.target_names[result])
['setosa']
Our completely-made-up new mystery iris is classified as a setosa!
We can visualize what this algorithm looks like:
from matplotlib.colors import ListedColormap
cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA', '#AAAAFF'])
cmap_bold = ListedColormap(['#FF0000', '#00FF00', '#0000FF'])
### IGNORE THIS ###
x_min, x_max = X[:, 0].min() - .1, X[:, 0].max() + .1
y_min, y_max = X[:, 1].min() - .1, X[:, 1].max() + .1
xx, yy = np.meshgrid(np.linspace(x_min, x_max, 100),
np.linspace(y_min, y_max, 100))
Z = knn.predict(np.c_[xx.ravel(), yy.ravel()])
# Put the result into a color plot
Z = Z.reshape(xx.shape)
plt.figure()
plt.pcolormesh(xx, yy, Z, cmap = cmap_light)
# Plot also the training points
plt.scatter(X[:, 0], X[:, 1], c = y, cmap = cmap_bold)
plt.xlabel('sepal length (cm)')
plt.ylabel('sepal width (cm)')
plt.axis('tight')
(4.2000000000000002, 8.0, 1.8999999999999999, 4.5)
There are plenty of more sophisticated classifiers:
Furthermore, you will often combine multiple methods into a machine learning pipeline. For example, rather than work directly with the 4D iris data, perhaps you'll run PCA on it first to reduce it to 2 dimensions, then classify it.
Machine learning is more of an art than a science; it takes a lot of "playing with the data" to find the right combination of model and pipeline that incorporates the right assumptions about the data and can generalize well.
scikit-learn
makes it relatively easy to get started: you don't have to know how the algorithms are implemented underneath, but that knowledge does help in fine-tuning your pipelines.


A socio cultural organisation
2017
Children Summer Workshop
2017
Blood Donation Camp 2017 - 3rd sunday of December
2018
Quiz Competition
To bring about betterment in the society by infusing an air of positivity and togetherness. The seed of welfare and development oughts to be sown in the air of positivity and nurtured in an ambience of confidence and belongingness. This is the perfect recipe of the best harvest.
To upliftment of cultural moral and skill development. To instill a sense of confidence whereby an individual or group can standup to bring the best impact possible to the society or an individual.
Prayash started its journey by organising a Jalsha at a residence of Dr. Ananda Bormudoi (Professor - Dept. of Assamese, Dibrugarh University) and Dr.PurobiBormusoi (A Sahitya Academy Awardee) on September 2011. Since that day, Prayash holds the credibility of hosting 5 summer camps from 2012 – 2016, three blood donation camps, Free Medical Health Check-ups, Shilpi Divas, Rabindra Sandhya and Environment day.


{% extends "global/Page.html" %} {% load staticfiles otree_tags %} {% block title %}
Thank you. Your choice of Money Machine {{ player.choice5 }} was recorded. Please click on the "Next" button to the next pair of money machines.


| All Classes
Packages
com.milk.asynch
com.milk.command
com.milk.command.gui
com.milk.gui
com.milk.objed
com.milk.objed.event
com.milk.objed.gui
com.milk.timer
com.milk.uberchat
com.milk.uberchat.base
com.milk.uberchat.command
com.milk.uberchat.event
com.milk.uberchat.gui
com.milk.uberchat.icb
com.milk.uberchat.iface
com.milk.uberchat.irc
com.milk.uberchat.spacebar
com.milk.util
|


Welcome to Graph Viewer!
Online Help: http://luciddreamingapp.com/help-how-to/analyze-data/
This activitiy displays graphs of data that was collected overnight. Graphs become available after 8 minutes
the app was running and may be autosaved every 10 minutes (if autosave option is enabled). You may manually save the graph before exiting the app.
Usage
Select "Load Graph" from the menu to view one of the graphs you have created. Graphs are stored in /Application Data/Lucid Dreaming App/Graph Data.
Their file name includes the moment when you started the app. Pick one of the graphs to load it.
Interacting with axis and points
Due to the small screen size, I'm including a lot of data in one plot. To ease the process of viewing, you can remove some data series from the graph
by using the checkboxes below the plot. Multiple axis are introduced due to different scales of data series displayed.
The plot axis are not labelled to save space. If you click on an axis, it's description and units are shown below the graph. Clicking on a point displays its value and timestamp below the graph. I'm working on turning the timestamp into a date.
Axis and series
- Sleep score - Values less than 1 indicate sleep, otherwise awake
- Sleep episodes - value of 0 indicates awake, 10 falling asleep and 20 asleep
- Sleep duration rises with each minute you are asleep. This may be useful for estimating periods of sleep interruption
- Reminder played - shows the minute when a reminder was played. This info may be helpful in gauging the effectiveness of the app
- Awake, Dream, Lucid Dream, User Event - indicates minutes when the you interacted with the screen. These are shown as little ticks in the upper portion of the graph
Ticks are color coded and shown in the legend. Here's what they stand for:
- X = reminder played that minute.
- O stands for both awake and no dream events
- Triangle stands for regular dreams
- Square stands for lucid dreams
- Diamond stands for other events and screen interactions
Sleep Statistics
Graphs include a statistical summary of that night's sleep. Here's the overview of some important metrics:
- Sleep onset latency - time it takes to reach 5 consecutive minutes of sleep
- Sleep score - a user is considered asleep if the sleep score is less than 1 on 5 consecutive minutes
- Number of awakenings - number of times the app detected significant movement and think you were awake
- Number of user events - number of minutes when you interacted with the screen (max 1/minute)
- Longest sleep episode - longest period with sleep score of less than 1


UI/UX Designer Logo & Branding Specialist Java/C++ Developer
More About MeI am a second year student at Wilfrid Laurier Univerty majoring in User Experince Design [Honors B.Des], with a minor in Psychology. I am the sitting Vice-President of the User Experience Design Students Association.
My design style persists of minimalistic, flat, and modern design approaches.
Through various leadership experiences I have developed my interpersonal skills, alongside my design skills listed below.
These past employment opportunities have helped me develop my collaborative skills, and demonstrated my time management skills.
Summer 2017
Taught basic Photoshop and Arduino programming to children aged 11-13.
2016
Designed Logo for the student council at Waterloo Collegiate Institute for the 2016-17 school year.
2013 - 2017
Did Audio/Visual tech for presentation and performances at Waterloo Collegiate Institute.
2017 - 2021
Learnt hands on User Experience Design best practices, and partnered with real world clients to deepen my learning.
2017 - 2018
Honed my design style, and learnt the Adobe suite.
2012 - 2017
Ontario Scholar & SHSM Student. Got 90s in the arts and 70s in the rest.
Successes and failures; each have taught me something new.
Not sure how I can be of use to you or your team? Here are some examples:
Designing, building, and maintaining websites for you or your company. Working with you every step of the way to ensure it's everything you're looking for.
Need a logo, colour scheme, or want more consistent design? I'll work with you to create a branding guideline you can send to designers so that all your designs will feel like they belong together.
Specializing in User Research and Testing. I can ensure that your solution not only meets, but exceeds users needs and expectations.
If you want to hire me or critique my work; please feel free to call, text, email, or even send snail mail!


CurrentDate
Min Date
Max Date
DateFormat
Default - MM/dd/yyyy
Short - d M, y
Medium - d MM, y
Full-dddd,d MMMM,yy
UTC - yyyy-MM-dd
Business start hour
Business end hour
Hightlight Business Hours
Read Only
Show/Hide AllDay row
Next/Prev Month Date
ApplyTimeOffset
Disable TimeScale
Show/Hide Appointment Priority
Active view
Day view
Week view
Workweek view
Month view
Agenda view
Start Time
End Time
Cell Width
Cell Height
Submit


Benjamin Weinstein - Air Quality Section Head Air Quality Section (Assessments and Stewardship) Ministry of Environment and Climate Change Strategy Toll-free 1<PHONE_NUMBER> Ben.Weinstein@gov.bc.ca


This is a little pet project I am working on. Currently, it just displays the current temperature and humidity in my bedroom here in the San Diego area. Data comes from a DHT22 sensor hooked up to a Raspberry Pi Model B.
This webpage is not hosted on the Pi itself, but on GitHub Pages. Client-side JavaScript queries my Pi and displays the data.
Check out my website and my other projects on GitHub.


The following diagrams are intended to be a quick reference for the various connectors on the BMS. Please consult the complete wiring manual for details on the pin functions.
The following screens are available:
| < Example: Requesting Battery Voltage | Main I/O Harness Diagram > |


Ctrl + ↑
/ Ctrl + ↓
. Eval: Ctrl + Enter
or the button "eval" below. Source: scheme-on-coffee on Github. ECMAScript info: http://dmitrysoshnikov.com|
Expression input:
Examples (click to eval): 1. Sum: (+ 1 2 3)2. Define a variable in the Global environment: (define x 10)3. Define a procedure: (define (sum x y) (+ x y))4. Eval the sequence (block) of expressions: (begin (define a 10) ; define "a" variable (define b 30) ; and "b" variable (define (square x) (* x x)) ; and a function (+ (square a) b)) ; and get the sum of square of "a" and "b"5. Recursion; define the factorial function and call it: (begin (define (factorial n) ; define the factorial function (if (= n 1) 1 (* n (factorial (- n 1))))) (factorial 5)) ; and call it for value 56. Map the list with a lambda expression: (map (lambda (x) (* x x)) ; anonymous function (list 1 2 3 4)) ; maps the list to '(1 4 9 16) |
Output: |


Modals focus the user's attention exclusively on one task or piece of information via a layer that sits on top of the page content.
Modals are used to present information or request user input needed to complete a workflow. Use a modal when it is important to focus attention on one task or a piece of information. Modals interrupt a user's workflow by design. When active, the user is blocked from the on-page content and cannot return to their previous workflow until the modal task is completed or the modal is dismissed.
The
ModalController
can be used to present a component in a modal dialog by passing a
ModalConfig
to the
ModalController.showModal()
method. The configuration controls the content of the modal as well as size, flavor etc. as seen
in the interactive example and the
explanation below
.
The modal can have one of the following flavors:
modal | drawer | compact
With the
modal
flavor the dialog is presented directly on top of content, either as a full screen modal on small
screens or centered on the page on larger screens.
On small screens the
drawer
acts as a sheet appearing on top of the page content, and adapts its height to fit its content. On
larger screens the drawer flavor is identical to the modal flavor. Additionally, the drawer can
have a
supplementary action
.
The
compact
flavor renders a stripped-down version with no heading, toolbar or close button and no content
scrolling. It is useful for presenting purely informational dialogs like
out-of-order
style modals.
On larger screens modals and drawers can be opened in three different sizes:
small | medium | large
. On smaller screens the modal is always full-screen. The compact flavor has a fixed width and
ignores any configured size.
Additionally a
customHeight
can be configured on
ModalConfig
to override any default height set by the
size
property.
To configure the component embedded inside the modal, ensure that the embedded component is
declared either as a standalone component or in
entryComponents
in a module.
Inside the embedded component markup you should include a
kirby-page-title
element with the title of your dialog.
Optionally, if you have a multi-step dialog you can display a progress status in the modal header
by including a
kirby-page-progress
element with the content of your progress tracker.
To render a footer at the bottom of the modal include a
kirby-modal-footer
inside the embedded component.
This example acts as a playground where any combination of properties of the
ModalConfig
can be explored including the interplay between multiple types and sizes of nested modals.
In both the example below and within the opened modals the configuration sheet can be used to explore the different configuration options the modal has to offer.
To access data passed into the embedded component, inject the
COMPONENT_PROPS
inside the embedded component's constructor:
In order to hide a modal from within your embedded component (and destroy its component), you can
inject the modal window that your component is displayed within:
It is possible to open additional nested modals from within your embedded components, by applying all the same services and principles as described in all of the above.
The
ModalConfig
can be configured with
drawerSupplementaryAction
to render an additional button in the top left corner when the
drawer
flavor is used. The
drawerSupplementaryAction
option takes an
iconName
which corresponds to the name of a
kirby-icon
and an
action
function which is invoked when the supplementary button is selected.
Routed modals are useful for creating wizard-type flows where the same modal is reused for showing multiple individual components one at a time. Modal routes will automatically open up a modal if none is already opened which also means they are ideal for deep-linking directly to routes of components that should be presented in a modal.
Showing a component on its associated route inside a modal is achieved by configuring the route
with a
secondary outlet
named
modal
.
Instead of calling the
ModalController.showModal()
method and passing a
ModalConfig
, the modal will now be opened simply by navigating to the route. The modal still accepts a
ModalConfig
, but this is instead provided via a
modalConfig
object passed as additional route data.
You can use the
ModalEnabledRoutes
type to enable strong typing for the
ModalConfig
inside the array of routes passed to Angular's
RouterModule
. This type directly extends the relevant Angular types, so it can be used in place of
Routes
or
Route[]
in your applications route configuration.
The URL for these kind of routes will look like this:
parent-component-route/(modal:some-child-route)
, where the parent component will be presented behind the modal.
This means that with deeplinked modals like this one we can send the user to a whole new context before showing the modal on top.
Modal routes can be navigated to by adding
kirbyModalRouterLink
to the component's template and optionally pass query parameters with
[kirbyModalQueryParams]
. Alternatively, to navigate from code you can inject
ModalController
and call its
navigateToModal
method, where query params can be passed as the second argument.
Please note:
Always use Angular's "box" syntax for binding to
[kirbyModalQueryParams]
otherwise it will be treated as a string and not an object literal.
Within the child component
presented in the modal a regular Angular
[routerLink]
can be used with a relative path to the sibling modal route, and query params can be passed as
normal using
[queryParams]
.
If you need to navigate from code
within the child component
you can either inject
ModalController
and call its
navigateWithinModal
method for convenience, which also support passing query params, or you can inject and navigate
through the regular Angular
Router
. The latter is useful if you need to pass
NavigationExtras
other than query params. Notice that when using the Angular Router you need to provide the current
ActivatedRoute
as the root URI using the
relativeTo
param.
It is possible to provide a
canDismiss
callback to the modal that returns either a
boolean
or an
AlertConfig
. If an
AlertConfig
is being returned, an alert will appear, when the user tries to dismiss the modal. This callback
can be set on the parent modal from your own embedded component, or be provided to the
ModalConfig
. The callback can be both synchronous and asynchronous.
Inside the embedded component you can set the
canDismiss
property on the parent modal. This makes it possible to validate if the modal can be dismissed
based on the data inside your component.
It is also possible to provide the callback in the
ModalConfig
that is passed to the modal controller. The callback is passed to the config as
canDismiss
.
The
Modal
fires the
didPresent
event, when the modal is ready and the enter animation has finished. This is a good place to hook
up any visual initialization of the embedded component, e.g. setting focus in an input field:
The
Modal
fires the
willClose
event, when the modal is starting to dismiss/close before any animations occurs. This gives you a
slot to execute your exceptional code just when the modal starts closing but before its actually
done:
If you want to be notified when the modal closes, you can pass a callback function.
Please note:
Remember to bind the callback function to the context of the component instance ie.
.bind(this)
.
If you need to obtain data back from the modal, you can pass a callback function.
Please note:
Remember to bind the callback function to the context of the component instance ie.
.bind(this)
.
The
Modal
supports scrolling to the top and bottom of the modal using the methods
scrollToTop
and
scrollToBottom
. They accept
KirbyAnimation.Duration
as optional param. If not provided the scrolling will happen instantaneously.
The
Modal
supports disabling of scrolling by setting the property
scrollDisabled = true
If the
snapToKeyboard
attribute is set to true, the modal footer will slide upwards with the soft keyboard on mobile
devices to make it stay visible. If omitted, or if explicitly set to false, the modal footer will
stay at the bottom and the keyboard will slide in on top of it.
Modal


Remove a byte order mark (BOM) from a buffer.
Install with npm:
$ npm install --save remove-bom-buffer
var remove = require('remove-bom-buffer');
remove(new Buffer('\ufefffoo'));
utf8
encoding… more | homepagePull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on June 16, 2017.


Select a product you would be most likely to purchase.
Bathroom Item
Pet Sweeper Item
Tauntaun Sleeper Item
Totals


| Probe build date | @timestamp@ |
| Probe build author | @user.name@ |
| Probe build version | @project.version@ |
| Get Info as Xml | Get /xml |
| Get Info as Json | Get /json |
| System Info |
|
| Request headers |
|
| Env Info (powered by Spring Boot) | |
| Apps metrics (powered by Spring Boot) |
|
| Other Spring Boot included endpoints |
|
| Build Info (powered by Spring Boot) | Get /info |
| Network Info | Get /network?targetIp=xxx&targetUrl=yyy |


Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer rhoncus leo vitae augue luctus luctus. Nunc eros dui, vestibulum ac mattis semper, lacinia efficitur orci. Aenean ut dui sed purus pellentesque dictum eu vitae sem. Nulla finibus, nisi quis semper ullamcorper, urna justo iaculis nulla, vel venenatis ligula tortor quis velit. Praesent consequat nunc nec turpis efficitur, ut eleifend libero bibendum. Nulla at mi vel arcu lobortis facilisis venenatis vel libero. Fusce mollis nulla ut nisi tempus posuere. Ut tempus dui neque, dictum convallis ligula rhoncus vitae. Ut nibh massa, ullamcorper eget mattis gravida, condimentum sit amet turpis.
Curabitur tempor mi nulla, eget molestie diam porta sit amet. In sed est ut nibh rhoncus molestie. In pretium, eros eu iaculis suscipit, nibh orci scelerisque sem, non ultricies sem libero sagittis nisi. Donec laoreet orci vitae tellus tempus, ac viverra arcu tincidunt. Vestibulum vitae nibh et eros gravida mattis. Cras feugiat viverra ullamcorper. In iaculis, arcu et congue tincidunt, erat lorem ultricies tellus, ac tempus orci erat nec neque. Integer ac libero in ex iaculis iaculis. Donec tincidunt aliquet venenatis. Proin vel augue ultricies, placerat purus venenatis, rhoncus velit. Aliquam vitae vehicula eros. Maecenas metus mi, vehicula a consectetur vitae, sollicitudin et tortor. Mauris ac urna ante.


When I reinstall my computer, I usually do these following steps:
- Copy all data to an external HDD
- Save configuration:
- Write down all WLAN configurations (eventually with screenshots; NOT ONLY PASSWORDS!)
.ssh
andGPG
keys- Filezilla configurations
- Write down all programs that I use.
- Export configuration of those programs.
- Wait a week or a month and see if someting is missing in the lists from above.
- Drop the old system and install a new one
Operating System
I like to install the latest Ubuntu long term support version (LTS) with the MATE desktop environment: Download link
Ubuntu is the operating system which is one of many flavors of Linux. Those flavours are called distributions. It is one of the most popular distributions according to distrowatch.com, just behind MX Linux, Manjaro and Linux Mint.
Software I usually install
If possible, I will give the debian package names in the following list:
sublime_text
- LaTeX and scientific writing
jabref
: A reference managergnuplot
pdf2svg
aspell
andaspell-de
- Google Chrome
- Multimedia
vlc
: A very good DVD player- OnlineTvRecorder and especially OTR-Verwaltung
avidemux wine mplayer
sudo add-apt-repository ppa:clipgrab-team && sudo apt-get update && sudo apt-get install clipgrab
- Graphics
gimp
inkscape
imagemagick
pdf2svg librsvg2-bin
- Programming
zsh
and Oh-my-zsh- General Tools:
sudo apt-get install make curl wget tree htop vim direnv zsh sqlitebrowser meld diffpdf
- Python:
pyenv
,pip install pip-tools black isort pre-commit
- MySQL:
sudo apt-get install mysql-server && sudo apt-get install phpmyadmin
- VS Code
- C/C++:
sudo apt-get install gcc g++ cmake build-essential gdb
ruby ruby-sqlite3 ruby-mysql
- PHP:
apache2 php5 php5-mysql
- JavaScript:
sudo apt-get install nodejs npm
- Themes
- Balazan-Theme from bisigi-project (simply download it.)
- Work
- Other
libreoffice
- PDF: qpdf (1)
- DRM-caused (I want to watch DVDs!)
ubuntu-restricted-extras libdvd-pkg libdvdread4 libdvdnav4
, then runsudo dpkg-reconfigure libdvd-pkg
totem banshee mplayer rythmbox
Configure
Set standards
update-alternatives --config editor
update-alternatives --config x-www-browser
MATE
See issues/262:
mv ~/.config/gtk-3.0/bookmarks ~/.config/gtk-3.0/bookmarks-backup
ln -s ~/.gtk-bookmarks ~/.config/gtk-3.0/bookmarks
GUI
I like the old menu bar quite a lot. It opens instantly and is customizable:
You can get it back in MATE by doing a right-click on the menu. Then click on "add to panel":
After that, the following dialog will pop up. Choose "Menu Bar"
DRM-Stuff
sudo /usr/share/doc/libdvdread4/install-css.sh
sudo regionset #use that with caution
dotfiles
See github.com/MartinThoma/dotfiles.
Data
Download / copy all data back from GitHub / external HDDs to my internal HDD.
Themes
Bigger sites:
And some specific ones:


{{ site.name }}
{{ site.description }}
Blog
Open Source
Node Projects
Photography
About Me
{{ content }}
Copyright © 2014,2015 rain city software | darryl.west
Copyright © 2014,2015 rain city software | darryl.west
{% include analytics.html %}


{% extends 'base.html' %} {% import 'macros.html' as macro %} {%block styles%} {%endblock%} {%block content%}
Essentially it’s a short summary about yourself and what you do, in an interview.
Click to viewMake it short. · Make it clear.  · Explain the problem they're facing.
Click to viewA sales pitch is a condensed sales presentation,a salesperson explains the nature and benefits of their business in less than one or two minutes.
Click to view


17 year old student from Portugal, currently in high school. I like to wander the web in search of more knowledge and information. Mostly spend my free time developing NodeJS applications and websites. Take a look at the projects section to see some of the stuff I have worked on.
(Open Source)
A javascript discord selfbot that is setup and ready to go in less than 5 min.
Creator / Developer
(Open Source)
A personal website to showcase some projects and information about myself.
Creator / Developer
<EMAIL_ADDRESS>TheRacingLion
@The_Racing_Lion#4810
theracinglion


f_test
OS/161 Reference Manual
Name
f_test - basic concurrent filesystem test
Synopsis
/testbin/f_test [1|2|3]
Description
f_test consists of three tests, 1-3, that can be specified on the
command line. If nothing is specified, all three tests are run.
Test 1 writes a large file (a bit over 270k) and reads it back.
Test 2 creates and removes a directory tree, rather like
dirtest.
Test 3 spawns three subprocesses that simultaneously read and write
the same file.
Requirements
f_test uses the following system calls:
f_test should run correctly once the file system assignment is complete.


(Route :Settings Menu, Users Command, Edit Button)
The Edit User Dialog box will allow you to change the password and the permissions assigned to a particular user account.
This is a Hot Spot image. Move your mouse pointer over the image
and when the mouse pointer changes to the shape of a hand click
the left mouse button once for extra help.
To edit the password, enter the new password in the Password text box.
You can change the permissions for the account by checking or unchecking the item in the Permissions list.
When you have finished editing the properties for the user account, click the OK button to save your changes. The changes will not come into effect until Ameol is restarted.


This is a fork of the jQuery-contextMenu plugin which includes a patch to support the native contextmenu support found in the Firefox nightlies (FF8) as well as a test to check if native support for contextmenu is available. Given that FF are the only browser to currently support the HTML5 contextmenu natively, I feel it's important that a polyfill handle it as well as the original specs.
Original project summary
The contextMenu Plugin was designed for web applications in need of menus on a possibly large amount of objects. Unlike implementations as a beautiful site's or trendskitchens' this contextMenu treats the menu as the primary object. That means, that a single menu is defined that can be used by multiple objects. Unlike the mentioned plugins, contextMenu doesn't need to bind itself to triggering objects. This allows injecting and removing triggers without having to re-initialize or update contextMenu.contextMenu can provide a simple list of clickable commands, or offer an in-menu form. This makes very simple attribute modification possible. See the input example.
Once a menu is registered, it cannot be altered. That means no commands can be added or removed from the menu. This allows contextMenu to keep a single definition in memory, which enables it to work with hundreds of trigger objects. contextMenu knows the two callbacks show and hide which can be used to update the state of commands within the menu. This allows en/disabling commands, changing icons or updating the values of contained <input> elements.
And, yes, the icons provided in this demo are taken from a beautiful site, as well as some implementation ideas…


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 4
Stir-fries are very flexible - throw in whatever vegetables you like into this easy sweet and savoury chicken supper.
For the chicken, place the chicken into a bowl, add the light soy sauce and black pepper and toss well, then set aside.
Bring a pan of salted water to the boil, add the sprouting broccoli and cook for two minutes until just tender, then drain and set aside.
Heat a wok or large frying-pan over high heat until it is hot.
Add the oil, and when it is very hot and slightly smoking, add the chicken and stir-fry for 2-3 minutes or until golden-brown, and nearly cooked.
Remove the chicken from the wok and set aside.
Add the onion to the wok, along with the garlic, ginger and red pepper and stir-fry for three minutes.
Add the chicken and broccoli and toss through then add the sherry, sesame oil, soy sauce and chilli bean sauce and heat through, stirring to combine.
Mix the cornflour with one tablespoon of water, then stir into the sauce and heat until just thickened.
For the noodles, cook the noodles according to the pack instructions, then drain and toss with the sesame oil and spring onions.
To serve, pile the noodles onto the plate, then spoon the chicken over the top.
Garnish with the sesame seeds and serve at once.


This is the landing page for the projects. If you do not want to create your own, this page can be kept and the text can be changed or omitted by setting the value of the projects_intro
variable in the _config-yml
. If you want to keep the page but omit the intro-text, set the variable to none
. If you want to create your own page, use the Front Matter :
---
title: projects
layout: projects
weight: 2
menu: main
---
where title
is the title to be displayed on the menu and in the browser as the title of the page, layout: projects
is necessary to display the project posts, weight
tells the menue what position this page should take in the global navigation,and menu: main
places the page in the global navigation.
[tag,another-tag,sass]
example of how it looks to plece something in the different categories. this is placed in the code-category. in this case all the examples are using the same image, placed in the assets/projects/images-folder. on github
[illustrator,html,sass]
now we placed the project in the design-category. below there is a likn to the source code. on github
[liquid,html,sass]
a theme for a jekyll site, available as a gem or for forking through github. used on this site. made to be used for a portfolio-based site. on github


×
HURRY!
Last Chance for Seasonal Deals!

LAST CHANCE! For This Year's Final Sales!
animate


| space, → | next slide |
| ← | previous slide |
| d | debug mode |
| ## <ret> | go to slide # |
| c | table of contents (vi) |
| f | toggle footer |
| r | reload slides |
| z | toggle help (this) |
apt-get install gcc
package { "gcc": ensure => installed }
/etc
and /usr/local
.root
access, so use it.$ echo "deb http://packages.devstructure.com lucid main" | sudo tee /etc/apt/sources.list.d/devstructure.list $ sudo wget -O /etc/apt/trusted.gpg.d/devstructure.gpg \ http://packages.devstructure.com/keyring.gpg $ sudo apt-get update ... $ sudo apt-get -y install blueprint ... $ blueprint Usage: blueprint <command> [...] Common commands: list, create, show, diff, apply, destroy, git $
blueprint create foo
$ sudo blueprint create foo # [blueprint] searching for APT packages to exclude # [blueprint] caching excluded APT packages # [blueprint] searching for Yum packages to exclude # [blueprint] parsing ~/.blueprintignore # [blueprint] searching for Yum packages # [blueprint] searching for APT packages # [blueprint] searching for Python packages # [blueprint] searching for PEAR/PECL packages # [blueprint] searching for Ruby gems # [blueprint] searching for configuration files # [blueprint] searching for software built from source # [blueprint] searching for service dependencies $
/etc
../configure && make && make install
blueprint show foo | less
{ "files": { "/etc/apt/sources.list.d/devstructure.list": { "content": "deb http://packages.devstructure.com natty main\n", "encoding": "plain", "group": "root", "mode": "100644", "owner": "root" } }, "packages": { "apt": { "openssh-server": ["1:5.8p1-1ubuntu3"], } }, "services": { "sysvinit": { "ssh": { "packages": { "apt": ["openssh-server"] } } } } }
~/.blueprintignore
gitignore
(5).$ cat ~/.blueprintignore /etc/apt !/etc/apt/sources.list.d !/etc/apt/trusted.gpg.d *.pyc /etc/hosts /etc/nginx/sites-enabled/default /etc/sudoers :package:apt/build-essential !:package:apt/build-essential :package:apt/libopts25 :package:apt/libtspi1 $ sudo blueprint create foo ... $
blueprint push foo
blueprint pull foo
blueprint apply foo
blueprint show -S foo
foo.sh
without installing Blueprint.blueprint show -P foo
blueprint show -C foo
class foo { Class['files'] -> Class['packages'] class files { file { '/etc/apt/sources.list.d/devstructure.list': content => template('foo/etc/apt/sources.list.d/devstructure.list'), ensure => file, group => root, mode => 0644, owner => root; } } include files class packages { class apt { package { 'openssh-server': ensure => '1:5.8p1-1ubuntu3'; } } include apt } include packages class services { class sysvinit { service { 'ssh': enable => true, ensure => running, subscribe => Package['openssh-server'], } } include sysvinit } include services }
cookbook_file('/etc/apt/sources.list.d/devstructure.list') do backup false group 'root' mode '0644' owner 'root' source 'etc/apt/sources.list.d/devstructure.list' end package('openssh-server') { version '1:5.8p1-1ubuntu3' } service('ssh') do action [:enable, :start] subscribes :restart, resources('package[openssh-server]') end
cron
(8).0 * * * * curl https://devstructure.com/secret/foo/foo.sh | sh
#!/bin/sh set -e TMPDIR="$(mktemp -d)" cd "$TMPDIR" trap "rm -rf \"$TMPDIR\"" EXIT wget "http://devstructure.com/secret/foo/foo.sh" sh "$(ls)"
systemd
.


| DOSE: |
|
oral |
MDMA |
(pill / tablet) |
We are a married couple of 46 and 48 and discovered XTC for the first time in July 2000.
Got pills, we've had tested last week, which contain 101 mg pure MDMA and no other substances. Good pills, though!
The first time, we had only 2 pills, one for each. We took half of a pill and 45 minutes later the other halve. And this first experience on MDMA was incredible! There's no way to describe the effect! Absolutely NO WAY! Fantastic! Unbelievable! Great! All these terms do not match to how it really struk us.
When the effect fully kicked in, we were shot right into heaven!
And we had great sex for more than 3 hours! Believe me, this is no fairy tail! Great sex for three hours, with many special things, we did! The whole trip lasted for about 7 hours and we loved it. We loved each other so much, you cannot put it in words.
The next time was about the same! Except the special 'Waaaooouuh'-feeling we had the first time, was missing now! And this is absolutely logical, because, you don't know what to expect the first time and so you are hit by this 'Waaaooouuh'-feeling, when the MDMA hits you! Next time, you've got an idea what to expect and so you will not be that much surprised.
This, I think, is the main reason, that you'll never experience something like the first time.
Now, 28 times later of taking XTC, things have changed!
Sexual desire is gone back to almost zero by the E. Even if we really want to have sex, I cannot perform. Maybe in the beginning of a trip, I could, but not anymore after an hour or so. No way!
We also experienced, that, if we've been not really in a mood to take a pill, but we did anyhow, it wouldn't work as good as it normally did.
Our suspicion: It has a lot to do, what's in your mind when taking E!! A sort of 'pre-programming' of you mind! You'll get a lot of what you expect.
In the beginning, we expected something sensational and something sexual... and we got it!
Later, we got to know, sex was not the most important thing in an E-trip, but the 'loved-up' feeling and the hugging and talking, so this is, what we got in later trips: a lot of understanding of each other's problems, a lot of kuddling and hugging and telling each other a thousand times in a few hours, how much we love each other without ever getting boared.
Sex was not important (anymore)!! When we recalled at a later state of an E-trip, that loving each other had also sometimes to do with sex, it was too late (for me) to perform. No problem! Because under E, there was this 'big understanding'! Nothing matters more than love and understanding.
We've taken the E as well as in weekly intervals and as in longer intervals with two or three weeks breaks. Even if you don't like to read this, but one MUST have longer breaks in between, or the (nice) effect of the E will decrease more and more, even when taking greater amounts. At least 2 weeks breaks are absolutely necessary!
We've also experienced massive depression effects on E due to abuses! Exspecially, when taking it two days after each other and in higher doses (100+50+50mg), the next day(s), depressions could come forward even in a very tough form. (My wife started shouting at me loudly and became hysterical, with no specific reason. She started crying and arguing, etc.. I got feelings of 'Leave me alone' for a few days.) It seemed to us, as if we had spent ALL our 'love-feelings' in just one evening and there was nothing left for the next day(s) up to a week or so.
So, think about, what you are up to!!! Think, what you do and how you do it! It's great taking E (sometimes), but if you want it to remain 'great', you've to be careful! It's not just that simple!
------
We also tried several, different pills, which had a very different (strong or weak) effect. Getting curious, we had three different types of pills labtested last week and know why the effect was different: Because the amount of MDMA varies a lot!!! From 36mg (white, soft Warner-Brothers), 52mg (Mitsubishis, white speckeled) to 101mg (pink Startrek) pure MDMA. (None of them contained any other chemicals or unpurities!)
By telling people, 'I've just taken 1 or 2 pill(s)' doesn't mean anything! As long as you don't know exactly, what's the content of a pill... Even the same sort of pil varies in production over the time.
We are now in a longer break and very much looking forward to our next pill-experience over a few weeks, which will be a nice one again, due to the fact, that after a longer break the effect will be back and due to our 'looking out' to this experience.
Taking a pil every weekend would turn it into a 'common-every-day' experience, not being worth the effort and the next-day-hangover.
The oldman
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


{{ site.description }} at {{ site.author.current_studio }} {{ site.author.location }}
© {{ site.time | date: '%Y' }}
Warm thanks to Jekyll theme © Laynon Poole


Countly Cordova Demo App
Init
Start
Stop
Events Start
Basic Events
Event with Sum
Event with Segment
Even with Sum and Segment
All Events
Timed event: Start / Stop
Timed event Sum: Start / Stop
Timed event Segment: Start / Stop
Timed event Sum Segment: Start / Stop
Events End
Record View: "HomePage"
Record View: "Dashboard"
2017
User Methods Start
Send Users Data
UserData.setProperty
UserData.increment
UserData.incrementBy
UserData.multiply
UserData.saveMax
UserData.saveMin
UserData.setOnce
User Methods End
Other Methods Start
Push Message
Push Test Android
Push Test iOS
Change Device ID
Enable Parameter Tapmering Protection
City, State, and Location
Send Crash Report
Other Methods End


Ashley
2:09 PM
I'm really hungry!
Jessica
5:30 PM
They say I'm an airhead...
Enjoy chatting? Support the site:
Find an issue? Report it on github.


It is difficult, if not impossible, for any one; business, individual or organization, to achieve great success without advice from more
experienced individuals.
As a Business Advisory board member, you would be in the core team, which our Enactus group looks up to for advice on our projects.
You would have the benefit of networking with other BAB members, who are top academic and business leaders in our society, especially at BAB member meetups, organised once every semester, as well as other major events.