Skip to main content
Ctrl+K

Abil 25.05.01 documentation

  • Installation
  • User Guide
  • API Reference
  • How to contribute
  • Installation
  • User Guide
  • API Reference
  • How to contribute

Section Navigation

  • Tune
  • Predict
  • Post
  • Ensemble Prediction Statistics
  • Zero Stratified KFolds
  • Zero Inflated Regressor
  • Log Grid Search
  • Area of Applicability
  • Utility Functions
  • API Reference
  • Log Grid Search

Log Grid Search#

class abil.log_grid_search.LogGridSearch(m, verbose, cv, param_grid, scoring, regions=None)#

Bases: object

Perform grid search with optional logarithmic transformation of the target variable.

Supports evaluating models with no transformation, log-transformation, or both.

do_exp(x)#

Apply exponential transformation to the input values.

Parameters:

x (array-like) – Input values.

Returns:

y – Exponentially transformed values.

Return type:

array-like

do_log(x)#

Apply natural logarithm transformation to the input values.

Parameters:

x (array-like) – Input values.

Returns:

y – Log-transformed values.

Return type:

array-like

do_nothing(x)#

Apply no transformation to the input values.

Parameters:

x (array-like) – Input values.

Returns:

y – Non-transformed values.

Return type:

array-like

transformed_fit(X, y, log, predictors)#

Perform grid search with optional log transformation on the target variable.

Parameters:
  • X (pd.DataFrame or np.ndarray) – Feature matrix.

  • y (pd.Series or np.ndarray) – Target variable.

  • log (str) – Transformation mode: “yes” (log transform), “no” (no transform), or “both” (test both).

  • predictors (list) – Predictors used for training (not directly used in the function).

Returns:

Fitted grid search instance for the best-performing model.

Return type:

GridSearchCV

Notes

  • Applies log transformation using TransformedTargetRegressor when log=”yes”.

  • If log=”both”, compares models with and without log transformation.

  • Uses self.param_grid, self.scoring, and self.cv for grid search.

Raises:

ValueError – If log is not “yes”, “no”, or “both”.

previous

Zero Inflated Regressor

next

Area of Applicability

© Copyright 2024, Abil developers.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.