Release 12 (from main)
This commit is contained in:
@@ -1 +1 @@
|
|||||||
store_name: SUSE Store<lb>version: 11<lb>models:<lb>- name: linear_regression<lb> version: 1.2.2<lb>- name: xgboost<lb> version: 1.2.1<lb>runtimes:<lb> basic:<lb> path: runtime/basic.yaml<lb> version: 8<lb> single:<lb> path: runtime/single.yaml<lb> version: 1<lb> xgboost:<lb> path: runtime/xgboost.yaml<lb> version: 8<lb>
|
store_name: SUSE Store<lb>version: 12<lb>models:<lb>- name: linear_regression<lb> version: 1.2.3<lb>- name: xgboost<lb> version: 1.2.1<lb>runtimes:<lb> basic:<lb> path: runtime/basic.yaml<lb> version: 8<lb> single:<lb> path: runtime/single.yaml<lb> version: 1<lb> xgboost:<lb> path: runtime/xgboost.yaml<lb> version: 8<lb>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
store_name: SUSE Store
|
store_name: SUSE Store
|
||||||
version: 11
|
version: 12
|
||||||
models:
|
models:
|
||||||
- name: linear_regression
|
- name: linear_regression
|
||||||
version: 1.2.2
|
version: 1.2.3
|
||||||
- name: xgboost
|
- name: xgboost
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
runtimes:
|
runtimes:
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ These parameters are defined in the `model.yaml` under `model.input_map` and are
|
|||||||
| `degree` | `2` | Degree of the polynomial used to create polynomial features. |
|
| `degree` | `2` | Degree of the polynomial used to create polynomial features. |
|
||||||
| `interaction_only` | `true` | Whether to include only interaction features in polynomial features. |
|
| `interaction_only` | `true` | Whether to include only interaction features in polynomial features. |
|
||||||
| `verbose` | `true` | Enable verbose output during model execution. |
|
| `verbose` | `true` | Enable verbose output during model execution. |
|
||||||
| `clipping_max` | `100` | Maximum value for clipping prediction output. |
|
| `clipping_max` | `100` | Optional maximum for prediction output (number, decimals allowed). |
|
||||||
| `clipping_min` | `0` | Minimum value for clipping prediction output. |
|
| `clipping_min` | `0` | Optional minimum for prediction output (number, decimals allowed). |
|
||||||
|
|
||||||
## Data Preprocessor (`DataPreprocessor`)
|
## Data Preprocessor (`DataPreprocessor`)
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Neither method mutates the passed DataFrames.
|
|||||||
- If `variable_columns` is not set, it is inferred during `fit` as all columns except the target.
|
- If `variable_columns` is not set, it is inferred during `fit` as all columns except the target.
|
||||||
- Polynomial features are created automatically when `degree > 1`.
|
- Polynomial features are created automatically when `degree > 1`.
|
||||||
- Rows with NaN in any model input get a NaN prediction (the output always has one value per input row); rows with NaN features or NaN target are left out of the fit.
|
- Rows with NaN in any model input get a NaN prediction (the output always has one value per input row); rows with NaN features or NaN target are left out of the fit.
|
||||||
- `clipping` uses Q1/Q3 of the training target when replacing out-of-bounds predictions.
|
- `clipping` uses Q1/Q3 of the training target when replacing out-of-bounds predictions: a prediction above `clipping_max` becomes Q3, one below `clipping_min` becomes Q1 (a prediction equal to the limit is kept). Each limit is optional and independent — set only one and only that side is checked.
|
||||||
- The wrapper enforces that `wrapper.target` is set before training or retraining; otherwise, a `ValueError` is raised to fail fast when the configuration is incomplete.
|
- The wrapper enforces that `wrapper.target` is set before training or retraining; otherwise, a `ValueError` is raised to fail fast when the configuration is incomplete.
|
||||||
|
|
||||||
All parameters documented above **must stay in sync** between:
|
All parameters documented above **must stay in sync** between:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ requirements:
|
|||||||
- mlflow==3.8.1
|
- mlflow==3.8.1
|
||||||
- git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.11.0
|
- git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.11.0
|
||||||
- git+ssh://git@github.com/Aignosi/sientia-model-library.git@0.14.3
|
- git+ssh://git@github.com/Aignosi/sientia-model-library.git@0.14.3
|
||||||
version: 1.2.2
|
version: 1.2.3
|
||||||
type: model
|
type: model
|
||||||
model:
|
model:
|
||||||
class: LinearRegressionModel
|
class: LinearRegressionModel
|
||||||
|
|||||||
@@ -73,6 +73,15 @@ class LinearRegressionModel(BaseEstimator, TransformerMixin):
|
|||||||
+ ', '.join(missing_model_features)
|
+ ', '.join(missing_model_features)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _apply_clipping(self, predictions: np.ndarray) -> None:
|
||||||
|
"""Replace in place predictions above max with Q3 and below min with Q1."""
|
||||||
|
for i in range(len(predictions)):
|
||||||
|
# Each limit is optional on its own (SIENTIAPDE-2219)
|
||||||
|
if 'max' in self.clipping and predictions[i] > self.clipping['max']:
|
||||||
|
predictions[i] = self.q3_target
|
||||||
|
elif 'min' in self.clipping and predictions[i] < self.clipping['min']:
|
||||||
|
predictions[i] = self.q1_target
|
||||||
|
|
||||||
def create_poly_features(self, input_data: pd.DataFrame, fit: bool = False) -> pd.DataFrame:
|
def create_poly_features(self, input_data: pd.DataFrame, fit: bool = False) -> pd.DataFrame:
|
||||||
"""
|
"""
|
||||||
Function to create polynomial features
|
Function to create polynomial features
|
||||||
@@ -289,13 +298,8 @@ class LinearRegressionModel(BaseEstimator, TransformerMixin):
|
|||||||
print(f'X_test shape after removing NaN rows: {x_valid.shape}')
|
print(f'X_test shape after removing NaN rows: {x_valid.shape}')
|
||||||
|
|
||||||
valid_pred = self.regr.predict(x_valid[model_features])
|
valid_pred = self.regr.predict(x_valid[model_features])
|
||||||
|
|
||||||
if self.clipping:
|
if self.clipping:
|
||||||
for i in range(len(valid_pred)):
|
self._apply_clipping(valid_pred)
|
||||||
if valid_pred[i] > self.clipping['max']:
|
|
||||||
valid_pred[i] = self.q3_target
|
|
||||||
elif valid_pred[i] < self.clipping['min']:
|
|
||||||
valid_pred[i] = self.q1_target
|
|
||||||
|
|
||||||
y_pred[row_mask.to_numpy()] = valid_pred
|
y_pred[row_mask.to_numpy()] = valid_pred
|
||||||
return y_pred
|
return y_pred
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ components:
|
|||||||
example: true
|
example: true
|
||||||
description: "Enable verbose output during model execution."
|
description: "Enable verbose output during model execution."
|
||||||
clipping_max:
|
clipping_max:
|
||||||
type: integer
|
type: number
|
||||||
default: null
|
default: null
|
||||||
example: 100
|
example: 100
|
||||||
description: "Maximum value for clipping prediction output."
|
description: "Maximum value for clipping prediction output."
|
||||||
clipping_min:
|
clipping_min:
|
||||||
type: integer
|
type: number
|
||||||
default: null
|
default: null
|
||||||
example: 0
|
example: 0
|
||||||
description: "Minimum value for clipping prediction output."
|
description: "Minimum value for clipping prediction output."
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
## Version Change
|
## Version Change
|
||||||
|
|
||||||
- **Previous version**: 10
|
- **Previous version**: 11
|
||||||
- **New version**: 11
|
- **New version**: 12
|
||||||
|
|
||||||
## Model Changes
|
## Model Changes
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
### 🔄 Updated Models (2)
|
### 🔄 Updated Models (2)
|
||||||
|
|
||||||
- **linear_regression** (version: 1.2.2)
|
- **linear_regression** (version: 1.2.3)
|
||||||
- **xgboost** (version: 1.2.1)
|
- **xgboost** (version: 1.2.1)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user