djura.edp_im

ML-based EDP–IM relationship prediction.

class djura.edp_im.predict.BackboneModel(**data)[source]

Bases: BaseModel

period: float
period_c: float | None
case: str | None
site: str | None
period_g: float | None
period_cc: float | None
ductility: float | None
ductility_f: float | None
hardening_ratio: float | None
ah: float | None
damping: float | None
r_plot: List[float] | None
mu_plot: List[float] | None
classmethod str_to_lower(values)[source]
classmethod compute_backbone_plots(model)[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class djura.edp_im.predict.EDPIMModel(**data)[source]

Bases: BaseModel

hysteresis: str
im_type: str | None
method: str | None
backbone: BackboneModel
classmethod str_to_lower(values)[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class djura.edp_im.predict.EDPIMInfillModel(**data)[source]

Bases: BaseModel

period: float
c_y: float
c_rp: float
mu_h: float
mu_s: float
mu_rp: float
mu_ult: float
im_type: str | None
classmethod str_to_lower(values)[source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class djura.edp_im.predict.EDPIMIsolModel(**data)[source]

Bases: BaseModel

R: float
mu: float
delta_max: float
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

djura.edp_im.predict.edp_im(data)[source]
djura.edp_im.predict.edp_im_isol(data)[source]
djura.edp_im.predict.edp_im_infill(data)[source]
djura.edp_im.predict.edp_im_batch(data)[source]
class djura.edp_im.XGBPredict.XGBPredict(im_type, collapse)[source]

Bases: object

ductility_range = array([1.000e-02, 1.100e-01, 2.100e-01, 3.100e-01, 4.100e-01, 5.100e-01,        6.100e-01, 7.100e-01, 8.100e-01, 9.100e-01, 1.010e+00, 1.110e+00,        1.210e+00, 1.310e+00, 1.410e+00, 1.510e+00, 1.610e+00, 1.710e+00,        1.810e+00, 1.910e+00, 2.010e+00, 2.110e+00, 2.210e+00, 2.310e+00,        2.410e+00, 2.510e+00, 2.610e+00, 2.710e+00, 2.810e+00, 2.910e+00,        3.010e+00, 3.110e+00, 3.210e+00, 3.310e+00, 3.410e+00, 3.510e+00,        3.610e+00, 3.710e+00, 3.810e+00, 3.910e+00, 4.010e+00, 4.110e+00,        4.210e+00, 4.310e+00, 4.410e+00, 4.510e+00, 4.610e+00, 4.710e+00,        4.810e+00, 4.910e+00, 5.010e+00, 5.110e+00, 5.210e+00, 5.310e+00,        5.410e+00, 5.510e+00, 5.610e+00, 5.710e+00, 5.810e+00, 5.910e+00,        6.010e+00, 6.110e+00, 6.210e+00, 6.310e+00, 6.410e+00, 6.510e+00,        6.610e+00, 6.710e+00, 6.810e+00, 6.910e+00, 7.010e+00, 7.110e+00,        7.210e+00, 7.310e+00, 7.410e+00, 7.510e+00, 7.610e+00, 7.710e+00,        7.810e+00, 7.910e+00, 8.010e+00, 8.110e+00, 8.210e+00, 8.310e+00,        8.410e+00, 8.510e+00, 8.610e+00, 8.710e+00, 8.810e+00, 8.910e+00,        9.010e+00, 9.110e+00, 9.210e+00, 9.310e+00, 9.410e+00, 9.510e+00,        9.610e+00, 9.710e+00, 9.810e+00, 9.910e+00, 1.001e+01, 1.011e+01,        1.021e+01, 1.031e+01, 1.041e+01, 1.051e+01, 1.061e+01, 1.071e+01,        1.081e+01, 1.091e+01, 1.101e+01, 1.111e+01, 1.121e+01, 1.131e+01,        1.141e+01, 1.151e+01, 1.161e+01, 1.171e+01, 1.181e+01, 1.191e+01])
FEATURE_LOW_BOUND = array([[0.01      , 0.02      , 0.02      , 2.        , 0.25669332]])
FEATURE_UP_BOUND = array([[ 3.        ,  0.2       ,  0.1       ,  8.        , 19.28312206]])
FEATURE_LOW_BOUND_COLLAPSE = array([[0.01, 0.02, 0.02, 2.  ]])
FEATURE_UP_BOUND_COLLAPSE = array([[3. , 0.2, 0.1, 8. ]])
FEATURE_ORDER = ['period', 'damping', 'hardening_ratio', 'ductility', 'actual_ductility_end']
generate_sr_for_ductility(scaler, model, disp_model, period, damping, hardening_ratio, ductility)[source]
estimate_ductility(medians, dispersions, strength_ratio)[source]
property model
make_prediction(scaler, model, dispersions, period, damping, hardening_ratio, ductility, dynamic_ductility=None)[source]

Make predictions using the XGB model

Parameters:
  • period (float) – Period

  • damping (float) – Damping ratio

  • hardening_ratio (float) – Hardening ratio

  • ductility (float) – Hardening ductility of system

  • dynamic_ductility (ndarray) – Ductility where the strength ratio is being predicted, required for non-collapse predictions, by default None

  • strength_ratio (float) – Strength ratio corresponding to which a ductility value is being estimated, by default, None

Returns:

Predictions in dict type:

{"median": float,  # R, ro_2, ro_3, or ductility
 "dispersion": float}

Return type:

PredictionSchema

class djura.edp_im.scaler.MinMaxScaler(lower_bound, upper_bound)[source]

Bases: object

transform(data, min=0, max=1)[source]