Jupyter Notebook 中 'out' 的含义及代码注释
out 指的是这段代码的输出结果。
这段代码首先使用 GroupShuffleSplit 将数据集分成训练集和验证集,train_size=0.80 表示训练集占 80%。
# train-val split
gss = GroupShuffleSplit(n_splits=1, train_size=0.80, random_state=42)
# generate the train/val for *each* sample -> for that we iterate over the train and val units we want
# this is a for that iterates only once and in that iterations at the same time iterates over all the values we want,
# i.e. train_unit and val_unit are not a single value but a set of training/vali units
然后使用 exponential_smoothing 对训练集和测试集进行指数平滑处理,sensors 表示传感器的数量,0 表示要处理的是第一个传感器,alpha 是平滑系数。
# exponential smoothing
X_train_pre= exponential_smoothing(X_train_pre, sensors, 0, alpha)
X_test_pre = exponential_smoothing(X_test_pre, sensors, 0, alpha)
原文地址: https://www.cveoy.top/t/topic/jPed 著作权归作者所有。请勿转载和采集!