diff --git a/docs/history.md b/docs/history.md index b1bbda0d..d81bdef5 100644 --- a/docs/history.md +++ b/docs/history.md @@ -25,3 +25,7 @@ History - Refactored the classes to separate backbones from the head of the models - Changed the saving and loading model to work for custom parameters that you pass in `fit` +0.5.0 (2021-03-18) +------------------ +- Added more documentation +- Added Zenodo citation diff --git a/docs/other_features.md b/docs/other_features.md new file mode 100644 index 00000000..60b953ff --- /dev/null +++ b/docs/other_features.md @@ -0,0 +1,31 @@ +Apart from training and using Deep Networks for tabular data, PyTorch Tabular also has some cool features which can help your classical ML/ sci-kit learn pipelines + +## Categorical Embeddings + +The CategoryEmbedding Model can also be used as a way to encode your categorical columns. instead of using a One-hot encoder or a variant of TargetMean Encoding, you can use a learned embedding to encode your categorical features. And all this can be done using a scikit-learn style Transformer. + +### Usage Example + +```python +# passing the trained model as an argument +transformer = CategoricalEmbeddingTransformer(tabular_model) +# passing the train dataframe to extract the embeddings and replace categorical features +# defined in the trained tabular_model +train_transformed = transformer.fit_transform(train) +# using the extracted embeddings on new dataframe +val_transformed = transformer.transform(val) +``` + +## Feature Extractor + +What if you want to use the features learnt by the Neural Network in your ML model? Pytorch Tabular let's you do that as well, and with ease. Again, a scikit-learn style Transformer does the job for you. + +```python +# passing the trained model as an argument +dt = DeepFeatureExtractor(tabular_model) +# passing the train dataframe to extract the last layer features +# here `fit` is there only for compatibility and does not do anything +enc_df = dt.fit_transform(train) +# using the extracted embeddings on new dataframe +val_transformed = transformer.transform(val) +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index b83f3e17..96433650 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ site_name: PyTorch Tabular nav: - Getting Started: - - " ": index.md + - "PyTorch Tabular": index.md - Tutorials: - Basic Usage: "tutorials/01-Basic_Usage.ipynb" - Advanced Usage: "tutorials/02-Advanced_Usage.ipynb" @@ -18,6 +18,8 @@ nav: - Experiment Tracking: experiment_tracking.md - Tabular Model: - TabularModel: tabular_model.md + - Other Features: + - "Other Features": other_features.md # - FAQ: faq.md - API: - API: apidocs.md