Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend_features functionality #5

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
787e0cd
Update kingcrab.py
sgbaird Feb 9, 2022
ccbdd87
incorporate extend_features
sgbaird Feb 9, 2022
a808a55
fix extend_features logic
sgbaird Feb 9, 2022
eb450d0
add `extend_features` documentation
sgbaird Feb 9, 2022
139830d
Update README.md
sgbaird Feb 9, 2022
261fa7c
Create extend_features_compare.py
sgbaird Feb 19, 2022
903e0df
remove redundancy
sgbaird Feb 19, 2022
1544967
allow column mapper in groupby_formula and data
sgbaird Feb 19, 2022
1125e70
Update extend_features_compare.py
sgbaird Feb 19, 2022
2b2621d
Improved documentation
Feb 19, 2022
a22d6e6
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
Feb 19, 2022
982688f
Update extend_features_compare.py
sgbaird Feb 19, 2022
6c146dd
number of elements was hard-coded, fix
sgbaird Feb 19, 2022
59a907e
Update kingcrab.py
sgbaird Feb 19, 2022
8b7bb73
Update extend_features_compare.py
sgbaird Feb 19, 2022
15932be
extend_features crabnet vs. xgboost
sgbaird Feb 19, 2022
a64cfaf
Revert "extend_features crabnet vs. xgboost"
sgbaird Feb 19, 2022
5bbd269
save in extend_features dir
sgbaird Feb 19, 2022
c55027d
Update .gitignore
sgbaird Feb 19, 2022
4debf3b
expose groupby arg and set to False
sgbaird Feb 19, 2022
8d8b58c
without xgboost hyperopt, extend features comparison figures, results
sgbaird Feb 19, 2022
21861ca
without load comparison (figures)
sgbaird Feb 19, 2022
b8257b4
xgboost
sgbaird Feb 19, 2022
ea10fe3
Added Network for Feature Agnostic Transfer Learning
Feb 19, 2022
9143e77
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
Feb 19, 2022
ee6ec94
Update extend_features_compare.py
sgbaird Feb 19, 2022
96d711c
Implemented Extended Transfer Method
Feb 19, 2022
5331081
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
Feb 19, 2022
cab73f2
Create crabnet_.py
sgbaird Feb 19, 2022
4852878
Update test_crabnet.py
sgbaird Feb 19, 2022
5005541
Create test_crabnet_.py
sgbaird Feb 19, 2022
e645585
Update train_crabnet.py
sgbaird Feb 19, 2022
c48cfcd
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
sgbaird Feb 19, 2022
2634c78
Update test_crabnet.py
sgbaird Feb 19, 2022
f69a758
Update test_crabnet.py
sgbaird Feb 19, 2022
303d905
fixed model overwriting issues
Feb 19, 2022
7892dc8
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
Feb 19, 2022
5f2d0a4
Update test_crabnet.py
sgbaird Feb 19, 2022
85105dc
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
sgbaird Feb 19, 2022
5412b69
Update crabnet_.py
sgbaird Feb 19, 2022
9e0021a
Update crabnet_.py
sgbaird Feb 20, 2022
de617e0
rename submodel to _CrabNet
sgbaird Feb 20, 2022
3570c64
Update model.py
sgbaird Feb 20, 2022
1021fd3
Update test_crabnet.py
sgbaird Feb 20, 2022
dc1f2a2
Update test_crabnet_.py
sgbaird Feb 20, 2022
760b78d
_CrabNet
sgbaird Feb 20, 2022
d35c968
Update .gitignore
sgbaird Feb 20, 2022
21753c5
uncomment extend_transfer
sgbaird Feb 20, 2022
c3de661
Update crabnet_.py
sgbaird Feb 20, 2022
123036f
_CrabNet
sgbaird Feb 20, 2022
613a4bd
Revert "uncomment extend_transfer"
Feb 20, 2022
068de57
Merge branch 'extend_features' of https://github.com/sgbaird/CrabNet …
Feb 20, 2022
6b9baf3
Revert "_CrabNet"
Feb 20, 2022
0ffdaa3
Revert "Update .gitignore"
Feb 20, 2022
d15ea70
Revert "_CrabNet"
Feb 20, 2022
4d88736
Revert "Update test_crabnet_.py"
Feb 20, 2022
906a550
Revert "Update test_crabnet.py"
Feb 20, 2022
df2eb83
Revert "Update model.py"
Feb 20, 2022
cf4273f
Revert "rename submodel to _CrabNet"
Feb 20, 2022
0efb9c8
Adjusting model call
Feb 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,5 @@ model_predictions/example_materials_property_train_output.csv
model_predictions/example_materials_property_val_output.csv
figures/lc_data/DataFrame_property_lc.png
scratch/
results/predicted_hv.csv
.DS_Store
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This software package implements the Compositionally-Restricted Attention-Based

> :warning: This is a fork of the [original CrabNet repository](https://github.com/anthony-wang/CrabNet) :warning:

This is a refactored version of CrabNet, published to PyPI (`pip`) and Anaconda (`conda`). In addition to using `.csv` files, it allows direct passing of Pandas DataFrames as training and validation datasets, similar to [automatminer](https://hackingmaterials.lbl.gov/automatminer/). It also exposes many of the model parameters at the top-level via `get_model`. These changes make CrabNet portable and extensible, and may be incorporated into the parent repository at a later date. Basic instructions for this fork are given as follows, with the old documentation preserved towards the end.
This is a refactored version of CrabNet, published to PyPI (`pip`) and Anaconda (`conda`). In addition to using `.csv` files, it allows direct passing of Pandas DataFrames as training and validation datasets, similar to [automatminer](https://hackingmaterials.lbl.gov/automatminer/). It also exposes many of the model parameters at the top-level via `get_model`. An `extend_features` is also implemented which allows utilization of data other than the elemental compositions (e.g. state variables such as temperature or applied load). These changes make CrabNet portable and extensible, and may be incorporated into the parent repository at a later date. Basic instructions for this fork are given as follows, with the old documentation preserved towards the end.

## Installation
`conda install -c sgbaird crabnet`
Expand Down Expand Up @@ -53,6 +53,20 @@ Predict on the validation data:
val_true, val_pred, formulas, val_sigma = crabnet_model.predict(val_df)
```

### Extend Features
To include additional features that get added after the transformer architecture, but before a recurrent neural network, include the additional features in your DataFrames and pass the name(s) of these additional features (i.e. columns) as a list into `extend_features`.

```python
crabnet_model = get_model(
mat_prop="hardness",
train_df=train_df, # contains "formula", "target", and "state_var0" columns
extend_features=["state_var0"],
learningcurve=False,
force_cpu=False,
)
```


# Old Documentation

## Table of Contents
Expand Down
Loading