mixture_T_id listlengths 3 3 | value float64 -14.94 8.34 | T float64 293 323 | P float64 99.6 103 | cmp_ids listlengths 2 2 | cmp_mole_fractions listlengths 2 2 |
|---|---|---|---|---|---|
[
0,
1,
298
] | -6.536882 | 298.15 | 101 | [
0,
1
] | [
0.5,
0.5
] |
[
1,
2,
298
] | -6.858013 | 298.15 | 101 | [
2,
1
] | [
0.5,
0.5
] |
[
1,
3,
298
] | -6.400938 | 298.15 | 101 | [
3,
1
] | [
0.5,
0.5
] |
[
1,
4,
298
] | -6.44591 | 298.15 | 101 | [
1,
4
] | [
0.5,
0.5
] |
[
1,
5,
298
] | -6.863738 | 298.15 | 101 | [
1,
5
] | [
0.5,
0.5
] |
[
1,
6,
298
] | -6.873354 | 298.15 | 101 | [
1,
6
] | [
0.5,
0.5
] |
[
1,
7,
298
] | -6.50496 | 298.15 | 101 | [
1,
7
] | [
0.5,
0.5
] |
[
1,
8,
298
] | -6.265901 | 298.15 | 101 | [
1,
8
] | [
0.5,
0.5
] |
[
1,
9,
298
] | -6.439002 | 298.15 | 101 | [
1,
9
] | [
0.5,
0.5
] |
[
1,
10,
298
] | -6.470146 | 298.15 | 101 | [
1,
10
] | [
0.5,
0.5
] |
[
11,
12,
298
] | -6.533437 | 298.15 | 101 | [
11,
12
] | [
0.5,
0.5
] |
[
12,
13,
298
] | -6.534813 | 298.15 | 101 | [
13,
12
] | [
0.5,
0.5
] |
[
12,
14,
298
] | -6.536192 | 298.15 | 101 | [
14,
12
] | [
0.5,
0.5
] |
[
1,
15,
298
] | -7.072748 | 298.15 | 101 | [
1,
15
] | [
0.5,
0.5
] |
[
1,
16,
298
] | -6.934305 | 298.15 | 101 | [
1,
16
] | [
0.5,
0.5
] |
[
17,
18,
301
] | -6.265901 | 301.05 | 101.32 | [
17,
18
] | [
0.7073,
0.2927
] |
[
19,
20,
303
] | -5.903454 | 303.15 | 101 | [
19,
20
] | [
0.05093,
0.94907
] |
[
19,
20,
303
] | -5.777644 | 303.15 | 101 | [
19,
20
] | [
0.07611,
0.92389
] |
[
19,
20,
303
] | -5.435283 | 303.15 | 101 | [
19,
20
] | [
0.13222,
0.86778
] |
[
19,
20,
303
] | -5.151623 | 303.15 | 101 | [
19,
20
] | [
0.17385,
0.82615
] |
[
19,
20,
303
] | -4.622927 | 303.15 | 101 | [
19,
20
] | [
0.24116,
0.75884
] |
[
19,
20,
303
] | -3.819444 | 303.15 | 101 | [
19,
20
] | [
0.32694,
0.67306
] |
[
19,
20,
303
] | -3.358138 | 303.15 | 101 | [
19,
20
] | [
0.36845,
0.63155
] |
[
19,
20,
303
] | -3.046605 | 303.15 | 101 | [
19,
20
] | [
0.39334,
0.60666
] |
[
19,
20,
303
] | -2.702913 | 303.15 | 101 | [
19,
20
] | [
0.42386,
0.57614
] |
[
19,
20,
303
] | -2.431783 | 303.15 | 101 | [
19,
20
] | [
0.45128,
0.54872
] |
[
19,
20,
303
] | -2.006191 | 303.15 | 101 | [
19,
20
] | [
0.5139,
0.4861
] |
[
19,
20,
303
] | -1.872753 | 303.15 | 101 | [
19,
20
] | [
0.55271,
0.44729
] |
[
19,
20,
303
] | -1.82325 | 303.15 | 101 | [
19,
20
] | [
0.58256,
0.41744
] |
[
19,
20,
303
] | -1.828838 | 303.15 | 101 | [
19,
20
] | [
0.63601,
0.36399
] |
[
19,
20,
303
] | -1.853422 | 303.15 | 101 | [
19,
20
] | [
0.66045,
0.33955
] |
[
19,
20,
303
] | -2.011409 | 303.15 | 101 | [
19,
20
] | [
0.72899,
0.27101
] |
[
19,
20,
303
] | -2.061995 | 303.15 | 101 | [
19,
20
] | [
0.80883,
0.19117
] |
[
19,
20,
303
] | -2.061995 | 303.15 | 101 | [
19,
20
] | [
0.81944,
0.18056
] |
[
19,
20,
303
] | -1.979053 | 303.15 | 101 | [
19,
20
] | [
0.89099,
0.10901
] |
[
19,
20,
303
] | -1.929643 | 303.15 | 101 | [
19,
20
] | [
0.90886,
0.09114
] |
[
19,
20,
303
] | -1.776674 | 303.15 | 101 | [
19,
20
] | [
0.9478,
0.0522
] |
[
19,
20,
303
] | -1.675578 | 303.15 | 101 | [
19,
20
] | [
0.96579,
0.03421
] |
[
19,
20,
303
] | -1.662311 | 303.15 | 101 | [
19,
20
] | [
0.96839,
0.03161
] |
[
19,
20,
303
] | -1.628111 | 303.15 | 101 | [
19,
20
] | [
0.97373,
0.02627
] |
[
19,
20,
303
] | -1.594549 | 303.15 | 101 | [
19,
20
] | [
0.98265,
0.01735
] |
[
19,
20,
303
] | -1.57552 | 303.15 | 101 | [
19,
20
] | [
0.99147,
0.00853
] |
[
21,
22,
293
] | -7.804243 | 293.17 | 101.32 | [
21,
22
] | [
0.183,
0.817
] |
[
21,
22,
295
] | -7.824046 | 294.57 | 101.32 | [
21,
22
] | [
0.183,
0.817
] |
[
21,
22,
296
] | -7.836625 | 296.3 | 101.32 | [
21,
22
] | [
0.183,
0.817
] |
[
21,
22,
294
] | -7.501963 | 293.77 | 101.32 | [
21,
22
] | [
0.287,
0.713
] |
[
21,
22,
295
] | -7.523941 | 295.17 | 101.32 | [
21,
22
] | [
0.287,
0.713
] |
[
21,
22,
297
] | -7.544522 | 296.57 | 101.32 | [
21,
22
] | [
0.287,
0.713
] |
[
21,
22,
298
] | -7.569404 | 298.25 | 101.32 | [
21,
22
] | [
0.287,
0.713
] |
[
21,
22,
294
] | -7.501963 | 293.77 | 101.32 | [
21,
22
] | [
0.36,
0.64
] |
[
21,
22,
295
] | -7.523941 | 295.17 | 101.32 | [
21,
22
] | [
0.36,
0.64
] |
[
21,
22,
297
] | -7.544522 | 296.57 | 101.32 | [
21,
22
] | [
0.36,
0.64
] |
[
21,
22,
298
] | -7.569404 | 298.15 | 101.32 | [
21,
22
] | [
0.36,
0.64
] |
[
21,
22,
294
] | -7.268725 | 293.65 | 101.32 | [
21,
22
] | [
0.419,
0.581
] |
[
21,
22,
295
] | -7.337001 | 294.75 | 101.32 | [
21,
22
] | [
0.419,
0.581
] |
[
21,
22,
297
] | -7.384179 | 296.85 | 101.32 | [
21,
22
] | [
0.419,
0.581
] |
[
21,
22,
298
] | -7.410282 | 298.35 | 101.32 | [
21,
22
] | [
0.419,
0.581
] |
[
21,
22,
293
] | -7.180877 | 293.275 | 101.32 | [
21,
22
] | [
0.453,
0.547
] |
[
21,
22,
295
] | -7.275925 | 294.85 | 101.32 | [
21,
22
] | [
0.453,
0.547
] |
[
21,
22,
296
] | -7.315724 | 296.4 | 101.32 | [
21,
22
] | [
0.453,
0.547
] |
[
21,
22,
299
] | -7.34626 | 298.55 | 101.32 | [
21,
22
] | [
0.453,
0.547
] |
[
21,
22,
294
] | -7.13215 | 294.1 | 101.32 | [
21,
22
] | [
0.559,
0.441
] |
[
21,
22,
296
] | -7.162648 | 296.05 | 101.32 | [
21,
22
] | [
0.559,
0.441
] |
[
21,
22,
298
] | -7.199445 | 298.07 | 101.32 | [
21,
22
] | [
0.559,
0.441
] |
[
21,
22,
295
] | -7.034453 | 294.75 | 101.32 | [
21,
22
] | [
0.629,
0.371
] |
[
21,
22,
296
] | -7.057416 | 296.45 | 101.32 | [
21,
22
] | [
0.629,
0.371
] |
[
21,
22,
298
] | -7.086882 | 298.25 | 101.32 | [
21,
22
] | [
0.629,
0.371
] |
[
21,
22,
294
] | -6.821578 | 293.66 | 101.32 | [
21,
22
] | [
0.732,
0.268
] |
[
21,
22,
296
] | -6.858965 | 295.88 | 101.32 | [
21,
22
] | [
0.732,
0.268
] |
[
21,
22,
297
] | -6.878196 | 297.45 | 101.32 | [
21,
22
] | [
0.732,
0.268
] |
[
23,
24,
295
] | -6.781123 | 295.3 | 101.325 | [
23,
24
] | [
0.0321,
0.9679
] |
[
24,
25,
313
] | -7.07263 | 313.15 | 101.325 | [
25,
24
] | [
0.0222,
0.9778
] |
[
24,
25,
313
] | -6.624835 | 313.15 | 101.325 | [
25,
24
] | [
0.0806,
0.9194
] |
[
24,
25,
313
] | -6.327777 | 313.15 | 101.325 | [
25,
24
] | [
0.17,
0.83
] |
[
24,
26,
313
] | -7.223837 | 313.15 | 101.325 | [
26,
24
] | [
0.0417,
0.9583
] |
[
24,
26,
313
] | -7.119712 | 313.15 | 101.325 | [
26,
24
] | [
0.144,
0.856
] |
[
24,
26,
313
] | -6.991137 | 313.15 | 101.325 | [
26,
24
] | [
0.281,
0.719
] |
[
24,
29,
293
] | -6.836365 | 293.15 | 101.325 | [
29,
24
] | [
0.0021,
0.9979
] |
[
24,
29,
293
] | -6.791752 | 293.15 | 101.325 | [
29,
24
] | [
0.0042,
0.9958
] |
[
24,
29,
293
] | -6.522493 | 293.15 | 101.325 | [
29,
24
] | [
0.0052,
0.9948
] |
[
24,
29,
303
] | -7.069098 | 303.15 | 101.325 | [
29,
24
] | [
0.0021,
0.9979
] |
[
24,
29,
303
] | -7.019805 | 303.15 | 101.325 | [
29,
24
] | [
0.0042,
0.9958
] |
[
24,
29,
303
] | -7.005368 | 303.15 | 101.325 | [
29,
24
] | [
0.0052,
0.9948
] |
[
24,
29,
313
] | -7.274481 | 313.15 | 101.325 | [
29,
24
] | [
0.0021,
0.9979
] |
[
24,
29,
313
] | -7.234871 | 313.15 | 101.325 | [
29,
24
] | [
0.0042,
0.9958
] |
[
24,
29,
323
] | -7.435388 | 323.15 | 101.325 | [
29,
24
] | [
0.0021,
0.9979
] |
[
24,
29,
323
] | -7.390642 | 323.15 | 101.325 | [
29,
24
] | [
0.0042,
0.9958
] |
[
24,
30,
293
] | -6.807005 | 293.15 | 101.325 | [
30,
24
] | [
0.0036,
0.9964
] |
[
24,
30,
293
] | -6.758474 | 293.15 | 101.325 | [
30,
24
] | [
0.0073,
0.9927
] |
[
24,
30,
313
] | -7.230719 | 313.15 | 101.325 | [
30,
24
] | [
0.0036,
0.9964
] |
[
24,
30,
313
] | -7.206161 | 313.15 | 101.325 | [
30,
24
] | [
0.0073,
0.9927
] |
[
24,
31,
293
] | -6.790862 | 293.15 | 101.325 | [
31,
24
] | [
0.0049,
0.9951
] |
[
24,
31,
293
] | -6.707266 | 293.15 | 101.325 | [
31,
24
] | [
0.01,
0.99
] |
[
24,
31,
293
] | -6.621074 | 293.15 | 101.325 | [
31,
24
] | [
0.015,
0.985
] |
[
24,
31,
293
] | -6.534125 | 293.15 | 101.325 | [
31,
24
] | [
0.021,
0.979
] |
[
24,
32,
293
] | -6.62861 | 293.15 | 101.325 | [
32,
24
] | [
0.0263,
0.9737
] |
[
24,
32,
293
] | -6.226175 | 293.15 | 101.325 | [
32,
24
] | [
0.0944,
0.9056
] |
[
24,
32,
293
] | -5.951859 | 293.15 | 101.325 | [
32,
24
] | [
0.196,
0.804
] |
[
24,
32,
313
] | -7.060906 | 313.15 | 101.325 | [
32,
24
] | [
0.0263,
0.9737
] |
[
24,
32,
313
] | -6.735484 | 313.15 | 101.325 | [
32,
24
] | [
0.0944,
0.9056
] |
NIST log-viscosity — base dataset + per-fit CSVs
A two-layer dataset:
points(HF dataset main payload) — the binary-only chemixhubnist-logVmeasurements plus amixture_T_idjoin key. Immutable; one row per measurement. This is the data layer.fits/<name>.csv— one CSV per fit, keyed onmixture_T_id. Each CSV holds whatever that fitter's results look like — fit parameters plus a small canonical set (pure_at_x0,pure_at_x1,nonlinearity). Multiple fits coexist; pushing a new fit doesn't touch the base data.
Built by mixtureml-data.
What's in the box
points(HF dataset main payload, ~150K rows) — one row per measurement. Columns:mixture_T_id,value(log viscosity),T(K),P(bar),cmp_ids(length-2 list of chemixhub compound IDs),cmp_mole_fractions(length-2 list, aligned withcmp_ids).compounds.csv— chemixhub'scompound_id → smilesmap, filtered to the IDs that appear inpoints. Lets downstream consumers translatecmp_idsto SMILES without depending on the chemixhub repo.fits/rk_loocv.csv— the inaugural fit. One row per (mixture, integer-rounded T-bin), keyed onmixture_T_id. See the schema below.
Additional fits can be pushed alongside fits/rk_loocv.csv without
disturbing anything else; each has its own filename.
Method: rk_loocv fit
Per binary mixture and per integer-rounded T-bin (≥ 4 measurement rows), fit the Redlich-Kister model:
y(x) = β_2·(1 − x) + β_1·x + x(1 − x) · Σᵢ aᵢ (2x − 1)ⁱ for i = 0..p
└──── ψ (ideal) ─────┘ └──────── δ (excess) ──────────┘
The polynomial degree p ∈ {0, 1, 2, 3} is selected per bin via
leave-one-out cross-validation on the Predictive Average Relative
Deviation (PARD):
PARD = (100 / N) · Σ_i |y_pred^(−i) − y_i| / |y_i|
Closed-form LOO via the OLS hat-matrix diagonal: r_loo_i = r_i / (1 − h_ii).
The winning p minimizes PARD. This is the methodology of Ramírez-de-Santiago,
Viscosity of Binary Liquid Mixtures, Ind. Eng. Chem. Res. 2024, 63,
22470−22480 (§2, eqs 3–5).
For RkLoocvFitter, pure_at_x0 and pure_at_x1 equal β_2 and β_1
exactly (the excess vanishes at x = 0 and x = 1 because of the
x(1 − x) factor). nonlinearity is the L2 norm of the excess on [0, 1],
computed analytically: √(a^T G a) where G_ij = ∫₀¹ x²(1−x)² (2x−1)^(i+j) dx.
Loading
import ast
from datasets import load_dataset
from huggingface_hub import hf_hub_download
import pandas as pd
REPO = "ai4chems/nist-logv-binary"
# Base data
points = load_dataset(REPO, split="train").to_pandas()
compounds = pd.read_csv(hf_hub_download(REPO, "compounds.csv", repo_type="dataset"))
# RK-LOOCV fit
rk = pd.read_csv(hf_hub_download(REPO, "fits/rk_loocv.csv", repo_type="dataset"))
# Sidecar cmp_ids columns come back as stringified lists — parse if needed:
rk["cmp_ids"] = rk["cmp_ids"].apply(ast.literal_eval)
rk["mixture_T_id"] = rk["mixture_T_id"].apply(ast.literal_eval)
# Join points ↔ fit on mixture_T_id (single column).
points["mixture_T_id_t"] = points["mixture_T_id"].apply(tuple)
rk["mixture_T_id_t"] = rk["mixture_T_id"].apply(tuple)
joined = points.merge(rk, on="mixture_T_id_t", how="left", suffixes=("", "_fit"))
# compound_id → SMILES lookup.
smiles = compounds.set_index("compound_id")["smiles"].to_dict()
Reconstructing per-row predictions
The fit CSV publishes the per-bin coefficients only; per-row predictions are recomputable in closed form:
import numpy as np
def rk_predict(row):
"""row from the joined frame: needs x_1, beta_1=pure_at_x1, beta_2=pure_at_x0, a_0..a_3."""
x1_arr = np.array(row["cmp_mole_fractions"])
c1 = min(row["cmp_ids"])
x = float(x1_arr[list(row["cmp_ids"]).index(c1)])
base = x * (1.0 - x)
skew = 2.0 * x - 1.0
excess = 0.0
for i in range(4):
a_i = row.get(f"a_{i}")
if a_i is not None and not np.isnan(a_i):
excess += a_i * (skew ** i)
return row["pure_at_x1"] * x + row["pure_at_x0"] * (1.0 - x) + base * excess
nonlinearity and linear_span = pure_at_x1 − pure_at_x0 are likewise
downstream computations.
Schema
points (HF dataset main payload)
mixture_T_id—[cmp_id1_sorted, cmp_id2_sorted, round(T)]. The join key.value— log viscosity (chemixhub-canonical column name).T,P— temperature (K), pressure (bar).cmp_ids— length-2 list of chemixhub compound IDs.cmp_mole_fractions— length-2 list of mole fractions, aligned withcmp_ids.
fits/rk_loocv.csv
Bin metadata (duplicated so the CSV is self-contained):
mixture_T_id,cmp_ids,T— keys.n_in_bin— number of measurement rows in this bin.T_min,T_max,P_min,P_max— actual spans of the bin's measurements (T_minandT_maxtypically straddleT).
Canonical fit columns (every fit CSV has these):
pure_at_x0— fitted curve atx = 0.pure_at_x1— fitted curve atx = 1.nonlinearity— L2 norm of(curve − linear baseline)on[0, 1].minima_x,minima_value—argmin/minof the fitted curve on[0, 1]; endpoints are valid candidates. Never NaN.maxima_x,maxima_value—argmax/maxof the fitted curve on[0, 1]; endpoints are valid candidates. Never NaN.
rk_loocv-specific columns:
best_p— the LOOCV-selected RK degree (∈ {0, 1, 2, 3}).best_pard— the predictive ARD (%) atbest_p(lower is better; cross-validated, so it tracks generalization).best_aard— the training-set ARD (%) atbest_p(lower-bounded by PARD; closer to PARD ⇒ less overfitting headroom).a_0,a_1,a_2,a_3— RK excess coefficients. Coefficients with indexi > best_pare NaN.
Source
Built from chemixhub's processed_NISTlogV.csv
(chemcognition-lab/chemixhub),
which derives from the NIST log-viscosity benchmark. Compound IDs are
those used by chemixhub.
Single-source filter: every (cmp_ids, round(T)) bin in the published
data comes from a single chemixhub Ref_ID. Bins where the source data
contained measurements from more than one reference were dropped at load
time, before fitting. Different references reporting the same nominal
measurement typically have systematic offsets, and pooling them would
distort the RK fit.
- Downloads last month
- 28