Skip to content

Commit

Permalink
Cleaned up text in tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jbednar committed May 1, 2017
1 parent 2b71497 commit afda2fb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions doc/Tutorials/Operations.ipynb
Expand Up @@ -23,7 +23,7 @@
"\n",
"## Inspecting operations\n",
"\n",
"The most common and useful kind of operations are the ``ElementOperation`` classes, which transform one Element or Overlay of Elements returning a new and transformed Element. All operations are so called ``ParameterizedFunction`` objects, which means that they allow defining parameters using the ``param`` library, providing validation for all parameters that control how the operation is applied. This also means we can change the parameters of an operation at the class-level, instance-level and when we call the operation. Let's start by having a look at the ``histogram`` operation, just like all other HoloViews objects we can expect the ``histogram`` operation with the ``hv.help`` function:"
"The most common and useful kind of operations are the ``ElementOperation`` classes, which transform one Element or Overlay of Elements returning a new and transformed Element. All operations are so called ``ParameterizedFunction`` objects, which means that they allow defining parameters using the ``param`` library, providing validation for all parameters that control how the operation is applied. This also means we can change the parameters of an operation at the class-level, instance-level and when we call the operation. Let's start by having a look at the ``histogram`` operation. Just as for all other HoloViews objects we can inspect the ``histogram`` operation with the ``hv.help`` function:"
]
},
{
Expand All @@ -47,7 +47,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see a listing of all the parameters of the operation, seeing their defaults, the expected types and detailed docstrings for each parameter. The ``histogram`` operation can be applied to any Element and will by default generate a histogram for the first value dimension defined on the object it is applied to. As a simple example we can create an ``BoxWhisker`` Element containing samples from a normal distribution, and then apply the ``histogram`` operation in two ways: 1) by creating an instance on which we will change the ``num_bins`` and 2) by passing ``bin_range`` directly to the call of the operation:"
"Above we can see a listing of all the parameters of the operation, with their defaults, the expected types and detailed docstrings for each one. The ``histogram`` operation can be applied to any Element and will by default generate a histogram for the first value dimension defined on the object it is applied to. As a simple example we can create an ``BoxWhisker`` Element containing samples from a normal distribution, and then apply the ``histogram`` operation to those samples in two ways: 1) by creating an instance on which we will change the ``num_bins`` and 2) by passing ``bin_range`` directly to the call of the operation:"
]
},
{
Expand All @@ -68,7 +68,7 @@
"source": [
"We can see that these two ways of using operations gives us convenient control over how the parameters are applied. An instance allows us to persist some defaults, while passing keyword argument to the operations applies the parameters for just that particular call to the operation.\n",
"\n",
"As the name implies ``ElementOperations`` are applied to individual Elements. This means that even when you apply an operation to a container object containing multiple Elements of one type, e.g. ``NdLayout``, ``GridSpace`` and ``HoloMap`` containers, the operation is applied per Element essentially mapping the operation over all Elements contained in the container object. As a simple example we can define a HoloMap of ``BoxWhisker`` Elements varying the width of the distribution by varying the ``sigma`` and then apply the histogram operation to it:"
"As the name implies ``ElementOperations`` are applied to individual Elements. This means that even when you apply an operation to a container object containing multiple Elements of one type, e.g. ``NdLayout``, ``GridSpace`` and ``HoloMap`` containers, the operation is applied per Element, essentially mapping the operation over all Elements contained in the container object. As a simple example we can define a HoloMap of ``BoxWhisker`` Elements by varying the width of the distribution via the ``Sigma`` value and then apply the histogram operation to it:"
]
},
{
Expand All @@ -86,7 +86,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As you can see the operation has generated a ``Histogram`` for each value of ``Sigma`` in the ``HoloMap``. In this way we can apply the operation to the entire parameter space defined by a ``HoloMap``, ``GridSpace`` and ``NdLayout``."
"As you can see the operation has generated a ``Histogram`` for each value of ``Sigma`` in the ``HoloMap``. In this way we can apply the operation to the entire parameter space defined by a ``HoloMap``, ``GridSpace``, and ``NdLayout``."
]
},
{
Expand Down Expand Up @@ -132,7 +132,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we will start applying some operations to this data. HoloViews ships with two inbuilt timeseries operations the ``rolling`` operation, which applies a function over a rolling window, and a ``rolling_outlier_std`` operation which computes outlier points in a timeseries by excluding points less than ``sigma`` standard deviation removed from the rolling mean:"
"Now we will start applying some operations to this data. HoloViews ships with two ready-to-use timeseries operations: the ``rolling`` operation, which applies a function over a rolling window, and a ``rolling_outlier_std`` operation that computes outlier points in a timeseries by excluding points less than ``sigma`` standard deviation removed from the rolling mean:"
]
},
{
Expand All @@ -157,9 +157,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we can define our own custom ElementOperation. If you recall from above, operations accept both Elements and Overlays. This means we can define a simple operation that takes our Overlay of the original and smoothed Curve Elements and subtracts one from the other. In this case this would get us the residual between smoothed and unsmoothed Curves.\n",
"We can now define our own custom ElementOperation, if we wish. If you recall from above, operations accept both Elements and Overlays. This means we can define a simple operation that takes our Overlay of the original and smoothed Curve Elements and subtracts one from the other. Such a subtraction will give us the residual between the smoothed and unsmoothed Curves, removing long-term trends and leaving the short-term variation.\n",
"\n",
"Defining an operation is very simple, an ElementOperation subclass should define a ``_process`` method, which accepts an ``element`` and an optional (and deprecated) ``key`` argument. Optionally we can also define parameters on the operation, which we can access using the ``self.p`` attribute on the operation. In this case we define a String type parameter, which will become the name of the subtracted value dimension on the returned Element."
"Defining an operation is very simple. An ElementOperation subclass should define a ``_process`` method, which accepts an ``element`` and an optional (and deprecated) ``key`` argument. Optionally we can also define parameters on the operation, which we can access using the ``self.p`` attribute on the operation. In this case we define a String-type parameter, which will become the name of the subtracted value dimension on the returned Element."
]
},
{
Expand Down Expand Up @@ -214,7 +214,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this view we can immediately see that only a very small residual is left when applying this level of smoothing. However we have only tried one particular ``rolling_window`` value, the default value of ``10``. To assess how this parameter affects the residual we can evaluate the operation for a number of different values."
"In this view we can immediately see that only a very small residual is left when applying this level of smoothing. However we have only tried one particular ``rolling_window`` value, the default value of ``10``. To assess how this parameter affects the residual we can evaluate the operation for a number of different values, as we do in the next section."
]
},
{
Expand All @@ -228,7 +228,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"When applying operation there are often various parameters to vary and using traditional plotting methods it's often difficult to evaluate them interactive to get an actual understanding of what they do. Here we will apply the ``rolling`` operations with varying ``rolling_window`` widths and ``window_type``s:"
"When applying an operation there are often various parameters to vary. Using traditional plotting methods it's often difficult to evaluate them interactively to get an detailed understanding of what they do. Here we will apply the ``rolling`` operations with varying ``rolling_window`` widths and ``window_type``s:"
]
},
{
Expand Down Expand Up @@ -268,15 +268,15 @@
"\n",
"## Benefits of using operations\n",
"\n",
"Now that we have seen some operations in action we can get some appreciation of what makes them useful. When working with data interactively you often end up doing a lot of data wrangling, which provides maximum flexibility but is not very reproducable and maintainable. Operations allow you to encapsulate analysis code using a well defined interface that is well suited towards building complex analysis pipelines\n",
"Now that we have seen some operations in action we can get some appreciation of what makes them useful. When working with data interactively you often end up doing a lot of data wrangling, which provides maximum flexibility but is neither reproducible nor maintainable. Operations allow you to encapsulate analysis code using a well defined interface that is well suited towards building complex analysis pipelines:\n",
"\n",
"1. Their parameters are well defined by declaring parameters on the class. These parameter also perform validation on the types or even ranges of the inputs.\n",
"1. Their parameters are well defined by declaring parameters on the class. These parameters also perform validation on the types and ranges of the inputs.\n",
"\n",
"2. Both the inputs and outputs of operations are visualizable, because the data **is** the visualization. This means you're not constantly context switching between data processing and visualization, you essentially get the visualization for free.\n",
"2. Both the inputs and outputs of operations are visualizable, because the data **is** the visualization. This means you're not constantly context switching between data processing and visualization---you essentially get the visualization for free.\n",
"\n",
"3. Operations understand HoloViews datastructures and can be applied to many Elements at once, allowing you to evaluate the operation with permutations of parameter values making it easier to assess what the parameters of the operation are actually doing and how it shapes your data.\n",
"3. Operations understand HoloViews datastructures and can be applied to many Elements at once, allowing you to evaluate the operation with permutations of parameter values. This flexibility makes it easier to assess what the parameters of the operation are actually doing and how they shape your data.\n",
"\n",
"4. As we will discover in the [Dynamic Operation Tutorial](Dynamic_Operations.ipynb) operations can be applied lazily specifying complex deferred data processing pipelines, which can aid your data exploration and drive your interactive visualizations and dashboards."
"4. As we will discover in the [Dynamic Operation Tutorial](Dynamic_Operations.ipynb), operations can be applied lazily to build up complex deferred data-processing pipelines, which can aid your data exploration and drive your interactive visualizations and dashboards."
]
}
],
Expand Down

0 comments on commit afda2fb

Please sign in to comment.