Skip to content
Snippets Groups Projects
Commit 7e958aaa authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Add test for intel and gnu compilers

simple test of multi-task sisso with CV
parent d0d362ac
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,9 @@ stages:
- build
- test
build-intel:
build.intel:
stage: build
script:
before_script:
- module load intel impi mkl cmake anaconda/3/2019.03
- mkdir build_intel/
- cd build_intel/
......@@ -20,7 +20,7 @@ build-intel:
tags:
- docker
build-gnu:
build.gnu:
stage: build
script:
- module load gcc impi mkl cmake anaconda/3/2019.03
......@@ -35,3 +35,21 @@ build-gnu:
- make install
tags:
- docker
test.intel:
stage: test
dependencies:
- build.intel
script:
- pytest tests
tags:
- docker
test.gnu:
stage: test
dependencies:
- build.intel
script:
- pytest tests
tags:
- docker
......@@ -5,6 +5,21 @@ import pandas as pd
import math
def get_unit(header):
"""Get the unit from a header
Args:
header (str): Column header to get the unit of
Returns:
str: The string representation of the unit of the features
"""
try:
return header.split("(")[1].split(")")[0]
except IndexError:
return ""
def generate_phi_0_from_csv(
df_csv, prop_key, cols="all", task_key=None, leave_out_frac=0.0
):
......@@ -32,26 +47,41 @@ def generate_phi_0_from_csv(
col_exprs = [c.split(" (")[0] for c in cols]
prop_ind = np.where([c_ex == prop_key.split(" (")[0] for c_ex in col_exprs])[0][0]
# Get prop
prop_key = cols[prop_ind]
prop = df[prop_key].to_numpy()
df = df.drop([prop_key], axis=1)
# Get the task information
if task_key:
task = df[[task_key]].to_numpy()
task = df[[task_key]].to_numpy().flatten()
df = df.drop([task_key], axis=1)
inds = task.argsort()
df = df.loc[:, inds]
inds = []
for ut in np.unique(task):
inds += list(np.where(task == ut)[0])
inds = np.array(inds)
df = df.loc[df.index[inds], :]
task = np.sort(task)
_, task_sizes = np.unique(task, return_counts)
_, task_sizes = np.unique(task, return_counts=True)
task_sizes = task_sizes.astype(np.int32)
else:
task_sizes = [len(df)]
# Get prop
prop_key = cols[prop_ind]
prop = df[prop_key].to_numpy()
df = df.drop([prop_key], axis=1)
# Get test and training sets
leave_out_inds = []
if leave_out_frac > 0.0:
task_sizes_test = [int(math.ceil(ts * leave_out_frac)) for ts in task_sizes]
task_sizes_train = [ts - tst for ts, tst in zip(task_sizes, task_sizes_test)]
task_sizes_test = list(
np.array([int(math.ceil(ts * leave_out_frac)) for ts in task_sizes]).astype(
np.int32
)
)
task_sizes_train = list(
np.array([ts - tst for ts, tst in zip(task_sizes, task_sizes_test)]).astype(
np.int32
)
)
sum_ts = 0
for ts, tst in zip(task_sizes, task_sizes_test):
......@@ -60,10 +90,15 @@ def generate_phi_0_from_csv(
np.arange(sum_ts, sum_ts + ts, dtype=np.int32), tst, False
)
)
sum_ts += ts
else:
task_sizes_test = [0 for ts in task_sizes]
task_sizes_train = [ts for ts in task_sizes]
train_inds = list(np.unique(list(range(np.sum(task_sizes))) + leave_out_inds))
task_sizes_test = list(np.array([0 for ts in task_sizes]).astype(np.int32))
task_sizes_train = list(np.array([ts for ts in task_sizes]).astype(np.int32))
inds, count = np.unique(
list(range(np.sum(task_sizes))) + leave_out_inds, return_counts=True
)
train_inds = [ind for ind in inds if count[ind] == 1]
if cols != "all":
for col in df.columns.tolist():
......@@ -73,7 +108,7 @@ def generate_phi_0_from_csv(
phi_0 = []
columns = df.columns.tolist()
exprs = list([col.split("(")[0] for col in columns])
units = list([col.split("(")[1].split(")")[0] for col in columns])
units = list([get_unit(col) for col in columns])
test_values = df.to_numpy().T[:, leave_out_inds]
values = df.to_numpy().T[:, train_inds]
......@@ -98,19 +133,17 @@ def generate_phi_0_from_csv(
)
def generate_fs_sr_from_csv(
def generate_fs_prop(
df_csv,
prop_key,
allowed_ops,
cols,
max_phi,
n_sis_select,
max_dim,
n_residuals=1,
task_key=None,
leave_out_frac=0.0,
):
"""Generate a FeatureSet and SISSORegressor for the calculation
"""Generate a FeatureSet for the calculation
Args:
df_csv (str): The csv file containing all of the data for the calculation
......@@ -118,16 +151,15 @@ def generate_fs_sr_from_csv(
allowed_ops (list): List of operations used to combine the features
cols (list or str): The columns to include in the initial feature set
max_phi (int): Maximum rung for the calculation
n_residuals (int): number of residuals to use for the next SIS step when learning higher dimensional models
n_sis_select (int): number of features to select in each round of SIS
task_key (str): The key corresponding to which column in the csv file the task differentiation is stored in
leave_out_frac (list): List of indices to pull from the training data to act as a test set
Returns:
fs (FeatureSpace): The FeatureSpace for the calculation
sr (SISSORegressor): The SISSORegressor for the calculation
"""
phi_0, prop, prop_test, task_sizes_train, task_sizes_test, leave_out_inds = generate_phi_0_from_csv(
df_csv, prop_key, cols="all", task_key=None, leave_out_frac=leave_out_frac
df_csv, prop_key, cols=cols, task_key=task_key, leave_out_frac=leave_out_frac
)
if allowed_ops == "all":
allowed_ops = [
......@@ -150,10 +182,95 @@ def generate_fs_sr_from_csv(
"six_pow",
]
fs = FeatureSpace(
return FeatureSpace(
phi_0, allowed_ops, list(prop), task_sizes_train, max_phi, n_sis_select
)
def generate_fs_prop(
phi_0, prop, task_sizes_train, allowed_ops, cols, max_phi, n_sis_select
):
"""Generate a FeatureSet for the calculation
Args:
phi_0 (list of FeatureNodes): The list of primary features
prop (np.ndarray): The property values for the training data
task_sizes_train (list): The number of samples in the training data for each task
allowed_ops (list): List of operations used to combine the features
cols (list or str): The columns to include in the initial feature set
max_phi (int): Maximum rung for the calculation
n_sis_select (int): number of features to select in each round of SIS
task_key (str): The key corresponding to which column in the csv file the task differentiation is stored in
leave_out_frac (list): List of indices to pull from the training data to act as a test set
Returns:
fs (FeatureSpace): The FeatureSpace for the calculation
"""
if allowed_ops == "all":
allowed_ops = [
"add",
"sub",
"mult",
"div",
"abs_diff",
"inv",
"abs",
"cos",
"sin",
"exp",
"neg_exp",
"log",
"sq",
"sqrt",
"cb",
"cbrt",
"six_pow",
]
return FeatureSpace(
phi_0, allowed_ops, list(prop), task_sizes_train, max_phi, n_sis_select
)
def generate_fs_sr_from_csv(
df_csv,
prop_key,
allowed_ops,
cols,
max_phi,
n_sis_select,
max_dim,
n_residuals=1,
task_key=None,
leave_out_frac=0.0,
):
"""Generate a FeatureSet and SISSORegressor for the calculation
Args:
df_csv (str): The csv file containing all of the data for the calculation
prop_key (str): The key corresponding to which column in the csv file the property is stored in
allowed_ops (list): List of operations used to combine the features
cols (list or str): The columns to include in the initial feature set
max_phi (int): Maximum rung for the calculation
n_sis_select (int): number of features to select in each round of SIS
max_dim (int): Maximum dimension of the models to learn
n_residuals (int): number of residuals to use for the next SIS step when learning higher dimensional models
task_key (str): The key corresponding to which column in the csv file the task differentiation is stored in
leave_out_frac (list): List of indices to pull from the training data to act as a test set
Returns:
fs (FeatureSpace): The FeatureSpace for the calculation
sr (SISSORegressor): The SISSORegressor for the calculation
"""
phi_0, prop, prop_test, task_sizes_train, task_sizes_test, leave_out_inds = generate_phi_0_from_csv(
df_csv, prop_key, cols=cols, task_key=task_key, leave_out_frac=leave_out_frac
)
fs = generate_fs_prop(
phi_0, prop, task_sizes_train, allowed_ops, cols, max_phi, n_sis_select
)
sr = SISSORegressor(
fs,
prop,
......
......
Material,energy_diff (eV),Z_A (elem_charge),Z_B (elem_charge),period_A (Unitless),period_B (Unitless),IP_A (eV),IP_B (eV),EA_A (eV),EA_B (eV),E_HOMO_A (eV),E_HOMO_B (eV),E_LUMO_A (eV),E_LUMO_B (eV),r_s_A (AA),r_s_B (AA),r_p_A (AA),r_p_B (AA),r_d_A (AA),r_d_B (AA)
AgBr,-0.030033416711376,47,35,5,4,-8.0580997467,-12.649600029,-1.66659998894,-3.73930001259,-4.71000003815,-8.00100040436,-0.479000002146,0.708000004292,1.32000005245,0.75,1.87999999523,0.879999995232,2.97000002861,1.87000000477
AgCl,-0.042797278205399,47,17,5,3,-8.0580997467,-13.9018001556,-1.66659998894,-3.97079992294,-4.71000003815,-8.69999980927,-0.479000002146,0.574000000954,1.32000005245,0.680000007153,1.87999999523,0.759999990463,2.97000002861,1.66999995708
AgF,-0.153757673178916,47,9,5,2,-8.0580997467,-19.4043006897,-1.66659998894,-4.27349996567,-4.71000003815,-11.2939996719,-0.479000002146,1.25100004673,1.32000005245,0.409999996424,1.87999999523,0.370000004768,2.97000002861,1.42999994755
AgI,0.036925419641193,47,53,5,5,-8.0580997467,-11.2571001053,-1.66659998894,-3.5134999752,-4.71000003815,-7.23600006104,-0.479000002146,0.212999999523,1.32000005245,0.899999976158,1.87999999523,1.07000005245,2.97000002861,1.72000002861
AlAs,0.213261849108676,13,33,3,4,-5.78049993515,-9.26189994812,-0.3125,-1.83920001984,-2.78399991989,-5.34100008011,0.694999992847,0.0640000030398,1.09000003338,0.850000023842,1.38999998569,1.03999996185,1.94000005722,2.01999998093
AlN,0.072949073169639,13,7,3,2,-5.78049993515,-13.5852003098,-0.3125,-1.86749994755,-2.78399991989,-7.2389998436,0.694999992847,3.0569999218,1.09000003338,0.540000021458,1.38999998569,0.509999990463,1.94000005722,1.53999996185
AlP,0.218958341475627,13,15,3,3,-5.78049993515,-9.75059986115,-0.3125,-1.91999995708,-2.78399991989,-5.59600019455,0.694999992847,0.182999998331,1.09000003338,0.829999983311,1.38999998569,0.97000002861,1.94000005722,1.76999998093
AlSb,0.156868733960437,13,51,3,5,-5.78049993515,-8.46829986572,-0.3125,-1.84669995308,-2.78399991989,-4.99100017548,0.694999992847,0.104999996722,1.09000003338,1,1.38999998569,1.23000001907,1.94000005722,2.05999994278
AsGa,0.274277772419737,31,33,4,4,-5.81820011139,-9.26189994812,-0.108099997044,-1.83920001984,-2.73200011253,-5.34100008011,0.129999995232,0.0640000030398,0.990000009537,0.850000023842,1.33000004292,1.03999996185,2.16000008583,2.01999998093
AsB,0.874978183765052,5,33,2,4,-8.18999958038,-9.26189994812,-0.107400000095,-1.83920001984,-3.71499991417,-5.34100008011,2.24799990654,0.0640000030398,0.810000002384,0.850000023842,0.829999983311,1.03999996185,1.95000004768,2.01999998093
BN,1.71208026083627,5,7,2,2,-8.18999958038,-13.5852003098,-0.107400000095,-1.86749994755,-3.71499991417,-7.2389998436,2.24799990654,3.0569999218,0.810000002384,0.540000021458,0.829999983311,0.509999990463,1.95000004768,1.53999996185
BP,1.01922516119521,5,15,2,3,-8.18999958038,-9.75059986115,-0.107400000095,-1.91999995708,-3.71499991417,-5.59600019455,2.24799990654,0.182999998331,0.810000002384,0.829999983311,0.829999983311,0.97000002861,1.95000004768,1.76999998093
BSb,0.580849114368903,5,51,2,5,-8.18999958038,-8.46829986572,-0.107400000095,-1.84669995308,-3.71499991417,-4.99100017548,2.24799990654,0.104999996722,0.810000002384,1,0.829999983311,1.23000001907,1.95000004768,2.05999994278
BaO,-0.092998553867801,56,8,6,2,-5.51569986343,-16.4332008362,0.277999997139,-3.00589990616,-3.34599995613,-9.19699954987,-2.1289999485,2.54099988937,2.15000009537,0.460000008345,2.63000011444,0.430000007153,1.35000002384,2.22000002861
BaS,-0.319762429426191,56,16,6,3,-5.51569986343,-11.7951002121,0.277999997139,-2.84489989281,-3.34599995613,-7.10599994659,-2.1289999485,0.64200001955,2.15000009537,0.740000009537,2.63000011444,0.850000023842,1.35000002384,2.36999988556
BaSe,-0.343445134087233,56,34,6,4,-5.51569986343,-10.9460000992,0.277999997139,-2.75099992752,-3.34599995613,-6.65399980545,-2.1289999485,1.31599998474,2.15000009537,0.800000011921,2.63000011444,0.949999988079,1.35000002384,2.18000006676
BaTe,-0.375386809668271,56,52,6,5,-5.51569986343,-9.86670017242,0.277999997139,-2.66599988937,-3.34599995613,-6.10900020599,-2.1289999485,0.0989999994636,2.15000009537,0.939999997616,2.63000011444,1.13999998569,1.35000002384,1.83000004292
BeO,0.691837577232946,4,8,2,2,-9.459400177,-16.4332008362,0.630500018597,-3.00589990616,-5.59999990463,-9.19699954987,-2.09800004959,2.54099988937,1.08000004292,0.460000008345,1.21000003815,0.430000007153,2.88000011444,2.22000002861
BeS,0.506327674543172,4,16,2,3,-9.459400177,-11.7951002121,0.630500018597,-2.84489989281,-5.59999990463,-7.10599994659,-2.09800004959,0.64200001955,1.08000004292,0.740000009537,1.21000003815,0.850000023842,2.88000011444,2.36999988556
BeSe,0.49494044277526,4,34,2,4,-9.459400177,-10.9460000992,0.630500018597,-2.75099992752,-5.59999990463,-6.65399980545,-2.09800004959,1.31599998474,1.08000004292,0.800000011921,1.21000003815,0.949999988079,2.88000011444,2.18000006676
BeTe,0.468585910493857,4,52,2,5,-9.459400177,-9.86670017242,0.630500018597,-2.66599988937,-5.59999990463,-6.10900020599,-2.09800004959,0.0989999994636,1.08000004292,0.939999997616,1.21000003815,1.13999998569,2.88000011444,1.83000004292
C2,2.62860363913364,6,6,2,2,-10.8516998291,-10.8516998291,-0.87239998579,-0.87239998579,-5.41599988937,-5.41599988937,1.99199998379,1.99199998379,0.639999985695,0.639999985695,0.629999995232,0.629999995232,1.62999999523,1.62999999523
CaO,-0.265219041319142,20,8,4,2,-6.4279999733,-16.4332008362,0.303900003433,-3.00589990616,-3.86400008202,-9.19699954987,-2.132999897,2.54099988937,1.75999999046,0.460000008345,2.31999993324,0.430000007153,0.680000007153,2.22000002861
CaS,-0.369133194537426,20,16,4,3,-6.4279999733,-11.7951002121,0.303900003433,-2.84489989281,-3.86400008202,-7.10599994659,-2.132999897,0.64200001955,1.75999999046,0.740000009537,2.31999993324,0.850000023842,0.680000007153,2.36999988556
CaSe,-0.360797734421794,20,34,4,4,-6.4279999733,-10.9460000992,0.303900003433,-2.75099992752,-3.86400008202,-6.65399980545,-2.132999897,1.31599998474,1.75999999046,0.800000011921,2.31999993324,0.949999988079,0.680000007153,2.18000006676
CaTe,-0.350456279076752,20,52,4,5,-6.4279999733,-9.86670017242,0.303900003433,-2.66599988937,-3.86400008202,-6.10900020599,-2.132999897,0.0989999994636,1.75999999046,0.939999997616,2.31999993324,1.13999998569,0.680000007153,1.83000004292
CdO,-0.084161358026904,48,8,5,2,-9.5813999176,-16.4332008362,0.838699996471,-3.00589990616,-5.95200014114,-9.19699954987,-1.30900001526,2.54099988937,1.23000001907,0.460000008345,1.74000000954,0.430000007153,2.59999990463,2.22000002861
CdS,0.072672795911785,48,16,5,3,-9.5813999176,-11.7951002121,0.838699996471,-2.84489989281,-5.95200014114,-7.10599994659,-1.30900001526,0.64200001955,1.23000001907,0.740000009537,1.74000000954,0.850000023842,2.59999990463,2.36999988556
CdSe,0.083571949086036,48,34,5,4,-9.5813999176,-10.9460000992,0.838699996471,-2.75099992752,-5.95200014114,-6.65399980545,-1.30900001526,1.31599998474,1.23000001907,0.800000011921,1.74000000954,0.949999988079,2.59999990463,2.18000006676
CdTe,0.114539532194613,48,52,5,5,-9.5813999176,-9.86670017242,0.838699996471,-2.66599988937,-5.95200014114,-6.10900020599,-1.30900001526,0.0989999994636,1.23000001907,0.939999997616,1.74000000954,1.13999998569,2.59999990463,1.83000004292
BrCs,-0.155867302994011,55,35,6,4,-4.00619983673,-12.649600029,-0.569599986076,-3.73930001259,-2.22000002861,-8.00100040436,-0.547999978065,0.708000004292,2.46000003815,0.75,3.16000008583,0.879999995232,1.97000002861,1.87000000477
ClCs,-0.15034615744662,55,17,6,3,-4.00619983673,-13.9018001556,-0.569599986076,-3.97079992294,-2.22000002861,-8.69999980927,-0.547999978065,0.574000000954,2.46000003815,0.680000007153,3.16000008583,0.759999990463,1.97000002861,1.66999995708
CsF,-0.10826331867429,55,9,6,2,-4.00619983673,-19.4043006897,-0.569599986076,-4.27349996567,-2.22000002861,-11.2939996719,-0.547999978065,1.25100004673,2.46000003815,0.409999996424,3.16000008583,0.370000004768,1.97000002861,1.42999994755
CsI,-0.162387474498246,55,53,6,5,-4.00619983673,-11.2571001053,-0.569599986076,-3.5134999752,-2.22000002861,-7.23600006104,-0.547999978065,0.212999999523,2.46000003815,0.899999976158,3.16000008583,1.07000005245,1.97000002861,1.72000002861
BrCu,0.152442639788205,29,35,4,4,-8.38879966736,-12.649600029,-1.6384999752,-3.73930001259,-4.85599994659,-8.00100040436,-0.64099997282,0.708000004292,1.20000004768,0.75,1.67999994755,0.879999995232,2.57999992371,1.87000000477
ClCu,0.156258713192074,29,17,4,3,-8.38879966736,-13.9018001556,-1.6384999752,-3.97079992294,-4.85599994659,-8.69999980927,-0.64099997282,0.574000000954,1.20000004768,0.680000007153,1.67999994755,0.759999990463,2.57999992371,1.66999995708
CuF,-0.017022272342729,29,9,4,2,-8.38879966736,-19.4043006897,-1.6384999752,-4.27349996567,-4.85599994659,-11.2939996719,-0.64099997282,1.25100004673,1.20000004768,0.409999996424,1.67999994755,0.370000004768,2.57999992371,1.42999994755
CuI,0.204674583263113,29,53,4,5,-8.38879966736,-11.2571001053,-1.6384999752,-3.5134999752,-4.85599994659,-7.23600006104,-0.64099997282,0.212999999523,1.20000004768,0.899999976158,1.67999994755,1.07000005245,2.57999992371,1.72000002861
GaN,0.433445239093999,31,7,4,2,-5.81820011139,-13.5852003098,-0.108099997044,-1.86749994755,-2.73200011253,-7.2389998436,0.129999995232,3.0569999218,0.990000009537,0.540000021458,1.33000004292,0.509999990463,2.16000008583,1.53999996185
GaP,0.348751797751902,31,15,4,3,-5.81820011139,-9.75059986115,-0.108099997044,-1.91999995708,-2.73200011253,-5.59600019455,0.129999995232,0.182999998331,0.990000009537,0.829999983311,1.33000004292,0.97000002861,2.16000008583,1.76999998093
GaSb,0.154625285096699,31,51,4,5,-5.81820011139,-8.46829986572,-0.108099997044,-1.84669995308,-2.73200011253,-4.99100017548,0.129999995232,0.104999996722,0.990000009537,1,1.33000004292,1.23000001907,2.16000008583,2.05999994278
Ge2,0.200852526060771,32,32,4,4,-7.56699991226,-7.56699991226,-0.949000000954,-0.949000000954,-4.04600000381,-4.04600000381,2.17499995232,2.17499995232,0.920000016689,0.920000016689,1.15999996662,1.15999996662,2.36999988556,2.36999988556
CGe,0.811442880200048,32,6,4,2,-7.56699991226,-10.8516998291,-0.949000000954,-0.87239998579,-4.04600000381,-5.41599988937,2.17499995232,1.99199998379,0.920000016689,0.639999985695,1.15999996662,0.629999995232,2.36999988556,1.62999999523
GeSi,0.263210170178354,32,14,4,3,-7.56699991226,-7.75769996643,-0.949000000954,-0.992999970913,-4.04600000381,-4.16300010681,2.17499995232,0.439999997616,0.920000016689,0.939999997616,1.15999996662,1.12999999523,2.36999988556,1.88999998569
AsIn,0.134047575193108,49,33,5,4,-5.53739976883,-9.26189994812,-0.256300002337,-1.83920001984,-2.6970000267,-5.34100008011,0.368000000715,0.0640000030398,1.12999999523,0.850000023842,1.5,1.03999996185,3.1099998951,2.01999998093
InN,0.15372029269929,49,7,5,2,-5.53739976883,-13.5852003098,-0.256300002337,-1.86749994755,-2.6970000267,-7.2389998436,0.368000000715,3.0569999218,1.12999999523,0.540000021458,1.5,0.509999990463,3.1099998951,1.53999996185
InP,0.179193287229282,49,15,5,3,-5.53739976883,-9.75059986115,-0.256300002337,-1.91999995708,-2.6970000267,-5.59600019455,0.368000000715,0.182999998331,1.12999999523,0.829999983311,1.5,0.97000002861,3.1099998951,1.76999998093
InSb,0.078059873019811,49,51,5,5,-5.53739976883,-8.46829986572,-0.256300002337,-1.84669995308,-2.6970000267,-4.99100017548,0.368000000715,0.104999996722,1.12999999523,1,1.5,1.23000001907,3.1099998951,2.05999994278
BrK,-0.166175964193826,19,35,4,4,-4.43319988251,-12.649600029,-0.621299982071,-3.73930001259,-2.42600011826,-8.00100040436,-0.697000026703,0.708000004292,2.13000011444,0.75,2.44000005722,0.879999995232,1.78999996185,1.87000000477
ClK,-0.16446068021105,19,17,4,3,-4.43319988251,-13.9018001556,-0.621299982071,-3.97079992294,-2.42600011826,-8.69999980927,-0.697000026703,0.574000000954,2.13000011444,0.680000007153,2.44000005722,0.759999990463,1.78999996185,1.66999995708
FK,-0.146406098498119,19,9,4,2,-4.43319988251,-19.4043006897,-0.621299982071,-4.27349996567,-2.42600011826,-11.2939996719,-0.697000026703,1.25100004673,2.13000011444,0.409999996424,2.44000005722,0.370000004768,1.78999996185,1.42999994755
IK,-0.167039145162562,19,53,4,5,-4.43319988251,-11.2571001053,-0.621299982071,-3.5134999752,-2.42600011826,-7.23600006104,-0.697000026703,0.212999999523,2.13000011444,0.899999976158,2.44000005722,1.07000005245,1.78999996185,1.72000002861
BrLi,-0.032746212884376,3,35,2,4,-5.32910013199,-12.649600029,-0.698099970818,-3.73930001259,-2.87400007248,-8.00100040436,-0.977999985218,0.708000004292,1.64999997616,0.75,2,0.879999995232,6.92999982834,1.87000000477
ClLi,-0.038381482699151,3,17,2,3,-5.32910013199,-13.9018001556,-0.698099970818,-3.97079992294,-2.87400007248,-8.69999980927,-0.977999985218,0.574000000954,1.64999997616,0.680000007153,2,0.759999990463,6.92999982834,1.66999995708
FLi,-0.059488316863735,3,9,2,2,-5.32910013199,-19.4043006897,-0.698099970818,-4.27349996567,-2.87400007248,-11.2939996719,-0.977999985218,1.25100004673,1.64999997616,0.409999996424,2,0.370000004768,6.92999982834,1.42999994755
ILi,-0.021660936341505,3,53,2,5,-5.32910013199,-11.2571001053,-0.698099970818,-3.5134999752,-2.87400007248,-7.23600006104,-0.977999985218,0.212999999523,1.64999997616,0.899999976158,2,1.07000005245,6.92999982834,1.72000002861
MgO,-0.232274724316994,12,8,3,2,-8.03709983826,-16.4332008362,0.692499995232,-3.00589990616,-4.78200006485,-9.19699954987,-1.35800004005,2.54099988937,1.33000004292,0.460000008345,1.89999997616,0.430000007153,3.17000007629,2.22000002861
MgS,-0.086699504988246,12,16,3,3,-8.03709983826,-11.7951002121,0.692499995232,-2.84489989281,-4.78200006485,-7.10599994659,-1.35800004005,0.64200001955,1.33000004292,0.740000009537,1.89999997616,0.850000023842,3.17000007629,2.36999988556
MgSe,-0.055301801956375,12,34,3,4,-8.03709983826,-10.9460000992,0.692499995232,-2.75099992752,-4.78200006485,-6.65399980545,-1.35800004005,1.31599998474,1.33000004292,0.800000011921,1.89999997616,0.949999988079,3.17000007629,2.18000006676
MgTe,-0.004591286648065,12,52,3,5,-8.03709983826,-9.86670017242,0.692499995232,-2.66599988937,-4.78200006485,-6.10900020599,-1.35800004005,0.0989999994636,1.33000004292,0.939999997616,1.89999997616,1.13999998569,3.17000007629,1.83000004292
BrNa,-0.12642872788274,11,35,3,4,-5.22310018539,-12.649600029,-0.715699970722,-3.73930001259,-2.81900000572,-8.00100040436,-0.717999994755,0.708000004292,1.71000003815,0.75,2.59999990463,0.879999995232,6.57000017166,1.87000000477
ClNa,-0.132991985081389,11,17,3,3,-5.22310018539,-13.9018001556,-0.715699970722,-3.97079992294,-2.81900000572,-8.69999980927,-0.717999994755,0.574000000954,1.71000003815,0.680000007153,2.59999990463,0.759999990463,6.57000017166,1.66999995708
FNa,-0.145788137787804,11,9,3,2,-5.22310018539,-19.4043006897,-0.715699970722,-4.27349996567,-2.81900000572,-11.2939996719,-0.717999994755,1.25100004673,1.71000003815,0.409999996424,2.59999990463,0.370000004768,6.57000017166,1.42999994755
INa,-0.114838222187245,11,53,3,5,-5.22310018539,-11.2571001053,-0.715699970722,-3.5134999752,-2.81900000572,-7.23600006104,-0.717999994755,0.212999999523,1.71000003815,0.899999976158,2.59999990463,1.07000005245,6.57000017166,1.72000002861
BrRb,-0.163820531422971,37,35,5,4,-4.28889989853,-12.649600029,-0.590399980545,-3.73930001259,-2.3599998951,-8.00100040436,-0.704999983311,0.708000004292,2.24000000954,0.75,3.20000004768,0.879999995232,1.96000003815,1.87000000477
ClRb,-0.160503554077877,37,17,5,3,-4.28889989853,-13.9018001556,-0.590399980545,-3.97079992294,-2.3599998951,-8.69999980927,-0.704999983311,0.574000000954,2.24000000954,0.680000007153,3.20000004768,0.759999990463,1.96000003815,1.66999995708
FRb,-0.135595776984701,37,9,5,2,-4.28889989853,-19.4043006897,-0.590399980545,-4.27349996567,-2.3599998951,-11.2939996719,-0.704999983311,1.25100004673,2.24000000954,0.409999996424,3.20000004768,0.370000004768,1.96000003815,1.42999994755
IRb,-0.167201442120131,37,53,5,5,-4.28889989853,-11.2571001053,-0.590399980545,-3.5134999752,-2.3599998951,-7.23600006104,-0.704999983311,0.212999999523,2.24000000954,0.899999976158,3.20000004768,1.07000005245,1.96000003815,1.72000002861
Si2,0.279165821548304,14,14,3,3,-7.75769996643,-7.75769996643,-0.992999970913,-0.992999970913,-4.16300010681,-4.16300010681,0.439999997616,0.439999997616,0.939999997616,0.939999997616,1.12999999523,1.12999999523,1.88999998569,1.88999998569
CSi,0.669023727235981,14,6,3,2,-7.75769996643,-10.8516998291,-0.992999970913,-0.87239998579,-4.16300010681,-5.41599988937,0.439999997616,1.99199998379,0.939999997616,0.639999985695,1.12999999523,0.629999995232,1.88999998569,1.62999999523
Sn2,0.016963899193797,50,50,5,5,-7.04279994965,-7.04279994965,-1.03919994831,-1.03919994831,-3.86599993706,-3.86599993706,0.00800000037998,0.00800000037998,1.05999994278,1.05999994278,1.34000003338,1.34000003338,2.02999997139,2.02999997139
CSn,0.453537974142819,50,6,5,2,-7.04279994965,-10.8516998291,-1.03919994831,-0.87239998579,-3.86599993706,-5.41599988937,0.00800000037998,1.99199998379,1.05999994278,0.639999985695,1.34000003338,0.629999995232,2.02999997139,1.62999999523
GeSn,0.081663360237144,50,32,5,4,-7.04279994965,-7.56699991226,-1.03919994831,-0.949000000954,-3.86599993706,-4.04600000381,0.00800000037998,2.17499995232,1.05999994278,0.920000016689,1.34000003338,1.15999996662,2.02999997139,2.36999988556
SiSn,0.135108799106092,50,14,5,3,-7.04279994965,-7.75769996643,-1.03919994831,-0.992999970913,-3.86599993706,-4.16300010681,0.00800000037998,0.439999997616,1.05999994278,0.939999997616,1.34000003338,1.12999999523,2.02999997139,1.88999998569
OSr,-0.22030662317411,38,8,5,2,-6.03159999847,-16.4332008362,0.343100011349,-3.00589990616,-3.64100003242,-9.19699954987,-1.3789999485,2.54099988937,1.90999996662,0.460000008345,2.54999995232,0.430000007153,1.20000004768,2.22000002861
SSr,-0.368434129930392,38,16,5,3,-6.03159999847,-11.7951002121,0.343100011349,-2.84489989281,-3.64100003242,-7.10599994659,-1.3789999485,0.64200001955,1.90999996662,0.740000009537,2.54999995232,0.850000023842,1.20000004768,2.36999988556
SeSr,-0.3745109517331,38,34,5,4,-6.03159999847,-10.9460000992,0.343100011349,-2.75099992752,-3.64100003242,-6.65399980545,-1.3789999485,1.31599998474,1.90999996662,0.800000011921,2.54999995232,0.949999988079,1.20000004768,2.18000006676
SrTe,-0.379294725862565,38,52,5,5,-6.03159999847,-9.86670017242,0.343100011349,-2.66599988937,-3.64100003242,-6.10900020599,-1.3789999485,0.0989999994636,1.90999996662,0.939999997616,2.54999995232,1.13999998569,1.20000004768,1.83000004292
OZn,0.101968176768423,30,8,4,2,-10.1354999542,-16.4332008362,1.08070003986,-3.00589990616,-6.21700000763,-9.19699954987,-1.19400000572,2.54099988937,1.10000002384,0.460000008345,1.54999995232,0.430000007153,2.25,2.22000002861
SZn,0.275813325606578,30,16,4,3,-10.1354999542,-11.7951002121,1.08070003986,-2.84489989281,-6.21700000763,-7.10599994659,-1.19400000572,0.64200001955,1.10000002384,0.740000009537,1.54999995232,0.850000023842,2.25,2.36999988556
SeZn,0.263136899280653,30,34,4,4,-10.1354999542,-10.9460000992,1.08070003986,-2.75099992752,-6.21700000763,-6.65399980545,-1.19400000572,1.31599998474,1.10000002384,0.800000011921,1.54999995232,0.949999988079,2.25,2.18000006676
TeZn,0.245001295174006,30,52,4,5,-10.1354999542,-9.86670017242,1.08070003986,-2.66599988937,-6.21700000763,-6.10900020599,-1.19400000572,0.0989999994636,1.10000002384,0.939999997616,1.54999995232,1.13999998569,2.25,1.83000004292
,purcell,theobook151,20.07.2020 15:50,file:///home/purcell/.config/libreoffice/4;
\ No newline at end of file
File added
Sample,Task,Prop,A (m),B (s),C ,D (Unitless)
1,X,1031303.34310437,40047.7725031033,81.6019767547866,12535.2818525271,-683.666065848847
2,X,207179.181972689,8273.93114052335,47.4359192293739,2518.19019867913,-1407.86160002623
3,X,594547.990034924,-24495.5390890833,46.3994727792424,7226.59341895378,-154.449699580799
4,X,1431871.75085735,-5975.17124802999,96.2922472869417,17404.1240046628,-383.63965153104
5,X,2132341.51391611,33545.2455355934,23.2389997524879,25918.2170844233,-2214.8717939546
6,X,1849456.85903214,-36585.1506450251,21.7653754396546,22479.8013103184,-499.788202406702
7,X,416377.473683951,47617.1641535909,53.9342164837372,5060.96052467702,-2002.28785563532
8,X,1834852.24383494,164.577549590314,55.7417291729005,22302.2848302114,-1462.8889504883
9,X,2030615.0021387,-25590.077352893,13.3180597514294,24681.7483092487,-267.582565811964
10,X,418204.906991729,-35631.266855653,67.830087711799,5083.17267158509,-2819.77637904098
11,X,1600764.65336791,24069.5603461085,91.2031527296231,19456.9890506716,-2706.92171287459
12,X,-237442.303891325,-28375.8492844066,76.6780058713539,-2886.10976641617,-1650.25772935281
13,X,389569.403019936,-17679.1039531987,93.7334723703787,4735.11289934218,-553.765889146761
14,X,1097874.59558522,25271.39171418,53.6965192771211,13344.4443174432,-1094.01486564295
15,X,896512.426133544,-16691.6898965759,19.4379065649528,10896.9207498079,-2899.60958857901
16,X,12475.3344165542,11073.3959911305,52.0025761588363,151.597422562947,-782.134708201617
17,X,643218.531288929,-33665.7156040407,29.7373317632719,7818.17572605823,-1080.66347038372
18,X,888098.246309737,-42864.1312633446,93.9228362331387,10794.6477981533,-1638.80485180208
19,X,1636015.66023612,-1874.52319024457,61.4904198919873,19885.4591582095,-2643.77032366468
20,X,1523022.28471858,-49138.4737863941,17.975585548934,18512.0435328828,-560.378442383903
21,X,-18066.9165614168,-35122.5184807359,6.32108929256205,-219.638541412487,-1004.04464422701
22,X,753574.994852389,-504.277781827623,64.3463985117791,9159.54014727008,-690.33547481712
23,X,484679.670507055,-47904.9616755848,34.793137673643,5891.16232922052,-2871.23133035778
24,X,1418886.29518641,40005.8303266016,89.663527446701,17246.2879576819,-1230.52218744124
25,X,746864.366592613,-29303.0557293284,63.1160346689987,9077.97355841423,-3078.94168258733
26,X,826676.469591929,31855.9700915967,12.4598774065994,10048.0763518243,-3214.1429201838
27,X,904870.905255709,-1370.05112198737,18.1776031280461,10998.5166695707,-1733.87235240405
28,X,1081673.04047048,46129.8007590074,65.8763747557873,13147.5171186325,-1237.15538447696
29,X,1602766.31102942,12215.0498178804,28.9863403535557,19481.3188655265,-2669.08606113272
30,X,848296.081366335,-8523.54146953082,14.4884132013553,10310.8591252139,-1070.59795231075
31,X,881987.050483579,-32109.023962203,59.952453510063,10720.3672326848,-1978.64149010475
32,X,1384967.83924126,31795.5231836559,46.3619825035018,16834.0147857661,-3214.77894538541
33,X,1435243.99308821,-41605.9821955878,61.1093419800895,17445.1130460068,-1581.87602287648
34,X,1482822.4415542,-49423.8250112063,57.7898783145655,18023.4211475179,-2245.35073430102
35,X,1159462.50457973,24974.6967563244,2.46710777290358,14093.035073862,-1653.30479641573
36,X,1385445.91552098,44300.000697173,14.1598975077974,16839.8257231643,-1154.39523418031
37,X,1078840.90378916,-33471.5314909414,86.4825835158785,13113.0929698841,-1772.81761496697
38,X,322072.318257427,-32616.3765208785,71.5517709413264,3914.69709752203,-1834.58611475719
39,X,1547503.57192612,15339.6613906795,78.8203546957091,18809.6094936362,-538.87662795121
40,X,1174714.5075073,38777.544632935,63.0951620300882,14278.4206242917,-380.323852794412
41,X,94875.3402808423,12249.6781769406,90.3127462736438,1153.15574346477,-1590.10909636815
42,X,362160.364120508,-49277.9984660007,8.3266338235128,4401.96060534147,-1423.02119058586
43,X,673617.378755157,21157.5642575089,40.4360003803782,8187.66864424759,-2304.57417593545
44,X,882351.052225793,44482.8684188695,60.148559750113,10724.7916131167,-3010.89784032583
45,X,22400.9390066318,17108.6417404538,68.2422016131663,272.24149001619,-1091.87923472037
46,X,1781136.79777257,30136.189144163,65.8784392884513,21649.382366535,-779.999951946907
47,X,621416.608280441,-31495.5881531396,67.4176383345993,7553.17699006137,-3091.37667023128
48,X,750411.885581194,42277.9111802948,52.7091601206799,9121.09305972893,-1213.67564944238
49,X,1525062.49801326,-20619.9327982041,18.5983023041602,18536.841985025,-518.413321644593
50,X,679068.208535292,42337.0868480189,55.8737535970023,8253.92257061978,-1337.41889839093
51,X,447826.687204506,-3841.47148699515,57.8803936758992,5443.22046731452,-2117.64647879144
52,X,336890.280723035,-25698.4911052116,26.2484582718796,4094.80695856079,-2304.9408398086
53,X,468079.149217039,-36421.9167980631,9.52225176867021,5689.38576313015,-2346.34809901136
54,X,1404060.53519045,10116.138294505,33.8807589471792,17066.0833189846,-2177.75555908996
55,X,1827150.95390431,33677.6712656449,65.3664484400669,22208.6767557623,-768.872566798946
56,X,-33394.4572217261,23643.588170146,95.3617653535894,-405.942240360551,-802.333589068958
57,X,1443453.59596531,48648.6785581152,83.107773775309,17544.8993990111,-1826.75004222983
58,X,1550858.36965351,39565.5654401456,28.6332188363784,18850.3865001573,-176.047021901582
59,X,329623.778660326,9384.94614690253,83.9023194218408,4006.48383865674,-1510.2742546313
60,X,596362.271476793,-7862.7530203713,84.8842436218459,7248.64570723748,-1125.70379322904
61,Y,-1747903.77060764,-15426.701719437,73.530132833494,12277.508278164,-2388.05382648639
62,Y,-602031.002716425,-26628.9177804096,56.1127291052339,4228.72153980883,-2494.38544516297
63,Y,-914915.654901957,-22908.9603476779,55.2235512174418,6426.47150794108,-3065.18336481344
64,Y,-1293976.98085175,44255.5466634393,24.3327718109724,9089.05662095335,-1530.79847762564
65,Y,-556992.07118952,44821.3470186639,63.0165978378747,3912.36115061704,-3240.22306333347
66,Y,-2294033.39637973,-44132.4823446645,42.5612469609221,16113.6068505302,-255.147829778129
67,Y,-1213629.16675478,-42539.8069752961,48.9584343155192,8524.68120454026,-164.586906089718
68,Y,292809.005099769,-49432.7543013633,80.507648968553,-2056.77244309559,-871.09190770659
69,Y,-2235342.64861732,-6632.95213361424,93.4293107228537,15701.3540037878,-2178.77545326323
70,Y,-3732932.41042696,-40485.6986880114,25.9765685287417,26220.6550555191,-598.407067002771
71,Y,-252210.474776827,-14427.735364365,59.6676061209021,1771.52829396117,-845.471004201544
72,Y,-98889.6656695742,-41488.1745504839,42.4820587894618,694.579325611127,-1299.98047519081
73,Y,-1370204.37668197,-21879.2550863842,34.7942407834795,9624.48958514065,-1954.71594115708
74,Y,-3104420.51726401,31704.4165180227,44.4564228685462,21805.8907533925,-977.750657934738
75,Y,-2388277.98822188,7800.82135026513,48.5821408939988,16775.5953738995,-2577.18311095899
76,Y,-724977.658463333,-44659.6170999659,35.6876655675306,5092.31777838026,-2837.25474789309
77,Y,-1794477.91392858,6521.923601348,88.7042922408313,12604.6522325595,-2393.39103443748
78,Y,-223213.115899978,28443.9701603649,37.3226807484787,1567.84638066104,-1284.75416736837
79,Y,423046.005849878,9502.16765496074,17.4038852841401,-2971.57718730938,-793.452569769765
80,Y,-3047818.61588223,7598.41423185622,90.0700126497531,21408.3102848147,-749.371738309082
81,Y,-2409342.6015377,35261.072039404,47.9286965191158,16923.5564603709,-3048.15567690909
82,Y,-742814.585466495,-29503.3166005498,7.75349725175401,5217.60709978568,-2729.9120626205
83,Y,-571579.430647006,-44941.8628170447,85.8317735174233,4014.82500929801,-1269.94347716121
84,Y,-2195610.2686634,48026.9824672444,3.47886888914346,15422.2676483873,-208.387321904327
85,Y,-964020.379427545,-5862.59066560875,32.3951971412924,6771.39065366773,-2348.00221246913
86,Y,-2102214.66994452,-1627.31398929461,65.1915191571454,14766.2426011092,-2448.65166476797
87,Y,-890649.179337315,-31734.0384124326,73.7172018923155,6256.02004752945,-586.069879271884
88,Y,-2207063.83218629,14835.6206610657,31.7102632894148,15502.7192420416,-1698.88417254839
89,Y,-749402.325380223,-49686.6769123602,49.3012898909983,5263.8803991841,-1176.36020313534
90,Y,-2494089.08559485,234.017339793194,43.1649546520338,17518.8293606888,-2223.27305100155
91,Y,-758480.09438593,-42219.6177653841,85.476183481532,5327.64404629679,-864.677157209562
92,Y,-2025827.98191011,2374.67279858794,33.5495503844189,14229.6907309965,-2868.43169850788
93,Y,-2354065.35735529,-48559.373111767,43.9360775681768,16535.2805868339,-1226.37195019107
94,Y,-1588621.54314025,-37866.8557345306,22.4186822710487,11158.6853894212,-2716.07040834036
95,Y,-3175419.95188679,-45432.4026527398,31.3118028803292,22304.6017131089,-666.77340835222
96,Y,-2152215.92330461,-26966.2051976371,0.258766409063485,15117.4590856704,-32.6895291544268
97,Y,-547157.630624095,-1300.97533450509,46.2515307967681,3843.28254500137,-2502.56292413987
98,Y,-2672876.70357122,28750.3814277021,7.66749583919236,18774.6605662742,-1875.23509974759
99,Y,-2080211.9597305,-40822.549051454,89.438883925997,14611.6921599612,-1948.30990769798
100,Y,-2578377.05246833,-2300.90575344433,65.926962237196,18110.8804765956,-2076.35142495637
{
"desc_dim": 3,
"n_sis_select": 100,
"desc_dim": 2,
"n_sis_select": 10,
"max_rung": 2,
"n_residual": 10,
"min_abs_feat_val": 1e-3,
"max_abs_feat_val": 1e5,
"data_file": "data.csv",
"property_key": "energy_diff",
"leave_out_frac": 0.0,
"property_key": "Prop",
"task_key": "Task",
"leave_out_frac": 0.2,
"n_rung_generate": 0,
"n_rung_store": 1,
"leave_out_inds": [],
"fix_intercept": false,
"opset": ["add", "sub", "mult", "div", "exp", "inv", "sq", "cb", "sqrt", "cbrt", "abs_diff"]
}
import shutil
from pathlib import Path
from sisso import generate_fs_sr_from_csv
parent = Path(__file__).parent
def test_sisso():
feat_sapce, sisso = generate_fs_sr_from_csv(
df_csv=parent / "data.csv",
prop_key="Prop",
allowed_ops="all",
cols="all",
max_phi=2,
n_sis_select=20,
max_dim=2,
n_residuals=1,
task_key="Task",
leave_out_frac=0.2,
)
sisso.fit()
shutil.rmtree("models/")
shutil.rmtree("feature_space/")
assert sisso.models[1][0].rmse < 1e-8
assert sisso.models[1][0].test_rmse < 1e-8
if __name__ == "__main__":
test_sisso()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment