Class ModelImpl
- java.lang.Object
-
- org.apache.flink.table.api.internal.ModelImpl
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiExpressionasArgument(String name)Converts this model object into a named argument.static ModelImplcreateModel(TableEnvironmentInternal tableEnvironment, ContextResolvedModel model)ContextResolvedModelgetModel()org.apache.flink.table.catalog.ResolvedSchemagetResolvedInputSchema()Returns the resolved input schema of this model.org.apache.flink.table.catalog.ResolvedSchemagetResolvedOutputSchema()Returns the resolved output schema of this model.TableEnvironmentgetTableEnv()TableEnvironmentgetTableEnvironment()Tablepredict(Table table, org.apache.flink.types.ColumnList inputColumns)Performs prediction on the given table using specified input columns.Tablepredict(Table table, org.apache.flink.types.ColumnList inputColumns, Map<String,String> options)Performs prediction on the given table using specified input columns with runtime options.
-
-
-
Method Detail
-
createModel
public static ModelImpl createModel(TableEnvironmentInternal tableEnvironment, ContextResolvedModel model)
-
getModel
public ContextResolvedModel getModel()
-
getResolvedInputSchema
public org.apache.flink.table.catalog.ResolvedSchema getResolvedInputSchema()
Description copied from interface:ModelReturns the resolved input schema of this model.The input schema describes the structure and data types of the input columns that the model expects for inference operations.
- Specified by:
getResolvedInputSchemain interfaceModel- Returns:
- the resolved input schema.
-
getResolvedOutputSchema
public org.apache.flink.table.catalog.ResolvedSchema getResolvedOutputSchema()
Description copied from interface:ModelReturns the resolved output schema of this model.The output schema describes the structure and data types of the output columns that the model produces during inference operations.
- Specified by:
getResolvedOutputSchemain interfaceModel- Returns:
- the resolved output schema.
-
getTableEnv
public TableEnvironment getTableEnv()
-
predict
public Table predict(Table table, org.apache.flink.types.ColumnList inputColumns)
Description copied from interface:ModelPerforms prediction on the given table using specified input columns.This method applies the model to the input data to generate predictions. The input columns must match the model's expected input schema.
Example:
Table predictions = model.predict(inputTable, ColumnList.of("feature1", "feature2"));
-
predict
public Table predict(Table table, org.apache.flink.types.ColumnList inputColumns, Map<String,String> options)
Description copied from interface:ModelPerforms prediction on the given table using specified input columns with runtime options.This method applies the model to the input data to generate predictions with additional runtime configuration options such as max-concurrent-operations, timeout, and execution mode settings.
For Common runtime options, see
MLPredictRuntimeConfigOptions.Example:
Map<String, String> options = Map.of("max-concurrent-operations", "100", "timeout", "30s", "async", "true"); Table predictions = model.predict(inputTable, ColumnList.of("feature1", "feature2"), options);- Specified by:
predictin interfaceModel- Parameters:
table- the input table containing data for predictioninputColumns- the columns from the input table to use as model inputoptions- runtime options for configuring the prediction operation- Returns:
- a table containing the input data along with prediction results
-
asArgument
public ApiExpression asArgument(String name)
Description copied from interface:ModelConverts this model object into a named argument.This method is intended for use in function calls that accept model arguments, particularly in process table functions (PTFs) or other operations that work with models.
Example:
env.fromCall( "ML_PREDICT", inputTable.asArgument("INPUT"), model.asArgument("MODEL"), Expressions.descriptor(ColumnList.of("feature1", "feature2")).asArgument("ARGS") )- Specified by:
asArgumentin interfaceModel- Parameters:
name- the name to assign to this model argument- Returns:
- an expression that can be passed to functions expecting model arguments
-
getTableEnvironment
public TableEnvironment getTableEnvironment()
-
-