PFI
PFI(score_estimator=None, flow_estimator=None)
Bases: BaseEstimator
Composite estimator that fits score first and flow second.
Parameters:
-
score_estimator(ScoreEstimator, default:None) –Score-stage estimator.
-
flow_estimator(FlowEstimator, default:None) –Flow-stage estimator.
Attributes:
-
score_estimator_(ScoreEstimator) –Fitted score-stage estimator.
-
flow_estimator_(FlowEstimator) –Fitted flow-stage estimator.
error(X, y, dt=0.01, stoch=False)
Compute flow-stage evaluation errors.
Parameters:
-
X(array-like of shape (n_samples_x, ndim + 1)) –Source samples with time in the last column.
-
y(array-like of shape (n_samples_y, ndim + 1)) –Target samples with time in the last column.
-
dt(float, default:0.01) –Integration step used during flow simulation.
-
stoch(bool, default:False) –Whether to use stochastic dynamics.
Returns:
-
ndarray–Per-time energy-distance scores.
fit(X, y=None)
Fit the score estimator, then the flow estimator.
Parameters:
-
X(array-like of shape (n_samples, ndim + 1)) –Training data with time stored in the last column.
-
y(None, default:None) –Ignored. Present for future compatibility with sklearn.
Returns:
-
PFI–Fitted estimator.
predict(X, stoch=False)
Predict flow values using the fitted flow estimator.
Parameters:
-
X(array-like of shape (n_samples, ndim + 1)) –Input states with time in the last column.
-
stoch(bool, default:False) –Whether to request stochastic output.
Returns:
-
ndarray–Predicted flow values.
sample(X, Dt, dt=0.01, stoch=False)
Sample trajectories with the fitted flow estimator.
Parameters:
-
X(array-like of shape (n_samples, ndim + 1)) –Initial states with time in the last column.
-
Dt(float) –Simulation horizon.
-
dt(float, default:0.01) –Integration step.
-
stoch(bool, default:False) –Whether to use stochastic dynamics.
Returns:
-
ndarray–Simulated final states.
score(X, y, dt=0.01, stoch=False)
Return the negated mean error for sklearn compatibility.
Parameters:
-
X(array-like of shape (n_samples_x, ndim + 1)) –Source samples with time in the last column.
-
y(array-like of shape (n_samples_y, ndim + 1)) –Target samples with time in the last column.
-
dt(float, default:0.01) –Integration step used during flow simulation.
-
stoch(bool, default:False) –Whether to use stochastic dynamics.
Returns:
-
float–Negated mean error. Larger values indicate better fit.