Skip to main content

CBFV Package

Tool to quickly create a composition-based feature vectors from materials datafiles.

Installation

The source code is currently hosted on GitHub at: https://github.com/kaaiian/CBFV

Binary installers for the latest released version are available at the Python Package Index (PyPI)

# PyPI
pip install CBFV

Making the composition-based feature vector

The CBFV package assumes your data is stored in a pandas dataframe of the following structure:

formula target
Tc1V1 248.539
Cu1Dy1 66.8444
Cd3N2 91.5034

To featurize this data, the generate_features function can be called as follows:

from CBFV import composition
X, y, formulae, skipped = composition.generate_features(df)

Extended Functionality

The featurization scheme can be adjusted by calling the the elem_prop parameter. The following featurization schemes are included within CBFV:

  • jarvis
  • magpie
  • mat2vec
  • oliynyk (default)
  • onehot
  • random_200

Duplicate formula handeling is controlled by the drop_duplicates parameter. It is set to False by default to preserve datapoints containing variation outside of their formula. For example, heat capacity measurements performed for the same material at different temperatures.

The extend_features parameter is used to specify whether columns outside of ['formula', 'target'] should be considered during featurization. It is set to False by default to exclude nuisance information from consideration. Setting extend_features=True would allow additional information (i.e. ['temperature', 'pressure']) to be preserved.

The sum_feat parameter specifies whether to calculate the sum features when generating the CBFVs for the chemical formulae. It is set to False by default.

Calling generate_features with these parameters can be implemented as follows:

formula target temp
Tc1V1 248.539 373
Tc1V1 66.8444 473
Cd3N2 91.5034 273
from CBFV import composition
X, y, formulae, skipped = composition.generate_features(df,
                                                        elem_prop='magpie',
                                                        drop_duplicates=False,
                                                        extend_features=True,
                                                        sum_feat=True)

Release files for composition_based_feature_vector 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for composition_based_feature_vector 1.0.6
File Size Uploaded
composition_based_feature_vector-1.0.6.tar.gz 5.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for composition_based_feature_vector 1.0.6
File Interpreter ABI Platform
composition_based_feature_vector-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / composition_based_feature_vector-1.0.6.tar.gz

Download URL composition_based_feature_vector-1.0.6.tar.gz
Size 5.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a71e95c91eb83a680ecd9c862410a071c79429afddf853394f4dbf469f359f4d
BLAKE2b-256 checksum
How to use checksums
841ff83fbf0c6435f3507bd3919f7cdb336282ed50cc3136ce1e7919a6ad40eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / composition_based_feature_vector-1.0.6-py3-none-any.whl

Download URL composition_based_feature_vector-1.0.6-py3-none-any.whl
Size 543.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d89e5fa27af9cbe47a8985dcdca2ef4702ff458c7043a882c7e3ccf8e30da76
BLAKE2b-256 checksum
How to use checksums
928e00fa3b1718d5793dea7d4af38081bba672832476d6ebe008409a5ef578ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page