Documentation
¶
Overview ¶
Package features provides utilities for building feature frames from raw metric data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillMissingValues ¶
func FillMissingValues(frame models.FeatureFrame) models.FeatureFrame
FillMissingValues fills missing values in a FeatureFrame using forward fill strategy. For each feature column, missing values (represented as NaN or not present) are replaced with the last valid value seen.
This is a simple implementation for v0.1. More sophisticated imputation strategies (mean, interpolation) can be added later if needed.
Types ¶
type Builder ¶
type Builder struct{}
Builder constructs feature frames from DataFrames, extracting time-based features and transforming raw metric data into a format suitable for forecasting models.
func (*Builder) BuildFeatures ¶
BuildFeatures converts a DataFrame from an adapter into a FeatureFrame for a model. It extracts the following features from each row:
- value: the metric value (required)
- timestamp: Unix timestamp in seconds (extracted from "ts" field if present)
- hour: hour of day (0-23) extracted from timestamp
- day: day of week (0-6, Sunday=0) extracted from timestamp
Rows without a "value" field are skipped. If "ts" field is missing, features derived from timestamps are not included.