Commit 5e5b84e7 authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Add init file

parent 11c4d8be
......@@ -42,25 +42,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2020-09-18T16:18:46.650618Z",
"start_time": "2020-09-18T16:18:46.647744Z"
}
},
"outputs": [],
"source": [
"import topological_insulators"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2020-09-18T16:18:47.908223Z",
"start_time": "2020-09-18T16:18:47.892572Z"
"end_time": "2020-09-18T17:12:15.289136Z",
"start_time": "2020-09-18T17:12:15.266454Z"
}
},
"outputs": [],
......@@ -71,16 +57,16 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"ExecuteTime": {
"end_time": "2020-09-18T16:21:04.658278Z",
"start_time": "2020-09-18T16:21:04.583530Z"
"end_time": "2020-09-18T17:12:17.341570Z",
"start_time": "2020-09-18T17:12:17.278901Z"
}
},
"outputs": [],
"source": [
"# from cpp_sisso import get_max_number_feats, get_estimate_n_feat_next_rung, generate_fs, SISSOClassifier, generate_phi_0_from_csv, FeatureSpace\n",
"from cpp_sisso import get_max_number_feats, get_estimate_n_feat_next_rung, generate_fs, SISSOClassifier, generate_phi_0_from_csv, FeatureSpace\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
......
%% Cell type:markdown id: tags:
<div id="teaser" style=' background-position: right center; background-size: 00px; background-repeat: no-repeat;
padding-top: 20px;
padding-right: 10px;
padding-bottom: 170px;
padding-left: 10px;
border-bottom: 14px double #333;
border-top: 14px double #333;' >
<div style="text-align:center">
<b><font size="6.4">Artificial intelligence for high-throughput discovery of topological insulators</font></b>
</div>
<p>
<span class="nomad--last-updated" data-version="v1.0.0">[Last updated: Sep 17, 2020]</span>
<div>
<img style="float: left;" src="assets/topological_insulators/Logo_MPG.png" width="200">
<img style="float: right;" src="assets/topological_insulators/Logo_NOMAD.png" width="250">
</div>
</div>
%% Cell type:markdown id: tags:
Insulator discovery
%% Cell type:code id: tags:
``` python
import topological_insulators
```
%% Cell type:code id: tags:
``` python
%load_ext autoreload
%autoreload 2
```
%% Cell type:code id: tags:
``` python
# from cpp_sisso import get_max_number_feats, get_estimate_n_feat_next_rung, generate_fs, SISSOClassifier, generate_phi_0_from_csv, FeatureSpace
from cpp_sisso import get_max_number_feats, get_estimate_n_feat_next_rung, generate_fs, SISSOClassifier, generate_phi_0_from_csv, FeatureSpace
import numpy as np
import pandas as pd
from topological_insulators.visualizer import Visualizer
```
%% Cell type:code id: tags:
``` python
df_train = pd.read_csv("./data/topological_insulators/train.csv", index_col=0).astype(float)
```
%% Cell type:code id: tags:
``` python
phi_0, prop_unit, prop, prop_test, task_sizes_train, task_sizes_test, leave_out_inds = generate_phi_0_from_csv(
df_train, "Class", cols="all", task_key=None, leave_out_frac=0.0
)
feat_space = generate_fs(
phi_0,
prop,
task_sizes_train,
["add", "sub", "mult", "div", "abs_diff", "sq", "cb", "sqrt", "cbrt", "inv", "abs"],
"classification",
0,
50
)
sisso = SISSOClassifier(
feat_space,
prop_unit,
prop,
prop_test,
task_sizes_train,
task_sizes_test,
leave_out_inds,
2,
10,
10,
)
```
%% Cell type:code id: tags:
``` python
df_train
```
%%%% Output: execute_result
[[[Z11A*Z11B]/sqrt[X16E]]/[[Z11A/Z11C]+[Z11B/Z11D]]] \
compound
Sb_Sb_Te_Te_Te 910.70
As_Bi_Te_Te_S 764.41
Bi_Bi_Te_Se_Se 1068.50
Bi_Sb_Te_S_Te 607.74
Bi_As_Te_Se_Te 732.90
... ...
Bi_Sb_S_S_Se 316.51
Sb_Sb_Te_Se_S 652.75
Sb_Sb_Se_Te_S 652.75
Bi_Bi_S_S_S 413.39
As_As_Te_Te_Se 537.30
[[[Z11A*Z11B]/[X16A+X16E]]/[[Z11A/Z11C]+[Z11B/Z11D]]] \
compound
Sb_Sb_Te_Te_Te 317.99
As_Bi_Te_Te_S 257.95
Bi_Bi_Te_Se_Se 373.38
Bi_Sb_Te_S_Te 213.74
Bi_As_Te_Se_Te 257.76
... ...
Bi_Sb_S_S_Se 110.60
Sb_Sb_Te_Se_S 226.45
Sb_Sb_Se_Te_S 226.45
Bi_Bi_S_S_S 144.35
As_As_Te_Te_Se 181.40
[[[Z11A*Z11B]/[X16B+X16E]]/[[Z11A/Z11C]+[Z11B/Z11D]]] \
compound
Sb_Sb_Te_Te_Te 317.99
As_Bi_Te_Te_S 266.92
Bi_Bi_Te_Se_Se 373.38
Bi_Sb_Te_S_Te 212.20
Bi_As_Te_Se_Te 248.17
... ...
Bi_Sb_S_S_Se 109.88
Sb_Sb_Te_Se_S 226.45
Sb_Sb_Se_Te_S 226.45
Bi_Bi_S_S_S 144.35
As_As_Te_Te_Se 181.40
[[[Z11A+Z11B]/sqrt[X16E]]/[[X16A/Z11D]+[X16B/Z11C]]] \
compound
Sb_Sb_Te_Te_Te 888.49
As_Bi_Te_Te_S 894.13
Bi_Bi_Te_Se_Se 1058.00
Bi_Sb_Te_S_Te 555.50
Bi_As_Te_Se_Te 786.20
... ...
Bi_Sb_S_S_Se 329.88
Sb_Sb_Te_Se_S 636.83
Sb_Sb_Se_Te_S 636.83
Bi_Bi_S_S_S 409.30
As_As_Te_Te_Se 492.94
[[[Z11A+Z11B]*[Z11C+Z11D]]-abs[[Z11A*Z11D]-[Z11B*Z11C]]] \
compound
Sb_Sb_Te_Te_Te 10608.0
As_Bi_Te_Te_S 9464.0
Bi_Bi_Te_Se_Se 12782.0
Bi_Sb_Te_S_Te 7788.0
Bi_As_Te_Se_Te 8870.0
... ...
Bi_Sb_S_S_Se 3776.0
Sb_Sb_Te_Se_S 7854.0
Sb_Sb_Se_Te_S 7854.0
Bi_Bi_S_S_S 5312.0
As_As_Te_Te_Se 6864.0
[[Z11A*Z11B]/[[Z11A/Z11C]+[Z11B/Z11D]]] \
compound
Sb_Sb_Te_Te_Te 1326.00
As_Bi_Te_Te_S 1227.80
Bi_Bi_Te_Se_Se 1706.30
Bi_Sb_Te_S_Te 884.89
Bi_As_Te_Se_Te 1067.10
... ...
Bi_Sb_S_S_Se 505.43
Sb_Sb_Te_Se_S 1048.50
Sb_Sb_Se_Te_S 1048.50
Bi_Bi_S_S_S 664.00
As_As_Te_Te_Se 858.00
[[[Z11A+Z11B]/sqrt[X16E]]/[[Z11C]^-1+[Z11D]^-1]] \
compound
Sb_Sb_Te_Te_Te 1821.40
As_Bi_Te_Te_S 1877.70
Bi_Bi_Te_Se_Se 2137.10
Bi_Sb_Te_S_Te 1126.00
Bi_As_Te_Se_Te 1637.80
... ...
Bi_Sb_S_S_Se 671.31
Sb_Sb_Te_Se_S 1305.50
Sb_Sb_Se_Te_S 1305.50
Bi_Bi_S_S_S 826.78
As_As_Te_Te_Se 1074.60
[[[Z11A/X16B]+[Z11B/X16E]]/[[X16A/Z11D]+[X16B/Z11C]]] \
compound
Sb_Sb_Te_Te_Te 620.63
As_Bi_Te_Te_S 600.57
Bi_Bi_Te_Se_Se 749.44
Bi_Sb_Te_S_Te 389.59
Bi_As_Te_Se_Te 529.33
... ...
Bi_Sb_S_S_Se 237.79
Sb_Sb_Te_Se_S 447.72
Sb_Sb_Se_Te_S 447.72
Bi_Bi_S_S_S 290.14
As_As_Te_Te_Se 334.88
[[[Z11A/X16E]+[Z11B/X16A]]/[[X16A/Z11D]+[X16B/Z11C]]] \
compound
Sb_Sb_Te_Te_Te 620.63
As_Bi_Te_Te_S 629.75
Bi_Bi_Te_Se_Se 749.44
Bi_Sb_Te_S_Te 388.71
Bi_As_Te_Se_Te 547.57
... ...
Bi_Sb_S_S_Se 227.21
Sb_Sb_Te_Se_S 447.72
Sb_Sb_Se_Te_S 447.72
Bi_Bi_S_S_S 290.14
As_As_Te_Te_Se 334.88
[[sqrt[X16D]*[Z11A+Z11B]]/[[X16D/Z11C]+[X16E/Z11D]]] ... \
compound ...
Sb_Sb_Te_Te_Te 1821.40 ...
As_Bi_Te_Te_S 1868.70 ...
Bi_Bi_Te_Se_Se 2137.10 ...
Bi_Sb_Te_S_Te 1181.90 ...
Bi_As_Te_Se_Te 1662.90 ...
... ... ...
Bi_Sb_S_S_Se 671.30 ...
Sb_Sb_Te_Se_S 1303.90 ...
Sb_Sb_Se_Te_S 1326.40 ...
Bi_Bi_S_S_S 826.78 ...
As_As_Te_Te_Se 1070.00 ...
[[abs[X16B-X16D]/log[Z11A]]/[[X16C-X16E]-abs[X16A-X16E]]] \
compound
Sb_Sb_Te_Te_Te -0.254330
As_Bi_Te_Te_S -0.033256
Bi_Bi_Te_Se_Se -0.124940
Bi_Sb_Te_S_Te -1.199400
Bi_As_Te_Se_Te -0.837320
... ...
Bi_Sb_S_S_Se -0.239880
Sb_Sb_Te_Se_S -0.128450
Sb_Sb_Se_Te_S -0.031792
Bi_Bi_S_S_S -0.226300
As_As_Te_Te_Se -0.021450
[[abs[X16A-X16C]/log[Z11B]]/[[X16D-X16E]-abs[X16B-X16E]]] \
compound
Sb_Sb_Te_Te_Te -0.254330
As_Bi_Te_Te_S -0.013312
Bi_Bi_Te_Se_Se -0.042699
Bi_Sb_Te_S_Te 0.065214
Bi_As_Te_Se_Te 0.077297
... ...
Bi_Sb_S_S_Se -0.303040
Sb_Sb_Te_Se_S -0.031792
Sb_Sb_Se_Te_S -0.128450
Bi_Bi_S_S_S -0.226300
As_As_Te_Te_Se -0.021450
[[[X16B-X16D]/log[Z11A]]/[[X16C-X16E]-abs[X16A-X16E]]] \
compound
Sb_Sb_Te_Te_Te 0.254330
As_Bi_Te_Te_S 0.033256
Bi_Bi_Te_Se_Se 0.124940
Bi_Sb_Te_S_Te 1.199400
Bi_As_Te_Se_Te 0.837320
... ...
Bi_Sb_S_S_Se 0.239880
Sb_Sb_Te_Se_S 0.128450
Sb_Sb_Se_Te_S 0.031792
Bi_Bi_S_S_S 0.226300
As_As_Te_Te_Se -0.021450
[[[X16A-X16C]/log[Z11B]]/[[X16D-X16E]-abs[X16B-X16E]]] \
compound
Sb_Sb_Te_Te_Te 0.254330
As_Bi_Te_Te_S -0.013312
Bi_Bi_Te_Se_Se 0.042699
Bi_Sb_Te_S_Te -0.065214
Bi_As_Te_Se_Te -0.077297
... ...
Bi_Sb_S_S_Se 0.303040
Sb_Sb_Te_Se_S 0.031792
Sb_Sb_Se_Te_S 0.128450
Bi_Bi_S_S_S 0.226300
As_As_Te_Te_Se -0.021450
abs[[log[X16A]*[X16A-X16C]]-[[X16C-X16D]*[Z11E/Z11D]]] \
compound
Sb_Sb_Te_Te_Te 0.050249
As_Bi_Te_Te_S 0.046759
Bi_Bi_Te_Se_Se 0.359690
Bi_Sb_Te_S_Te 1.424700
Bi_As_Te_Se_Te 0.587340
... ...
Bi_Sb_S_S_Se 0.393730
Sb_Sb_Te_Se_S 0.152100
Sb_Sb_Se_Te_S 0.491230
Bi_Bi_S_S_S 0.393730
As_As_Te_Te_Se 0.046759
abs[[log[X16B]*[X16B-X16D]]-[[X16D-X16C]*[Z11E/Z11C]]] \
compound
Sb_Sb_Te_Te_Te 0.050249
As_Bi_Te_Te_S 0.070310
Bi_Bi_Te_Se_Se 0.653800
Bi_Sb_Te_S_Te 0.840460
Bi_As_Te_Se_Te 0.718350
... ...
Bi_Sb_S_S_Se 0.380460
Sb_Sb_Te_Se_S 0.491230
Sb_Sb_Se_Te_S 0.152100
Bi_Bi_S_S_S 0.393730
As_As_Te_Te_Se 0.046759
abs[[[X16D-X16C]*[Z11E/Z11D]]-[log[X16A]*abs[X16A-X16C]]] \
compound
Sb_Sb_Te_Te_Te 0.050249
As_Bi_Te_Te_S 0.046759
Bi_Bi_Te_Se_Se 0.359690
Bi_Sb_Te_S_Te 1.424700
Bi_As_Te_Se_Te 0.587340
... ...
Bi_Sb_S_S_Se 0.393730
Sb_Sb_Te_Se_S 0.152100
Sb_Sb_Se_Te_S 0.491230
Bi_Bi_S_S_S 0.393730
As_As_Te_Te_Se 0.046759
abs[[[X16C-X16D]*[Z11E/Z11C]]-[log[X16B]*abs[X16B-X16D]]] \
compound
Sb_Sb_Te_Te_Te 0.050249
As_Bi_Te_Te_S 0.070310
Bi_Bi_Te_Se_Se 0.653800
Bi_Sb_Te_S_Te 0.840460
Bi_As_Te_Se_Te 0.718350
... ...
Bi_Sb_S_S_Se 0.380460
Sb_Sb_Te_Se_S 0.491230
Sb_Sb_Se_Te_S 0.152100
Bi_Bi_S_S_S 0.393730
As_As_Te_Te_Se 0.046759
[[[Z11D/X16A]-[Z11E/X16D]]*[[Z11C-Z11E]/abs[X16A-X16E]]] \
compound
Sb_Sb_Te_Te_Te 0.00
As_Bi_Te_Te_S 1467.50
Bi_Bi_Te_Se_Se 118.81
Bi_Sb_Te_S_Te 0.00
Bi_As_Te_Se_Te 0.00
... ...
Bi_Sb_S_S_Se 178.56
Sb_Sb_Te_Se_S 700.36
Sb_Sb_Se_Te_S 605.16
Bi_Bi_S_S_S 0.00
As_As_Te_Te_Se 380.21
Class
compound
Sb_Sb_Te_Te_Te 0.0
As_Bi_Te_Te_S 0.0
Bi_Bi_Te_Se_Se 0.0
Bi_Sb_Te_S_Te 0.0
Bi_As_Te_Se_Te 0.0
... ...
Bi_Sb_S_S_Se 1.0
Sb_Sb_Te_Se_S 1.0
Sb_Sb_Se_Te_S 1.0
Bi_Bi_S_S_S 1.0
As_As_Te_Te_Se 1.0
[152 rows x 160001 columns]
%% Cell type:code id: tags:
``` python
sisso.fit()
```
%% Cell type:code id: tags:
``` python
model = sisso.models[1][0]
```
%% Cell type:code id: tags:
``` python
feat_1=model.feats[0].value
feat_0=model.feats[1].value
compounds=df_train.index.to_list()
classified=np.concatenate([np.ones(67),np.zeros(85)])
```
%% Cell type:code id: tags:
``` python
df=pd.DataFrame(data={"Compound":compounds,
"Classification":classified,
"Feat_0":feat_0,
"Feat_1":feat_1})
```
%% Cell type:code id: tags:
``` python
Visualizer(df).show()
```
%%%% Output: stream
hi
%%%% Output: display_data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment