Elasticsearch can be easily integrated with many Python machine learning libraries. One of the most used libraries for works with datasets is NumPy—a NumPy array is a building block dataset for many Python machine learning libraries. In this recipe will we seen how it's possible to use Elasticsearch as dataset for the scikit-learn library (https://scikit-learn.org/).
Integrating with NumPy and scikit-learn
Getting ready
You need an up and running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
The code for this recipe is in the ch15/code directory and the file used in the following section is the kmeans_example.py.
We will use the...