Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type ActionReward
- type BatchAdviceFile
- type Campaign
- type CbAction
- type CbContextExample
- type CbLabel
- type CbPrediction
- type CbRewardExample
- type CbSample
- type CcbContextExample
- type CcbRewardExample
- type Feature
- type LearningParameters
- type ModelPaths
- type Policy
- type Slot
Constants ¶
View Source
const ( Numeric = "numeric" Category = "category" Text = "text" MissingPrefix = "_missing_" MissingNumeric = "0" MissingCategory = "_unknown_" )
Variables ¶
View Source
var ActionError = errors.New("action not found")
View Source
var ErrInvalidIncludedActions = fmt.Errorf("slot included action id that was not in the action set")
View Source
var InvalidBitSize = fmt.Errorf("invalid learning rate, learning rate must be above 10")
View Source
var InvalidCbType = fmt.Errorf("invalid CbType")
View Source
var InvalidLearningRate = fmt.Errorf("invalid learning rate, learning rate must be above 0")
View Source
var InvalidSeed = fmt.Errorf("invalid seed, seed must be a 32 bit integer")
View Source
var ValidCBTypes = map[string]struct{}{
"mtr": {},
"dr": {},
"dm": {},
"ips": {},
}
Functions ¶
This section is empty.
Types ¶
type ActionReward ¶
type BatchAdviceFile ¶
type BatchAdviceFile struct { Id int `json:"id"` CampaignId int `json:"campaign_id" binding:"required"` Name string `json:"name" binding:"required"` Status string `json:"status"` Reason string `json:"reason"` AdviceRequestCount int `json:"advice_request_count"` RewardReceivedCount int `json:"reward_received_count"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
type Campaign ¶
type Campaign struct { Id int `json:"id,omitempty"` Name string `json:"name" binding:"required"` Description string `json:"description"` Status string `json:"status"` AdviceTimeout string `json:"advice_timeout" binding:"required"` TrainingInterval string `json:"training_interval"` CacheAdvice bool `json:"cache_advice"` RuntimeActions bool `json:"runtime_actions"` HoldoutPercent float64 `json:"holdout_percent"` PredictionType string `json:"prediction_type"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
type CbContextExample ¶
func (CbContextExample) Format ¶
func (cex CbContextExample) Format() ([]string, error)
type CbPrediction ¶
type CbRewardExample ¶
type CbRewardExample struct { CampaignFeatures []Feature `json:"campaign_features"` Actions []Action `json:"actions"` ActionReward ActionReward `json:"action_reward"` }
func (CbRewardExample) Format ¶
func (rex CbRewardExample) Format() ([]string, error)
Example Format: https://vowpal-wabbit-next.readthedocs.io/en/v0.5.0/tutorials/contextual_bandit_content_personalization.html
type CcbContextExample ¶
func (CcbContextExample) Format ¶
func (cex CcbContextExample) Format() ([]string, error)
Format based on https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Conditional-Contextual-Bandit
type CcbRewardExample ¶
type CcbRewardExample struct { CampaignFeatures []Feature `json:"campaign_features"` Actions []Action `json:"actions"` ActionRewards []ActionReward `json:"action_rewards"` }
func (CcbRewardExample) Format ¶
func (rex CcbRewardExample) Format() ([]string, error)
type LearningParameters ¶
type LearningParameters struct { LearningRate float64 `json:"learning_rate"` CbType string `json:"cb_type"` Interactions string `json:"interactions"` BitSize int `json:"bit_size"` Seed int32 `json:"seed"` }
func (*LearningParameters) HandleDefaults ¶
func (lp *LearningParameters) HandleDefaults(banditType string)
func (*LearningParameters) Validate ¶
func (lp *LearningParameters) Validate() error
type ModelPaths ¶
Click to show internal directories.
Click to hide internal directories.