Target Transforms¶
matgpr.target_transforms
¶
IdentityTargetTransform
dataclass
¶
No-op target transform with the same interface as other transforms.
Source code in matgpr/target_transforms.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
fit(y, **kwargs)
¶
Validate target values and return the transform.
Source code in matgpr/target_transforms.py
33 34 35 36 | |
transform(y, **kwargs)
¶
Return target values unchanged.
Source code in matgpr/target_transforms.py
38 39 40 | |
fit_transform(y, **kwargs)
¶
Fit the transform and return transformed target values.
Source code in matgpr/target_transforms.py
42 43 44 45 | |
inverse_transform(y_transformed, **kwargs)
¶
Return transformed target values unchanged.
Source code in matgpr/target_transforms.py
47 48 49 | |
inverse_std(mean_transformed, std_transformed, **kwargs)
¶
Return predictive standard deviations unchanged.
Source code in matgpr/target_transforms.py
51 52 53 54 | |
inverse_prediction(prediction, **kwargs)
¶
Return a prediction object in the original target scale.
Source code in matgpr/target_transforms.py
56 57 58 | |
StandardizedTargetTransform
dataclass
¶
Standardize target values using training-set mean and standard deviation.
Source code in matgpr/target_transforms.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
fit(y, **kwargs)
¶
Estimate the mean and standard deviation from training targets.
Source code in matgpr/target_transforms.py
68 69 70 71 72 73 74 75 76 | |
transform(y, **kwargs)
¶
Return standardized target values.
Source code in matgpr/target_transforms.py
78 79 80 81 82 | |
fit_transform(y, **kwargs)
¶
Fit the transform and return standardized target values.
Source code in matgpr/target_transforms.py
84 85 86 87 | |
inverse_transform(y_transformed, **kwargs)
¶
Return standardized values in the original target scale.
Source code in matgpr/target_transforms.py
89 90 91 92 93 | |
inverse_std(mean_transformed, std_transformed, **kwargs)
¶
Return predictive standard deviations in the original target scale.
Source code in matgpr/target_transforms.py
95 96 97 98 99 | |
inverse_prediction(prediction, **kwargs)
¶
Return a prediction object in the original target scale.
Source code in matgpr/target_transforms.py
101 102 103 | |
LogTargetTransform
dataclass
¶
Log-transform positive targets and invert Gaussian predictions.
The transform is z = log(y + offset). Predictive means and standard
deviations are inverted with log-normal moments, which is more appropriate
than simply exponentiating the transformed-space mean.
Source code in matgpr/target_transforms.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
fit(y, **kwargs)
¶
Validate that all shifted target values are positive.
Source code in matgpr/target_transforms.py
121 122 123 124 | |
transform(y, **kwargs)
¶
Return log-transformed target values.
Source code in matgpr/target_transforms.py
126 127 128 129 | |
fit_transform(y, **kwargs)
¶
Fit the transform and return log-transformed target values.
Source code in matgpr/target_transforms.py
131 132 133 134 | |
inverse_transform(y_transformed, **kwargs)
¶
Return log-scale values in the original target scale.
Source code in matgpr/target_transforms.py
136 137 138 139 | |
inverse_std(mean_transformed, std_transformed, **kwargs)
¶
Return original-scale standard deviations from log-normal moments.
Source code in matgpr/target_transforms.py
141 142 143 144 145 146 147 | |
inverse_prediction(prediction, **kwargs)
¶
Return a log-space prediction object in the original target scale.
Source code in matgpr/target_transforms.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
BoundedTargetTransform
dataclass
¶
Logit-transform targets constrained to a finite physical interval.
The transform is:
z = logit((y - lower_bound) / (upper_bound - lower_bound)).
Predictive means and standard deviations are inverted with Gauss-Hermite quadrature over the implied logistic-normal distribution. This is useful for properties with known physical bounds, such as efficiencies, fractions, probabilities, normalized phase fractions, or bounded scores.
Source code in matgpr/target_transforms.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
fit(y, **kwargs)
¶
Validate that targets are strictly inside the physical interval.
Source code in matgpr/target_transforms.py
208 209 210 211 | |
transform(y, **kwargs)
¶
Return logit-transformed target values.
Source code in matgpr/target_transforms.py
213 214 215 216 217 | |
fit_transform(y, **kwargs)
¶
Fit the transform and return logit-transformed target values.
Source code in matgpr/target_transforms.py
219 220 221 222 | |
inverse_transform(y_transformed, **kwargs)
¶
Return logit-space values in the original bounded target scale.
Source code in matgpr/target_transforms.py
224 225 226 227 | |
inverse_std(mean_transformed, std_transformed, **kwargs)
¶
Return original-scale standard deviations from logistic-normal moments.
Source code in matgpr/target_transforms.py
229 230 231 232 233 234 235 | |
inverse_prediction(prediction, **kwargs)
¶
Return a bounded prediction object in the original target scale.
Source code in matgpr/target_transforms.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
PhysicsResidualTransform
dataclass
¶
Model residuals relative to a physics baseline.
This transform supports workflows where a simple physics model provides a
baseline prediction and GPR learns the residual:
residual = observed_target - physics_baseline.
Source code in matgpr/target_transforms.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
fit(y, *, baseline)
¶
Validate target and baseline arrays.
Source code in matgpr/target_transforms.py
297 298 299 300 301 302 | |
transform(y, *, baseline)
¶
Return residual target values.
Source code in matgpr/target_transforms.py
304 305 306 307 308 309 | |
fit_transform(y, *, baseline)
¶
Fit the transform and return residual target values.
Source code in matgpr/target_transforms.py
311 312 313 314 | |
inverse_transform(y_transformed, *, baseline)
¶
Return residual predictions in the original target scale.
Source code in matgpr/target_transforms.py
316 317 318 319 320 321 | |
inverse_std(mean_transformed, std_transformed, **kwargs)
¶
Return residual predictive standard deviations unchanged.
Source code in matgpr/target_transforms.py
323 324 325 326 | |
inverse_prediction(prediction, *, baseline)
¶
Add a physics baseline back to a residual prediction object.
Source code in matgpr/target_transforms.py
328 329 330 | |
TargetTransformSpec
dataclass
¶
Metadata for a reusable materials-property target-transform preset.
The spec documents which transform is usually appropriate for a property type, stores default transform keyword arguments, and builds the concrete transform when requested.
Source code in matgpr/target_transforms.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
build_transform(**overrides)
¶
Build the concrete transform for this property preset.
Source code in matgpr/target_transforms.py
368 369 370 371 372 | |
summary()
¶
Return a compact serializable summary for reports.
Source code in matgpr/target_transforms.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
discovery_record()
¶
Return complete metadata for one transform preset.
Source code in matgpr/target_transforms.py
389 390 391 392 393 394 | |
make_target_transform(name, **kwargs)
¶
Create a target transform by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
One of |
required |
Source code in matgpr/target_transforms.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
make_materials_target_transform(property_name, **overrides)
¶
Build a target transform from a materials-property preset.
Source code in matgpr/target_transforms.py
438 439 440 | |
list_target_transform_specs()
¶
Return registered materials-property target-transform presets.
Source code in matgpr/target_transforms.py
443 444 445 | |
available_target_transform_specs(*, include_aliases=False)
¶
Return available target-transform preset names, optionally with aliases.
Source code in matgpr/target_transforms.py
448 449 450 451 452 453 | |
get_target_transform_spec(name)
¶
Return a target-transform preset by name or alias.
Source code in matgpr/target_transforms.py
456 457 458 459 460 461 462 463 464 465 | |
describe_target_transform_spec(name)
¶
Return complete registry metadata for one target-transform preset.
Source code in matgpr/target_transforms.py
468 469 470 | |
search_target_transform_specs(query=None, *, category=None, tag=None, transform_name=None)
¶
Search registered target-transform presets by text and metadata.
Source code in matgpr/target_transforms.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
summarize_target_transform_specs(*, include_aliases=True)
¶
Return a dataframe summary of registered target-transform presets.
Source code in matgpr/target_transforms.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |