Skip to content

Commit 033344a

Browse files
authored
Merge pull request #10 from manujosephv/develop
-- added documentation
2 parents 5ea29cb + 5e79fa4 commit 033344a

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

docs/history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ History
2525
- Refactored the classes to separate backbones from the head of the models
2626
- Changed the saving and loading model to work for custom parameters that you pass in `fit`
2727

28+
0.5.0 (2021-03-18)
29+
------------------
30+
- Added more documentation
31+
- Added Zenodo citation

docs/other_features.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
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
2+
3+
## Categorical Embeddings
4+
5+
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.
6+
7+
### Usage Example
8+
9+
```python
10+
# passing the trained model as an argument
11+
transformer = CategoricalEmbeddingTransformer(tabular_model)
12+
# passing the train dataframe to extract the embeddings and replace categorical features
13+
# defined in the trained tabular_model
14+
train_transformed = transformer.fit_transform(train)
15+
# using the extracted embeddings on new dataframe
16+
val_transformed = transformer.transform(val)
17+
```
18+
19+
## Feature Extractor
20+
21+
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.
22+
23+
```python
24+
# passing the trained model as an argument
25+
dt = DeepFeatureExtractor(tabular_model)
26+
# passing the train dataframe to extract the last layer features
27+
# here `fit` is there only for compatibility and does not do anything
28+
enc_df = dt.fit_transform(train)
29+
# using the extracted embeddings on new dataframe
30+
val_transformed = transformer.transform(val)
31+
```

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
site_name: PyTorch Tabular
22
nav:
33
- Getting Started:
4-
- " ": index.md
4+
- "PyTorch Tabular": index.md
55
- Tutorials:
66
- Basic Usage: "tutorials/01-Basic_Usage.ipynb"
77
- Advanced Usage: "tutorials/02-Advanced_Usage.ipynb"
@@ -18,6 +18,8 @@ nav:
1818
- Experiment Tracking: experiment_tracking.md
1919
- Tabular Model:
2020
- TabularModel: tabular_model.md
21+
- Other Features:
22+
- "Other Features": other_features.md
2123
# - FAQ: faq.md
2224
- API:
2325
- API: apidocs.md

0 commit comments

Comments
 (0)