Skip to main content

Li-ion Intercalation Electrode Materials Exploration

Project description

LIEME

Description

๐Ÿ‹ LIEME: Li-ion Intercalation Electrode Materials Exploration.

LIEME is an open source python package for discovering new Li intercalation electrode materials.

  1. ๐Ÿ–ฅ๏ธ The computational framework maps first principles derived input features to experimentally measured performance for electrode materials using automated machine learning.
  2. ๐Ÿ“ฅ The input features for materials can be obtained from manual density functional theory (DFT) calculations, or from Materials Project via the API.
  3. โš ๏ธ Usually, electrode material datasets which contain experimental performance data are small (< 100 datapoints). There is high risk of overfitting. To prevent this, only min(f,int(0.1*d)) features should be considered for training, where f is the total number of features and d is the number of datapoints. This ensures less than 10% feature-data ratio as recommended in this paper.
  4. ๐Ÿš„ Models are trained on all feature subsets. This results in combinations(f,int(0.1*d)) models. Each model explores different subspace of the feature space.
  5. ๐Ÿ“Š Final performance is obtained by averaging the predictions from all high-performing models.
  6. โš™๏ธ The training process is automated using TPOT and heavily parallelizable (for example, using SLURM array jobs, where each job is for training one model).
  7. ๐Ÿ’พ All the models are stored in an SQLite database.

Installation

LIEME requires Python 3.11 or newer.

Install the latest stable build using the following command.

pip install lieme

If you want the latest developement version, clone the repo and install in editable mode.

git clone https://github.com/sreeharshab/lieme.git
cd lieme
pip install -e .

After installation, you can import LIEME in Python.

import lieme

LIEME depends on several scientific packages, which will be installed automatically when using pip. To avoid dependency conflicts with other packages, it is recommended to create a new conda environment and install LIEME using pip.

Usage

Obtaining Input Features by Parsing DFT Data

Input features can be generated for materials for which manual DFT data is available in the following directory structure.

material
โ”œโ”€โ”€ Energy_calculation
โ”œโ”€โ”€ Electronic_calculation
โ”œโ”€โ”€ Bader_calculation
โ”œโ”€โ”€ Intercalation
โ€ƒโ€ƒโ€ƒโ”œโ”€โ”€ n_Li
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒ โ”œโ”€โ”€ Site
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒ โ”œโ”€โ”€ geo_opt
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒ โ”œโ”€โ”€ dos
โ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒโ€ƒ โ”œโ”€โ”€ bader

n in n_Li is a positive integer. Site can be replaced with any custom name. An example of the directory structure is provided in the example directory.

from lieme.featurize import get_material_features

materials = [material]
X = get_material_features(materials=materials)

Obtaining Input Features from Materials Project

Input features can also be generated for materials in Materials Project.

from lieme.mpfetch import FetchMaterials

fetcher = FetchMaterials(api_key="MATERIALS PROJECT API KEY")
X = fetcher.get_material_features()

When fetching materials from Materials Project, standard_constraints are passed to filter results. You can add additional constraints using custom_constraints. standard_constraints can also be switched off by passing standard_constraints=False to get_material_features().

Machine Learning

Machine learned models can be generated and used according to the following procedure.

from lieme.ml import MaterialsEchemRegressor

regressor = MaterialsEchemRegressor()
regressor.generate_train_jobs(n_features=4)
regressor.train(job_id=10)

generate_train_jobs() generates jobs.pkl which contains feature subset tuples such as (feature_name_1, feature_name_2, feature_name_3, feature_name_4). For example, if the total number of features are 20, then combinations(20,4) which is 4845 tuples are present in jobs.pkl. Then, train(job_id) can train the model with the feature subset corresponding to the job_id. After training, the job_id, best model, feature subset and the cross validation score of the best model are saved to an SQLite database.

regressor.write_train_results_to_db()

The performance of new materials can be predicted after training the models.

predictions = regressor.test()

Make sure you have X_train, Y_train and X_test as .pkl files when you run the code mentioned above. If not, pass in X_train and Y_train in train() and X_test in test().

For advanced usage, refer to the detailed documentation in the respective modules.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lieme-0.1.1.tar.gz (279.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lieme-0.1.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file lieme-0.1.1.tar.gz.

File metadata

  • Download URL: lieme-0.1.1.tar.gz
  • Upload date:
  • Size: 279.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for lieme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2b4889c736f9c68081070b48345778544b04012111158ed55ee0ee02f0a39d7
MD5 f1b0750c7ca0078e3be2d58dacfcc793
BLAKE2b-256 4bcf82334d566e897e55c3b6f66fc62e577cdbd00cbf936f61f92cace9387283

See more details on using hashes here.

File details

Details for the file lieme-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lieme-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for lieme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 848b8b791e80b913e99c99f6003e40cd1874de51b9bc99817edf59119fe53f62
MD5 86582e74d8efc9c6254b95f33ddb3ffe
BLAKE2b-256 0e17fa084ad22acb5f2172a8a7708c7263d4fd654df095751f7596d3cbc24e54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page