openavmkit.utilities.settings
get_center
get_center(s, gdf=None)
Get the centroid of all the provided parcel geometry
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
gdf
|
GeoDataFrame
|
Parcel geometry |
None
|
Return
tuple[float, float] Centroid of all the parcel geometry
Source code in openavmkit/utilities/settings.py
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 |
|
get_data_dictionary
get_data_dictionary(settings)
Get the data dictionary object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
dict
|
The data dictionary for this locality |
Source code in openavmkit/utilities/settings.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
|
get_fields_boolean
get_fields_boolean(s, df=None, types=None)
Retrieve boolean field names based on settings and optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary containing field configurations. |
required |
df
|
DataFrame
|
DataFrame to filter fields by presence. Defaults to None. |
None
|
types
|
list[str]
|
List of field classification types to include (e.g., ["land", "impr", "other"]). Defaults to None, which includes all types. |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
List of boolean field names matching the specified criteria. |
Source code in openavmkit/utilities/settings.py
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 |
|
get_fields_categorical
get_fields_categorical(s, df=None, include_boolean=False, types=None)
Retrieve categorical field names based on settings and optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary containing field configurations. |
required |
df
|
DataFrame
|
DataFrame to filter fields by presence. Defaults to None. |
None
|
include_boolean
|
bool
|
Whether to include boolean fields in the results or not. Defaults to False. |
False
|
types
|
list[str]
|
List of field classification types to include (e.g., ["land", "impr", "other"]). Defaults to None, which includes all types. |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
List of categorical field names matching the specified criteria. |
Source code in openavmkit/utilities/settings.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 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 |
|
get_fields_date
get_fields_date(s, df)
Get all fields pertaining to dates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
required |
Returns:
Type | Description |
---|---|
list[str]
|
List of field names pertaining to dates |
Source code in openavmkit/utilities/settings.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
get_fields_impr
get_fields_impr(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to buildings/improvements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
dict
|
All fields pertaining to buildings/improvements, organized as a dictionary containing three keys:
|
Source code in openavmkit/utilities/settings.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
get_fields_impr_as_list
get_fields_impr_as_list(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to buildings/improvements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
list
|
A list of all field names pertaining to buildings/improvements |
Source code in openavmkit/utilities/settings.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
get_fields_land
get_fields_land(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to land.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
dict
|
All fields pertaining to land, organized as a dictionary containing three keys:
|
Source code in openavmkit/utilities/settings.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
get_fields_land_as_list
get_fields_land_as_list(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to land.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
list
|
A list of all field names pertaining to land |
Source code in openavmkit/utilities/settings.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
get_fields_numeric
get_fields_numeric(s, df=None, include_boolean=False, types=None)
Retrieve numeric field names based on settings and optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary containing field configurations. |
required |
df
|
DataFrame
|
DataFrame to filter fields by presence. Defaults to None. |
None
|
include_boolean
|
bool
|
Whether to include boolean fields in the results or not. Defaults to False. |
False
|
types
|
list[str]
|
List of field classification types to include (e.g., ["land", "impr", "other"]). Defaults to None, which includes all types. |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
List of numeric field names matching the specified criteria. |
Source code in openavmkit/utilities/settings.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
|
get_fields_other
get_fields_other(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to neither land nor buildings/improvements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
dict
|
All fields pertaining neither to land nor to buildings/improvements, organized as a dictionary containing three keys:
|
Source code in openavmkit/utilities/settings.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|
get_fields_other_as_list
get_fields_other_as_list(s, df=None)
Get all fields in the given dataframe that are classified in settings as pertaining to neither land nor to buildings/improvements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
list
|
A list of all field names pertaining neither to land nor to buildings/improvements |
Source code in openavmkit/utilities/settings.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
get_grouped_fields_from_data_dictionary
get_grouped_fields_from_data_dictionary(dd, group, types=None)
Get all field names from the data dictionary of the named group and, optionally, of the designated types.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dd
|
dict
|
The data dictionary |
required |
group
|
str
|
Name of a particular group in the data dictionary |
required |
types
|
list
|
If None, returns all field names in the group. If not, targets only those fields that match the listed types. Legal values are: "boolean", "str", "number", "percent", "date" |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
A list of field names belonging to the specified group |
Source code in openavmkit/utilities/settings.py
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
|
get_large_area_unit
get_large_area_unit(settings)
Get the designated "large" area unit (acre or hectare)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
str
|
"acre" if units are imperial and "ha" if units are metric |
Source code in openavmkit/utilities/settings.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 |
|
get_long_distance_unit
get_long_distance_unit(settings)
Get the designated "long" distance unit (mile or kilometer)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
str
|
"mile" if units are imperial and "km" if units are metric |
Source code in openavmkit/utilities/settings.py
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
|
get_model_group
get_model_group(s, key)
Get a model group definition object from the settings dictionary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings object |
required |
key
|
str
|
The name of the model group |
required |
Returns:
Type | Description |
---|---|
dict
|
Model group definition |
Source code in openavmkit/utilities/settings.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
get_model_group_ids
get_model_group_ids(settings, df=None)
Get all model group ids specified in settings, in the preferred order specified by the user
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
Ordered list of model group ids |
Source code in openavmkit/utilities/settings.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
|
get_short_distance_unit
get_short_distance_unit(settings)
Get the designated "short" distance unit (foot or meter)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
str
|
"ft" if units are imperial and "m" if units are metric |
Source code in openavmkit/utilities/settings.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
|
get_small_area_unit
get_small_area_unit(settings)
Get the designated "small" area unit (square feet or square meters)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
str
|
"sqft" if units are imperial and "sqm" if units are metric |
Source code in openavmkit/utilities/settings.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
|
get_valuation_date
get_valuation_date(s)
Get the valuation date from the settings dictionary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
dict
|
Settings dictionary |
required |
Returns:
Type | Description |
---|---|
datetime
|
The valuation date |
Source code in openavmkit/utilities/settings.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
get_variable_interactions
get_variable_interactions(entry, settings, df=None)
Get variable interaction information from a dictionary object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entry
|
dict
|
The dictionary object that may contain variable interactions |
required |
settings
|
dict
|
Global settings dictionary |
required |
df
|
DataFrame
|
Your dataset |
None
|
Returns:
Type | Description |
---|---|
dict | None
|
Interactions dictionary which maps field names to other field names, indicating variable interactions. Example: Interacting a categorical field like "neighborhood" with a numeric field like "land_area_sqft" means that every one-hot-encoded descendant like "neighborhood=River Heights" will be multiplied against the numeric value of "land_area_sqft", so this is a way to interact neighborhood dummies with land size. |
Source code in openavmkit/utilities/settings.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
|
load_settings
load_settings(settings_file='in/settings.json', settings_object=None, error=True, warning=True)
Load settings file from disk
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings_file
|
str
|
Path to the settings file |
'in/settings.json'
|
settings_object
|
dict
|
Already loaded settings object |
None
|
error
|
bool
|
Whether to raise errors or simply emit warnings if something is wrong |
True
|
warning
|
bool
|
Whether to emit warnings if something is wrong |
True
|
Returns:
Type | Description |
---|---|
dict
|
The settings object |
Source code in openavmkit/utilities/settings.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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 59 60 61 62 63 |
|