本文整理汇总了Python中dataset.Dataset.load方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.load方法的具体用法?Python Dataset.load怎么用?Python Dataset.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Dataset
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import load [as 别名]
import numpy
from matplotlib import pyplot
import pycwt as wavelet
from pycwt.helpers import find
from dataset import Dataset
# Here we use the dataset class to load the data. Valid datasets are either
# NINO3, MAUNA, MONSOON, SUNSPOTS or SOI. If your `matplotlib` allows LaTeX
# text formatting, change the `usetex` parameter to `True`.
sample = 'NINO3'
usetex = True
ds = Dataset(sample, usetex=usetex)
dat = ds.load()
avg1, avg2 = (2, 8) # Range of periods to average
slevel = 0.95 # Significance level
std = dat.std() # Standard deviation
std2 = std ** 2 # Variance
dat = (dat - dat.mean()) / std # Calculating anomaly and normalizing
N = dat.size # Number of measurements
time = numpy.arange(0, N) * ds.dt + ds.t0 # Time array in years
dj = 1 / 12 # Twelve sub-octaves per octaves
s0 = -1 # 2 * dt # Starting scale, here 6 months
J = -1 # 7 / dj # Seven powers of two with dj sub-octaves
# alpha = 0.0 # Lag-1 autocorrelation for white noise
示例2: Dataset
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import load [as 别名]
import numpy as np
import datetime
import argparse
from dataset import Dataset
parser = argparse.ArgumentParser(description='nagadomi-coupon-purchase-prediction-solution')
parser.add_argument('--seed', '-s', default=71, type=int,
help='Random seed')
parser.add_argument('--validation', '-v', action="store_true",
help='Validation mode')
args = parser.parse_args()
np.random.seed(args.seed)
dataset = Dataset(datadir="data")
if args.validation:
valid_days = datetime.timedelta(days=7*4)
dataset.load(validation_timedelta=valid_days)
dataset.save_pkl("data/valid_28.pkl")
else:
dataset.load()
dataset.save_pkl("data/all_data.pkl")