Chapter 7. Use machine learning features


You can distribute the training of a machine learning model across many CPUs by using by using Ray or the Training Operator.

7.1. Understand Feature Store concepts

Optionally, you can use a feature store to address common challenges in machine learning (ML) workflows. You can set up a local feature store with the fraud detection data set.

The Fraud Detection training notebook, 1_experiment_train.ipynb, loads features with the following code:

df = pd.read_csv('data/train.csv')
X_train = df.iloc[:, [1, 2, 4, 5, 6]].values

In the REST Inference for model server deployment notebook, 3_rest_requests.ipynb, the same features are manually constructed with the following code:

data = [0.3111400080477545, 1.9459399775518593, 1.0, 0.0, 0.0]

The notebooks use completely disconnected code paths for the same features. Consider the following scenario:

You want to add distance_from_home as a sixth feature to improve the model. You update the training notebook to include column index 0 in feature_indexes, retrain the model, and deploy it. But the inference code in 3_rest_requests.ipynb still sends only five values — nobody updated the feature vector construction there. The model now receives a [1, 5] shaped input when it expects [1, 6], and the REST call either crashes or silently maps the wrong values to the wrong features, producing incorrect fraud predictions in production.

This issue is an example of training/serving skew — a class of bugs where the features used during training differ from those used during inference. It is one of the most common and hardest-to-debug issues in production ML systems.

7.1.2. What is Feature Store?

Feature Store in Red Hat OpenShift AI is based on the Feast open-source project. The Feature Store central feature registry provides a single place to define, discover, and manage features. It offers the following capabilities:

  • Historical feature retrieval — Get point-in-time correct features for training.
  • Online feature serving — Get low-latency features for real-time inference.
  • Feature services — Curate different feature sets for different models or teams.

The following table describes the key Feature Store concepts used in this tutorial:

ConceptDescription

Entity

The key used to look up features (for example, a transaction ID or customer ID).

Feature View

A group of related features from a single data source.

Feature Service

A curated set of features for a specific model or use case.

Offline Store

Storage for historical feature data (used for training).

Online Store

Low-latency storage of the latest feature values (used for inference).

7.2. Set up a local feature store

In the Implementing features with Feature Store notebook, 8_feature_store_feast.ipynb, you use Feature Store in local mode, with a SQLite-based registry and online store and a file-based offline store, which requires no external infrastructure.

The Fraud Detection tutorial is not intended for a production environment. The 8_feature_store_feast.ipynb notebook uses local mode as a fully functional alternative.

For information on using Feature Store in a production environment, see Configuring Feature Store.

Prerequisites

  • You have imported the tutorial files into your JupyterLab environment as described in Import tutorial files.
  • You have run the 1_experiment_train.ipynb notebook and it produces the artifact/scaler.pkl.

Procedure

  1. In your JupyterLab environment, open the 8_feature_store_feast.ipynb file and follow the instructions in the notebook.

    The notebook guides you through the following tasks:

    1. Install the feast Python package.
    2. Prepare a 10,000-row data subset with entity IDs and timestamps (required by Feature Store).
    3. Configure a local Feature Store instance.
    4. Define feature views and a feature service.
    5. Apply the definitions to the Feature Store registry.
    6. Materialize features to the online store.
    7. Retrieve historical features (training use case) and verify data integrity.
    8. Retrieve online features (inference use case).
    9. Integrate Feature Store features with the fraud detection model.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top