pytorch_tabular
v1.1.1


Pytorch表格旨在通过表格数据和研究案例和研究都可以易于访问,以使其深入学习。图书馆设计背后的核心原则是:
它是在Pytorch (显然)和Pytorch Lightning等巨人的肩膀上建造的。
尽管安装包括Pytorch,但最好和推荐的方法是首先从此处安装Pytorch,为您的计算机拾取正确的CUDA版本。
有一次,您已经安装了Pytorch,只需使用:
pip install -U “pytorch_tabular[extra]”要安装具有额外依赖性的完整库(权重和偏见和情节)。
和 :
pip install -U “pytorch_tabular”对于裸露的必需品。
可以从Github repo _下载pytorch_tabular的来源。
您可以克隆公共存储库:
git clone git://github.com/manujosephv/pytorch_tabular一旦获得了源的副本,就可以安装它:
cd pytorch_tabular && pip install .[extra]有关教程的完整文档,请访问readthedocs
半监督学习
要实现新模型,请参见如何实现新模型教程。它涵盖了基本和高级体系结构。
from pytorch_tabular import TabularModel
from pytorch_tabular . models import CategoryEmbeddingModelConfig
from pytorch_tabular . config import (
DataConfig ,
OptimizerConfig ,
TrainerConfig ,
ExperimentConfig ,
)
data_config = DataConfig (
target = [
"target"
], # target should always be a list.
continuous_cols = num_col_names ,
categorical_cols = cat_col_names ,
)
trainer_config = TrainerConfig (
auto_lr_find = True , # Runs the LRFinder to automatically derive a learning rate
batch_size = 1024 ,
max_epochs = 100 ,
)
optimizer_config = OptimizerConfig ()
model_config = CategoryEmbeddingModelConfig (
task = "classification" ,
layers = "1024-512-512" , # Number of nodes in each layer
activation = "LeakyReLU" , # Activation between each layers
learning_rate = 1e-3 ,
)
tabular_model = TabularModel (
data_config = data_config ,
model_config = model_config ,
optimizer_config = optimizer_config ,
trainer_config = trainer_config ,
)
tabular_model . fit ( train = train , validation = val )
result = tabular_model . evaluate ( test )
pred_df = tabular_model . predict ( test )
tabular_model . save_model ( "examples/basic" )
loaded_model = TabularModel . load_model ( "examples/basic" )马努·约瑟夫 | Jirka Borovec | Jinu Sunil | ProgramAdor人工 | 索伦·麦克白 | 克里斯·富恩斯贝克(Chris Fonnesbeck) |
Snehil Chatterjee | 无效的 | Abhishar Sinha | 安德烈亚斯 | 合伙人Chugh | 厄利 |
无效的 | Kushashwa Ravi Shrimali | 卢卡·阿蒂斯·格罗索(Luca Actis Grosso) | Sterling G. Baird | 泰克·孟 | Yinyu Nie |
Yonybresler | 刘Zhen |
如果您使用Pytorch表格进行科学出版物,我们将感谢已发表的软件和以下论文的引用:
@misc{joseph2021pytorch,
title={PyTorch Tabular: A Framework for Deep Learning with Tabular Data},
author={Manu Joseph},
year={2021},
eprint={2104.13638},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
@software{manu_joseph_2023_7554473,
author = {Manu Joseph and
Jinu Sunil and
Jiri Borovec and
Chris Fonnesbeck and
jxtrbtk and
Andreas and
JulianRein and
Kushashwa Ravi Shrimali and
Luca Actis Grosso and
Sterling G. Baird and
Yinyu Nie},
title = {manujosephv/pytorch_tabular: v1.0.1},
month = jan,
year = 2023,
publisher = {Zenodo},
version = {v1.0.1},
doi = {10.5281/zenodo.7554473},
url = {https://doi.org/10.5281/zenodo.7554473}
}