SignalPipelineΒΆ
Defined in fynance.signal
- class SignalPipeline(model, mapper, mapper_kwargs=None)[source]
Bases:
objectA
SignalModelplus a position mapper.Wraps a model exposing
fit/predictand a mapper turning predictions into positions, exposingpredict_position.- Parameters:
- modelSignalModel
Object with
fit(X, y)andpredict(X).- mappercallable
Function mapping a prediction array to positions (e.g.
fynance.signal.sign).- mapper_kwargsdict, optional
Extra keyword arguments forwarded to
mapper.
- fit(X, y)[source]
Fit the underlying model and return
self.
- predict(X)[source]
Return the raw model predictions.
- predict_position(X)[source]
Predict, then map predictions to positions.