CASMcode
CASMcode copied to clipboard
Fit ECIs manually
Dear CASM developers,
In the case that I want to modify the total energy at 0 K from DFT by, say, adding vibrational contribution, or any other type of corrections, and then fit the ECIs, what would be the easiest way to do that?
Should I do it completely separately from casm-learn functionalities, or try to modify some of the key input files that casm-learn uses (the energy part specifically)?
Thanks!
If you look at the casm learn --settings-format
help for the "problem_specs"/"data" parameters, there are some options for specifying the input data. You could for instance add a new column to a "train" selection file and set "X": "new_column_name".
Alternatively, you can use any method you want to do the fitting and then use the Python function casm.project.write_eci
to write the eci.json
file.
Hi Brian,
My train file is like this:
alias_or_name selected
SCEL1_1_1_1_0_0_0/0 1
SCEL1_1_1_1_0_0_0/1 1
SCEL1_1_1_1_0_0_0/2 1
SCEL1_1_1_1_0_0_0/3 1
SCEL1_1_1_1_0_0_0/4 1
SCEL1_1_1_1_0_0_0/5 1
SCEL1_1_1_1_0_0_0/6 1
SCEL1_1_1_1_0_0_0/7 1
......
Do you mean adding a third column to this "train" file with the column name "formation_free_energy", and setting the y value as "formation_free_energy" in the fit.json file?
Do I need to change "filetype" to csv or json and query the "corr" and "formation_free_energy" to an output csv or json file and let casm-learn read that output file?
If I am correct, casm-learn will somehow identify the "train" selection file, and read the X and y data from somewhere (where?) if X and y is not present in the "train" file?
Thanks!
{
"problem_specs": {
"data": {
"filename": "train",
"filetype": "selection",
"X": "corr",
"y": "formation_energy",
"kwargs": null
},
On Tue, Jan 9, 2024 at 11:47 AM Brian Puchala @.***> wrote:
If you look at the casm learn --settings-format help for the "problem_specs"/"data" parameters, there are some options for specifying the input data. You could for instance add a new column to a "train" selection file and set "X": "new_column_name".
Alternatively, you can use any method you want to do the fitting and then use the Python function casm.project.write_eci https://github.com/prisms-center/CASMpython/blob/7cb55a10cfecf66e3fae1895aa9d1d2f9feb794c/casm/casm/project/io.py#L11C5-L11C14 to write the eci.json file.
— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/345#issuecomment-1883409966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5JTXRH5YWXZR6NIRKTYNVYBVAVCNFSM6AAAAABBPBPH4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBTGQYDSOJWGY . You are receiving this because you authored the thread.Message ID: @.***>
-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/
Hi Brian,
I did what you said, but I got an error. Could you please help me on this?
{ "problem_specs": { "data": { "filename": "train.1.final_form_energy_sorted", "filetype": "selection", "X": "corr", "y": "final_formation_energy", "kwargs": null }, ......
# alias_or_name selected final_formation_energy SCEL1_1_1_1_0_0_0/0 1 0.0924656 SCEL1_1_1_1_0_0_0/1 1 0.1171833 SCEL1_1_1_1_0_0_0/2 1 0 SCEL1_1_1_1_0_0_0/3 1 -0.0417767 SCEL1_1_1_1_0_0_0/4 1 -0.0465267 SCEL1_1_1_1_0_0_0/5 1 -0.2006344 SCEL1_1_1_1_0_0_0/6 1 -0.0000511 SCEL1_1_1_1_0_0_0/7 0 ......
Loading fit_1_ga.json
Hall of Fame size: 10
Get problem data...
Traceback (most recent call last): File "/global/homes/v/voz5005/.local/conda/envs/casm/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3790, in get_loc return self._engine.get_loc(casted_key) File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'selected'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/global/homes/v/voz5005/.local/conda/envs/casm/bin/casm-learn", line 8, in