Documentation ¶
Index ¶
- Variables
- type AllWeights
- type CategoricalFeature
- type ComponentModelWeights
- type ExponentialPredictor
- type LinearPredictor
- type LogarithmicPredictor
- type LogisticPredictor
- type ModelRequest
- type ModelWeights
- type NormalizedNumericalFeature
- type Predictor
- func NewExponentialPredictor(weight ModelWeights) (predictor Predictor, err error)
- func NewLinearPredictor(weight ModelWeights) (predictor Predictor, err error)
- func NewLogarithmicPredictor(weight ModelWeights) (predictor Predictor, err error)
- func NewLogisticPredictor(weight ModelWeights) (predictor Predictor, err error)
- type Regressor
- func (r *Regressor) AddDesiredOutValue(y float64)
- func (r *Regressor) AddNodeFeatureValues(x []float64)
- func (r *Regressor) AddProcessFeatureValues(x []float64)
- func (r *Regressor) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
- func (r *Regressor) GetGPUPower(isIdlePower bool) ([]float64, error)
- func (r *Regressor) GetModelType() types.ModelType
- func (r *Regressor) GetNodeFeatureNamesList() []string
- func (r *Regressor) GetPlatformPower(isIdlePower bool) ([]float64, error)
- func (r *Regressor) GetProcessFeatureNamesList() []string
- func (r *Regressor) IsEnabled() bool
- func (r *Regressor) ResetSampleIdx()
- func (r *Regressor) Start() error
- func (r *Regressor) Train() error
Constants ¶
This section is empty.
Variables ¶
var (
ErrModelWeightsInvalid = fmt.Errorf("ModelWeights is invalid")
)
Functions ¶
This section is empty.
Types ¶
type AllWeights ¶
type AllWeights struct { CategoricalVariables map[string]map[string]CategoricalFeature `json:"Categorical_Variables"` NumericalVariables map[string]NormalizedNumericalFeature `json:"Numerical_Variables"` BiasWeight float64 `json:"Bias_Weight,omitempty"` CurveFitWeights []float64 `json:"CurveFit_Weights,omitempty"` }
type CategoricalFeature ¶
type CategoricalFeature struct {
Weight float64 `json:"weight"`
}
type ComponentModelWeights ¶
type ComponentModelWeights map[string]ModelWeights
type ExponentialPredictor ¶
type ExponentialPredictor struct {
ModelWeights
}
type LinearPredictor ¶
type LinearPredictor struct {
ModelWeights
}
type LogarithmicPredictor ¶
type LogarithmicPredictor struct {
ModelWeights
}
type LogisticPredictor ¶
type LogisticPredictor struct {
ModelWeights
}
type ModelRequest ¶
type ModelRequest struct { MetricNames []string `json:"metrics"` OutputType string `json:"output_type"` EnergySource string `json:"source"` NodeType int `json:"node_type"` Weight bool `json:"weight"` TrainerName string `json:"trainer_name"` SelectFilter string `json:"filter"` }
ModelRequest defines a request to Kepler Model Server to get model weights
type ModelWeights ¶
type ModelWeights struct {
AllWeights `json:"All_Weights"`
}
type Predictor ¶
type Predictor interface {
// contains filtered or unexported methods
}
Predictor defines required implementation for power prediction
func NewExponentialPredictor ¶
func NewExponentialPredictor(weight ModelWeights) (predictor Predictor, err error)
func NewLinearPredictor ¶
func NewLinearPredictor(weight ModelWeights) (predictor Predictor, err error)
NewLinearPredictor creates a new LinearPredictor instance with the provided ModelWeights
func NewLogarithmicPredictor ¶
func NewLogarithmicPredictor(weight ModelWeights) (predictor Predictor, err error)
func NewLogisticPredictor ¶
func NewLogisticPredictor(weight ModelWeights) (predictor Predictor, err error)
type Regressor ¶
type Regressor struct { ModelServerEndpoint string OutputType types.ModelOutputType EnergySource string TrainerName string SelectFilter string ModelWeightsURL string ModelWeightsFilepath string FloatFeatureNames []string SystemMetaDataFeatureNames []string SystemMetaDataFeatureValues []string // contains filtered or unexported fields }
Regressor defines power estimator with regression approach
func (*Regressor) AddDesiredOutValue ¶
AddDesiredOutValue adds the the y, which is the response variable (or the dependent variable) of regression. Regressor is trained off-line then we do not add Y for trainning. We might implement it in the future.
func (*Regressor) AddNodeFeatureValues ¶
AddNodeFeatureValues adds the the x for prediction, which is the variable used to calculate the ratio. Regressor is not trained, then we cannot Add training samples, only samples for prediction. The Regressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*Regressor) AddProcessFeatureValues ¶
AddProcessFeatureValues adds the the x for prediction, which are the explanatory variables (or the independent variable) of regression. Regressor is trained off-line then we cannot Add training samples. We might implement it in the future. The Regressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*Regressor) GetComponentsPower ¶
func (r *Regressor) GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
GetComponentsPower applies each component's ModelWeight prediction and return a map of component power associated to each process/process/pod
func (*Regressor) GetGPUPower ¶
GetComponentsPower returns GPU Power in Watts associated to each each process
func (*Regressor) GetModelType ¶
GetModelType returns the model type
func (*Regressor) GetNodeFeatureNamesList ¶
GetNodeFeatureNamesList returns the list of float features that the model was configured to use The Regressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*Regressor) GetPlatformPower ¶
GetPlatformPower applies ModelWeight prediction and return a list of power associated to each process/process/pod
func (*Regressor) GetProcessFeatureNamesList ¶
GetProcessFeatureNamesList returns the list of float features that the model was configured to use The Regressor does not differentiate node or process power estimation, the difference will only be the amount of resource utilization
func (*Regressor) ResetSampleIdx ¶
func (r *Regressor) ResetSampleIdx()
ResetSampleIdx set the sample vector index to 0 to overwrite the old samples with new ones for trainning or prediction.