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}
}