【问题标题】:Looking for documentation on ‘path’ argument in TabularDataBunch.from_df()在 TabularDataBunch.from_df() 中查找有关“路径”参数的文档
【发布时间】:2019-01-15 15:26:38
【问题描述】:

我不确定我是否理解 Python 3.6 中 fast.ai 库的 TabularDataBunch.from_df(path=path,df=df,...)path(强制)参数的目的。

我检查了documentation,但似乎找不到那里的详细信息。 特别是,我有一个pd.DataFrame,它在磁盘上没有关联的 CSV 文件。我该如何去应用.from_df 方法呢?

有没有人有更多信息或参考链接?

【问题讨论】:

    标签: python-3.x categorical-data embedding fast-ai


    【解决方案1】:

    找到一个example here that helped,路径值为'output'。此外,the fast.ai lecture 4 video (43rd minute)path 定义为输出结果的输出位置。

    df = pd.DataFrame({'A': list('aabbccabca'), 'B': np.random.normal(size=10).round(2), 'Y': list('aabbccabca')})
    tfms = [Categorify]
    tblrData = TabularDataBunch.from_df('output', df, dep_var='Y', valid_idx=[7,8], procs=tfms, cat_names=['A'], bs=4)
    (cat_x,cont_x),y = next(iter(tblrData.train_dl))
    for o in (cat_x, cont_x, y): print(to_np(o[:5]))
    

    bs 是这里的批量大小参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-30
      • 2016-03-12
      • 2017-06-02
      • 2010-10-18
      • 1970-01-01
      相关资源
      最近更新 更多