algo.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Smart-Grid-Analytics 作者: Merit-Research 项目源码 文件源码
def __init__(self, num_features, training_window, training_interval):
        """
        num_features: the length of the feature vector
        training_window: the number of previous data points to train on
        training_interval: the number of data points between training periods
        """
        self.num_features = num_features
        self.training_interval = training_interval
        self.training_window = training_window

        # Init sample matrix, a deque of feature vectors
        self.samples = deque(maxlen=training_window)
        self.targets = deque(maxlen=training_window)

        #self.model = SVR(kernel='rbf', C=1000)
        self.model = BayesianRidge()
        self.severity = blr.Severity()
        self.alpha = 1.0
        self.parameters = 0     # Training parameters
        self.train_count = 0
        self.have_trained = False
        self.pred_range = [0.0, np.inf]   # upper and lower bounds for predictions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号