Documentation ¶
Index ¶
- func GetModels(ctx context.Context, suPath, nsPath, sdPath string) (map[string]*firestore.DocumentSnapshot, error)
- func LookupStreakPick(ctx context.Context, picker, season *firestore.DocumentRef, week int) (*bpefs.StreakPick, error)
- func PickEm(ctx context.Context, m PubSubMessage) error
- type Model
- type PickEmMessage
- type PubSubMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModels ¶
func GetModels(ctx context.Context, suPath, nsPath, sdPath string) (map[string]*firestore.DocumentSnapshot, error)
GetModels returns the model requested by the given identifier string, or the most conservative model if an empty path is given.
func LookupStreakPick ¶
func LookupStreakPick(ctx context.Context, picker, season *firestore.DocumentRef, week int) (*bpefs.StreakPick, error)
LookupStreakPick looks up the streak pick for a picker in Firestore
Types ¶
type Model ¶
type Model struct { Performance bpefs.ModelPerformance Predictions []bpefs.Prediction Distribution distuv.Normal PredictionRefs []*firestore.DocumentRef // contains filtered or unexported fields }
Model is a collection of performance metrics, predictions, and a distribution.
func (*Model) Lookup ¶
func (m *Model) Lookup(home, road *firestore.DocumentRef) (*bpefs.Prediction, *firestore.DocumentRef, bool, error)
Lookup prediction by home and road teams, and whether or not to swap them for the slate.
type PickEmMessage ¶
type PickEmMessage struct { // Slate is the path to a parsed slate in Firestore Slate string `json:"slate"` // Picker is the path to a picker in Firestore Picker string `json:"picker"` // StraightModel is a path to a model to use when picking striaght-up picks (empty value means use the best model possible) StraightModel string `json:"straightModel"` // NoisySpreadModel is a path to a model to use when picking noisy spread picks (empty value means use the best model possible) NoisySpreadModel string `json:"noisySpreadModel"` // SuperdogModel is a path to a model to use when picking superdog picks (empty value means use the best model possible) SuperdogModel string `json:"superdogModel"` // DryRun tells the code to print what would be written, but not two create the excel output. DryRun bool `json:"dryrun,omitempty"` }
PickEmMessage tells the function what to pick and for whom.
type PubSubMessage ¶
type PubSubMessage struct {
Data []byte `json:"data"`
}
PubSubMessage is the payload of a Pub/Sub event.
Click to show internal directories.
Click to hide internal directories.