/** * The {@link ML} module facilitates creation of Automated Machine Learning models to embed into {@link Template}s. * * @module ML * * @example * ```typescript * // use a DictType stream * const training_stream = Stream( * "My Training Stream", * DictType( * StringType, * StructType({ * qty: FloatType, * price: FloatType, * }) * ) * ); * * const prediction_stream = Stream( * "My Prediction Stream", * DictType( * StringType, * StructType({ * price: FloatType, * }) * ) * ); * * // create a GP to predict demand based on price * const demand = new MLModelBuilder("Demand") * .feature("price", FloatType) * .output(FloatType) * .trainFromStream({ * output_name: "qty", * input: training_stream, * }); * * // directly predict the model outputs from features * const ml_prediction = new MLPredictionBuilder("ML Prediction") * .model(demand) * .predict(prediction_stream); * * // or alternatively use the model to predict in a process * // create the sales process and add the ml function * // which is evaluated in each sale * const sales = new ProcessBuilder("sales") * // the ml function can be added * .ml(demand) * // the sale needs a price * .value("price", FloatType) * // the ml can be evaluated * .let( * "qty", * (props, _resources, mls) => mls.demand(Struct({ price: props.price })) * ) * .mapFromValue({ date: new Date(0), price: 10 }); * * ``` */ export * from './MLModelBuilder'; export * from './MLPredictionBuilder';