Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/en/stack/ml/dataframes.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[[ml-dataframes]]
=== {dataframes-cap}

beta[]

A _{dataframe}_ is a transformation of a dataset by certain rules. You can think
of it like a spreadsheet or a data table that makes your data ready to be analyzed
and organized.

A lot of {es} datasets are organized as a stream of events: each event is a individual
document, e.g. a single item purchase. {dataframe-cap} pivots allow you to summarize
Comment thread
szabosteve marked this conversation as resolved.
Outdated
this data, bringing it into an organized, more analysis friendly format, e.g.
Comment thread
szabosteve marked this conversation as resolved.
Outdated
summarizing all purchases of a single customer (see the example below).
Comment thread
szabosteve marked this conversation as resolved.
Outdated

The {dataframe} feature enables you to define a _pivot_ which is a set of features
that transform the dataset into a different, more digestible format. Pivoting
results in a summary of your dataset (which is the {dataframe} itself).

Defining a pivot consist of two main parts. First, you select one or more fields
that your dataset will be grouped by. Principally you can select categorical
fields (terms) for grouping. You can also select numerical fields, in this case,
the field values will be bucketed using an interval you specify.

The second step is deciding how you want to aggregate the grouped data. When
using aggregations, you practically ask questions about the dataset. There are
different types of aggregations, each with its own purpose and output. You can
Comment thread
szabosteve marked this conversation as resolved.
Outdated
learn more about the supported aggregations and group-by fields
Comment thread
szabosteve marked this conversation as resolved.
Outdated
{ref}/data-frame-transform-pivot.html[here].
Comment thread
szabosteve marked this conversation as resolved.
Outdated

As an optional step, it's also possible to add a query to further limit the
scope of the aggregation.

IMPORTANT: In 7.2, you can build {dataframes} on the top of a static dataset.
Comment thread
szabosteve marked this conversation as resolved.
When new data comes into the index, you have to perform the transformation again
on the altered data.

.Example

Imagine that you run a webshop that sells clothes. Every order creates a
document that contains a unique order ID, the name and the category of the
ordered product, its price, the ordered quantity, the exact date of the order,
and some customer information (name, gender, location, etc). Your dataset
contains all the transactions from last year.

If you want to check the sales in the different categories in your last fiscal year,
define a {dataframe} that is grouped by the product categories (women's shoes, men's
clothing, etc.) and the order date histogram with the interval of the last year,
Comment thread
szabosteve marked this conversation as resolved.
Outdated
then set a sum aggregation on the ordered quantity. The result is a {dataframe}
pivot that shows the number of sold items in every product category in the last
year.

Comment thread
szabosteve marked this conversation as resolved.
IMPORTANT: Creating a {dataframe} leaves your source index intact. A new index will
be created dedicated to the {dataframe}.

TIP: Using {dataframes} does not require {dfeeds}.
1 change: 1 addition & 0 deletions docs/en/stack/ml/overview.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ include::buckets.asciidoc[]
include::calendars.asciidoc[]
include::rules.asciidoc[]
include::architecture.asciidoc[]
include::dataframes.asciidoc[]