tensorflow / tensorflow/probability
Components for individual features in LinearRegression and SparseLinearRegression
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Tensortflow STS (Structural Time Series) allows to decompose the time series or forecast using sts.decompose_forecast_by_component method. For a model where one of the components is a LinearRegresion (or SparseLinearRegression) with multiple features, the decomposition returns only one series for this component - is there a way to break it down into effects of individual features?
Example:
def build_sts_model(observed_time_series, price_time_series):
day_of_week_effect = sts.Seasonal(
num_seasons=7,
observed_time_series=observed_time_series,
name='day_of_week_effect')
price_effect = sts.SparseLinearRegression(
design_matrix=tf.reshape(price_time_series, (-1, k)),
name='price_effect')
model = sts.Sum([day_of_week_effect,
price_effect]
observed_time_series=observed_time_series)
return model
...
#
# Decomposition:
#
forecast_component_dists = sts.decompose_forecast_by_component(
demand_model,
forecast_dist=demand_forecast_dist,
parameter_samples=q_samples_demand_)
#
# returns one series fo all features combined,
# but how to get individual features?
#
forecast_component_dists['price_effect'].mean()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sts.decompose_forecast_by_component and the LinearRegression and SparseLinearRegression components used in the example. Determine whether decomposition can expose separate effects for each design-matrix feature rather than one combined series. Done means individual feature forecast series are available for the regression component.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100