model_fit_history.py 文件源码

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

项目:Exoplanet-Artificial-Intelligence 作者: pearsonkyle 项目源码 文件源码
def load_data(fname='transit_data.pkl',categorical=False,whiten=True,DIR='pickle_data/'):

    data = pickle.load(open(DIR+fname,'rb'))

    # convert to numpy array fo float type from object type
    pvals = arr(data['results'][:,0])
    transits = arr(data['results'][:,1])
    null = arr(data['results'][:,2])

    X = np.vstack([transits,null])
    y = np.hstack([np.ones(transits.shape[0]), np.zeros(null.shape[0])] )

    if categorical: y = np_utils.to_categorical(y, np.unique(y).shape[0] )
    if whiten: X = preprocessing.scale(X,axis=1)

    return X,y,pvals,data['keys'],data['time']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号