Skip to content

cross_val_predict

Module: strata.model_selection • Kind: function
Source: strata/model_selection/validation.mojo

def cross_val_predict[
ModelType: Regressor,
feat_dtype: DType = DType.float64,
target_dtype: DType = DType.float64,
](
estimator: ModelType,
X: Matrix[feat_dtype],
y: List[Scalar[target_dtype]],
cv: Int = 5,
) -> List[Scalar[feat_dtype]]
def cross_val_predict[
ModelType: Regressor,
feat_dtype: DType = DType.float64,
target_dtype: DType = DType.float64,
](
estimator: ModelType,
X: Matrix[feat_dtype],
y: List[Scalar[target_dtype]],
splits: List[Split],
) -> List[Scalar[feat_dtype]]
def cross_val_predict[
ModelType: Classifier,
feat_dtype: DType = DType.float64,
target_dtype: DType = DType.int32,
](
estimator: ModelType,
X: Matrix[feat_dtype],
y: List[Scalar[target_dtype]],
cv: Int = 5,
) -> List[Int]
def cross_val_predict[
ModelType: Classifier,
feat_dtype: DType = DType.float64,
target_dtype: DType = DType.int32,
](
estimator: ModelType,
X: Matrix[feat_dtype],
y: List[Scalar[target_dtype]],
splits: List[Split],
) -> List[Int]

Overload Note: This function provides multiple overloaded signatures.

from strata.model_selection import cross_val_predict

Generates out-of-fold regression predictions across K folds.