airbornegeo.trend#
- trend(data_to_fit, cols_to_fit, data_to_predict, cols_to_predict, degree, intersection_weight_col=None)[source]#
Fit a polynomial trend using scikit-learn and predict values at new locations.
The polynomial degree is automatically reduced if there are insufficient observations to constrain the requested model.
- Parameters:
data_to_fit (
DataFrame) â Data used to fit the polynomial.cols_to_fit (
list[str]) â Two column names specifying the independent and dependent variables, respectively.data_to_predict (
DataFrame) â DataFrame containing the coordinates where the fitted trend should be evaluated.cols_to_predict (
list[str]) â Two column names specifying the predictor variable and the output column that will receive the predicted values.degree (
int) â Requested polynomial degree.intersection_weight_col (
str|None) â Column containing sample weights for weighted least-squares fitting.
- Returns:
Copy of
data_to_predictcontaining the predicted trend.- Return type: