xnn.common.data.hub.qm7.QM7Builder#
- class xnn.common.data.hub.qm7.QM7Builder[source]#
Bases:
DatasetBuilderBuilder for QM7 (7165 molecules, atomization energies, five folds).
- load(*, split=None, cache_dir, fold=1, units='eV', n_train=None, n_test=None, quiet=False)[source]#
Download and preprocess QM7.
- Parameters:
split (str or None) –
Nonereturns{"train": ..., "test": ...}for the chosenfold;"train"/"test"returns that split;"all"returns every molecule in file order.cache_dir (pathlib.Path) – Base cache directory; the file is stored under
cache_dir/"qm7".fold (int, optional) – Which of the five stratified folds (1-5) is the test set; the other four are the training set. Defaults to 1.
units (str, optional) –
"eV"(default, with positions in Angstrom) or"kcal/mol"(energies as published, positions in Bohr).n_train (int, optional) – Truncate the splits to their first
nmolecules.n_test (int, optional) – Truncate the splits to their first
nmolecules.quiet (bool, optional) – Suppress download progress output.
- Returns:
dict of {str – Structure dicts with
pos(N, 3),atomic_numbers(N,)andenergy(the atomization energy).- Return type:
- Raises:
ImportError – If scipy is not installed.
ValueError – For an unknown
units,splitorfold.