Merged PR 5201: Updated Featurizers SimpleSchema

Updated SimpleSchema to allow for better mapping of input->output types.
Added support for multiple template types.

Note: Tuple types aren't supported yet, so the code is generated for RobustScalar but we will need to add that code in manually in the custom section.
This commit is contained in:
Michael Sharp 2019-10-04 15:28:51 +00:00
Родитель da44bfb1f9
Коммит 2dd988cfce
9 изменённых файлов: 4730 добавлений и 173 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,251 @@
/* ---------------------------------------------------------------------- */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* Licensed under the MIT License */
/* ---------------------------------------------------------------------- */
#pragma once
#include "SharedLibrary_Common.h"
extern "C" {
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <int8_t> */
struct RobustScalarFeaturizer_int8_t_EstimatorHandle {};
struct RobustScalarFeaturizer_int8_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_int8_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_Fit(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pHandle, /*in*/ int8_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_FitBuffer(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pHandle, /*in*/ int8_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_int8_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_int8_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_int8_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_int8_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_int8_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int8_t_Transform(/*in*/ RobustScalarFeaturizer_int8_t_TransformerHandle *pHandle, /*in*/ int8_t input, /*out*/ float * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <int16_t> */
struct RobustScalarFeaturizer_int16_t_EstimatorHandle {};
struct RobustScalarFeaturizer_int16_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_int16_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_Fit(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pHandle, /*in*/ int16_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_FitBuffer(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pHandle, /*in*/ int16_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_int16_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_int16_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_int16_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_int16_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_int16_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int16_t_Transform(/*in*/ RobustScalarFeaturizer_int16_t_TransformerHandle *pHandle, /*in*/ int16_t input, /*out*/ float * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <uint8_t> */
struct RobustScalarFeaturizer_uint8_t_EstimatorHandle {};
struct RobustScalarFeaturizer_uint8_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_Fit(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pHandle, /*in*/ uint8_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_FitBuffer(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pHandle, /*in*/ uint8_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_uint8_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_uint8_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_uint8_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_uint8_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_uint8_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint8_t_Transform(/*in*/ RobustScalarFeaturizer_uint8_t_TransformerHandle *pHandle, /*in*/ uint8_t input, /*out*/ float * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <uint16_t> */
struct RobustScalarFeaturizer_uint16_t_EstimatorHandle {};
struct RobustScalarFeaturizer_uint16_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_Fit(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pHandle, /*in*/ uint16_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_FitBuffer(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pHandle, /*in*/ uint16_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_uint16_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_uint16_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_uint16_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_uint16_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_uint16_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint16_t_Transform(/*in*/ RobustScalarFeaturizer_uint16_t_TransformerHandle *pHandle, /*in*/ uint16_t input, /*out*/ float * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <float_t> */
struct RobustScalarFeaturizer_float_t_EstimatorHandle {};
struct RobustScalarFeaturizer_float_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_float_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_Fit(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pHandle, /*in*/ float input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_FitBuffer(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pHandle, /*in*/ float const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_float_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_float_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_float_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_float_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_float_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_float_t_Transform(/*in*/ RobustScalarFeaturizer_float_t_TransformerHandle *pHandle, /*in*/ float input, /*out*/ float * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <int32_t> */
struct RobustScalarFeaturizer_int32_t_EstimatorHandle {};
struct RobustScalarFeaturizer_int32_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_int32_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_Fit(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pHandle, /*in*/ int32_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_FitBuffer(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pHandle, /*in*/ int32_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_int32_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_int32_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_int32_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_int32_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_int32_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int32_t_Transform(/*in*/ RobustScalarFeaturizer_int32_t_TransformerHandle *pHandle, /*in*/ int32_t input, /*out*/ double * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <int64_t> */
struct RobustScalarFeaturizer_int64_t_EstimatorHandle {};
struct RobustScalarFeaturizer_int64_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_int64_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_Fit(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pHandle, /*in*/ int64_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_FitBuffer(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pHandle, /*in*/ int64_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_int64_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_int64_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_int64_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_int64_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_int64_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_int64_t_Transform(/*in*/ RobustScalarFeaturizer_int64_t_TransformerHandle *pHandle, /*in*/ int64_t input, /*out*/ double * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <uint32_t> */
struct RobustScalarFeaturizer_uint32_t_EstimatorHandle {};
struct RobustScalarFeaturizer_uint32_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_Fit(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pHandle, /*in*/ uint32_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_FitBuffer(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pHandle, /*in*/ uint32_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_uint32_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_uint32_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_uint32_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_uint32_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_uint32_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint32_t_Transform(/*in*/ RobustScalarFeaturizer_uint32_t_TransformerHandle *pHandle, /*in*/ uint32_t input, /*out*/ double * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <uint64_t> */
struct RobustScalarFeaturizer_uint64_t_EstimatorHandle {};
struct RobustScalarFeaturizer_uint64_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_Fit(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pHandle, /*in*/ uint64_t input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_FitBuffer(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pHandle, /*in*/ uint64_t const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_uint64_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_uint64_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_uint64_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_uint64_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_uint64_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_uint64_t_Transform(/*in*/ RobustScalarFeaturizer_uint64_t_TransformerHandle *pHandle, /*in*/ uint64_t input, /*out*/ double * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* ---------------------------------------------------------------------- */
/* | RobustScalarFeaturizer <double_t> */
struct RobustScalarFeaturizer_double_t_EstimatorHandle {};
struct RobustScalarFeaturizer_double_t_TransformerHandle {};
/* Training Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_CreateEstimator(/*out*/ RobustScalarFeaturizer_double_t_EstimatorHandle **ppHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_DestroyEstimator(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_IsTrainingComplete(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pHandle, /*out*/ bool *pIsTrainingComplete, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_Fit(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pHandle, /*in*/ double input, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_FitBuffer(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pHandle, /*in*/ double const * input_ptr, /*in*/ std::size_t input_items, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_CompleteTraining(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pHandle, /*out*/ FitResult *pFitResult, /*out*/ ErrorInfoHandle **ppErrorInfo);
/* Inference Methods */
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_CreateTransformerFromEstimator(/*in*/ RobustScalarFeaturizer_double_t_EstimatorHandle *pEstimatorHandle, /*out*/ RobustScalarFeaturizer_double_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_CreateTransformerFromSavedData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ RobustScalarFeaturizer_double_t_TransformerHandle **ppTransformerHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_DestroyTransformer(/*in*/ RobustScalarFeaturizer_double_t_TransformerHandle *pHandle, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_CreateTransformerSaveData(/*in*/ RobustScalarFeaturizer_double_t_TransformerHandle *pHandle, /*out*/ unsigned char const **ppBuffer, /*out*/ std::size_t *pBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_DestroyTransformerSaveData(/*in*/ unsigned char const *pBuffer, /*in*/ std::size_t cBufferSize, /*out*/ ErrorInfoHandle **ppErrorInfo);
FEATURIZER_LIBRARY_API bool RobustScalarFeaturizer_double_t_Transform(/*in*/ RobustScalarFeaturizer_double_t_TransformerHandle *pHandle, /*in*/ double input, /*out*/ double * output, /*out*/ ErrorInfoHandle **ppErrorInfo);
} // extern "C"

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -14,12 +14,13 @@
<name string>
<is_optional bool default="false" ?>
<template ?>:
<templates *>:
[name string]
<types string +>
<input_type string>
<is_input_optional bool default=false ?>
<transformed_type string>
<is_output_optional bool default=false ?>
<transformed_type_mappings +>:
<input_type string>
<is_input_optional bool default=false ?>
<transformed_type string>
<is_output_optional bool default=false ?>

Просмотреть файл

@ -3,33 +3,43 @@
"name": "CatImputerFeaturizer",
"estimator_name": "CatImputerEstimator",
"num_output_columns": 1,
"template": {
"name": "T",
"types": [
"std::int8_t",
"std::int16_t",
"std::int32_t",
"std::int64_t",
"std::uint8_t",
"std::uint16_t",
"std::uint32_t",
"std::uint64_t",
"std::float_t",
"std::double_t",
"bool",
"std::string"
]
},
"input_type": "T",
"is_input_optional": true,
"transformed_type": "T"
"templates": [
{
"name": "T",
"types": [
"std::int8_t",
"std::int16_t",
"std::int32_t",
"std::int64_t",
"std::uint8_t",
"std::uint16_t",
"std::uint32_t",
"std::uint64_t",
"std::float_t",
"std::double_t",
"bool",
"std::string"
]
}
],
"transformed_type_mappings": [
{
"input_type": "T",
"is_input_optional": true,
"transformed_type": "T"
}
]
},
{
"name": "DateTimeFeaturizer",
"estimator_name": "DateTimeEstimator",
"num_output_columns": 21,
"input_type": "std::int64_t",
"transformed_type": "TimePoint",
"transformed_type_mappings": [
{
"input_type": "std::int64_t",
"transformed_type": "TimePoint"
}
],
"configuration_params": [
{
"type": "std::string",
@ -138,24 +148,67 @@
"name": "StringFeaturizer",
"estimator_name": "StringEstimator",
"num_output_columns": 1,
"template": {
"name": "T",
"types": [
"std::int8_t",
"std::int16_t",
"std::int32_t",
"std::int64_t",
"std::uint8_t",
"std::uint16_t",
"std::uint32_t",
"std::uint64_t",
"std::float_t",
"std::double_t",
"bool",
"std::string"
]
},
"input_type": "T",
"transformed_type": "std::string"
"templates": [
{
"name": "T",
"types": [
"std::int8_t",
"std::int16_t",
"std::int32_t",
"std::int64_t",
"std::uint8_t",
"std::uint16_t",
"std::uint32_t",
"std::uint64_t",
"std::float_t",
"std::double_t",
"bool",
"std::string"
]
}
],
"transformed_type_mappings": [
{
"input_type": "T",
"transformed_type": "std::string"
}
]
},
{
"name": "RobustScalarFeaturizer",
"estimator_name": "RobustScalarFeaturizer",
"num_output_columns": 1,
"templates": [
{
"name": "TInputFloat",
"types": [
"std::int8_t",
"std::int16_t",
"std::uint8_t",
"std::uint16_t",
"std::float_t"
]
},
{
"name": "TInputDouble",
"types": [
"std::int32_t",
"std::int64_t",
"std::uint32_t",
"std::uint64_t",
"std::double_t"
]
}
],
"transformed_type_mappings": [
{
"input_type": "TInputFloat",
"transformed_type": "std::float_t"
},
{
"input_type": "TInputDouble",
"transformed_type": "std::double_t"
}
]
}
]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -5,7 +5,7 @@
# | future invocations of the generator!
# |
# | Generated by: <SimpleSchemaGenerator>/Plugins/Impl/PythonSerializationImpl.py
# | Generated on: 2019-08-27 09:07:48.630260
# | Generated on: 2019-10-03 14:10:56.707988
# |
# --------------------------------------------------------------------------------
import copy
@ -148,13 +148,14 @@ def Deserialize_featurizers(
# | Type Infos
# |
# ----------------------------------------------------------------------
featurizers_TypeInfo = ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "estimator_name", StringTypeInfo(min_length=1) ), ( "num_output_columns", FloatTypeInfo(min=1.0) ), ( "custom_structs", ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "members", ClassTypeInfo(OrderedDict([ ( "type", StringTypeInfo(min_length=1) ), ( "name", StringTypeInfo(min_length=1) ) ]), require_exact_match=True, arity=Arity.FromString('+')) ) ]), require_exact_match=True, arity=Arity.FromString('*')) ), ( "configuration_params", ClassTypeInfo(OrderedDict([ ( "type", StringTypeInfo(min_length=1) ), ( "name", StringTypeInfo(min_length=1) ), ( "is_optional", BoolTypeInfo(arity=Arity.FromString('?')) ) ]), require_exact_match=True, arity=Arity.FromString('*')) ), ( "template", ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "types", StringTypeInfo(min_length=1, arity=Arity.FromString('+')) ) ]), require_exact_match=True, arity=Arity.FromString('?')) ), ( "input_type", StringTypeInfo(min_length=1) ), ( "is_input_optional", BoolTypeInfo(arity=Arity.FromString('?')) ), ( "transformed_type", StringTypeInfo(min_length=1) ), ( "is_output_optional", BoolTypeInfo(arity=Arity.FromString('?')) ) ]), require_exact_match=True, arity=Arity.FromString('+'))
featurizers_TypeInfo = ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "estimator_name", StringTypeInfo(min_length=1) ), ( "num_output_columns", FloatTypeInfo(min=1.0) ), ( "custom_structs", ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "members", ClassTypeInfo(OrderedDict([ ( "type", StringTypeInfo(min_length=1) ), ( "name", StringTypeInfo(min_length=1) ) ]), require_exact_match=True, arity=Arity.FromString('+')) ) ]), require_exact_match=True, arity=Arity.FromString('*')) ), ( "configuration_params", ClassTypeInfo(OrderedDict([ ( "type", StringTypeInfo(min_length=1) ), ( "name", StringTypeInfo(min_length=1) ), ( "is_optional", BoolTypeInfo(arity=Arity.FromString('?')) ) ]), require_exact_match=True, arity=Arity.FromString('*')) ), ( "templates", ClassTypeInfo(OrderedDict([ ( "name", StringTypeInfo(min_length=1) ), ( "types", StringTypeInfo(min_length=1, arity=Arity.FromString('+')) ) ]), require_exact_match=True, arity=Arity.FromString('*')) ), ( "transformed_type_mappings", ClassTypeInfo(OrderedDict([ ( "input_type", StringTypeInfo(min_length=1) ), ( "is_input_optional", BoolTypeInfo(arity=Arity.FromString('?')) ), ( "transformed_type", StringTypeInfo(min_length=1) ), ( "is_output_optional", BoolTypeInfo(arity=Arity.FromString('?')) ) ]), require_exact_match=True, arity=Arity.FromString('+')) ) ]), require_exact_match=True, arity=Arity.FromString('+'))
_featurizers_TypeInfo_Contents = OrderedDict([("name", GenericTypeInfo()), ("estimator_name", GenericTypeInfo()), ("num_output_columns", GenericTypeInfo()), ("custom_structs", GenericTypeInfo(arity=Arity.FromString('*'))), ("configuration_params", GenericTypeInfo(arity=Arity.FromString('*'))), ("template", GenericTypeInfo(arity=Arity.FromString('?'))), ("input_type", GenericTypeInfo()), ("is_input_optional", GenericTypeInfo(arity=Arity.FromString('?'))), ("transformed_type", GenericTypeInfo()), ("is_output_optional", GenericTypeInfo(arity=Arity.FromString('?')))])
_featurizers_TypeInfo_Contents = OrderedDict([("name", GenericTypeInfo()), ("estimator_name", GenericTypeInfo()), ("num_output_columns", GenericTypeInfo()), ("custom_structs", GenericTypeInfo(arity=Arity.FromString('*'))), ("configuration_params", GenericTypeInfo(arity=Arity.FromString('*'))), ("templates", GenericTypeInfo(arity=Arity.FromString('*'))), ("transformed_type_mappings", GenericTypeInfo(arity=Arity.FromString('+')))])
_featurizers_custom_structs_TypeInfo_Contents = OrderedDict([("name", GenericTypeInfo()), ("members", GenericTypeInfo(arity=Arity.FromString('+')))])
_featurizers_custom_structs_members_TypeInfo_Contents = OrderedDict([("type", GenericTypeInfo()), ("name", GenericTypeInfo())])
_featurizers_configuration_params_TypeInfo_Contents = OrderedDict([("type", GenericTypeInfo()), ("name", GenericTypeInfo()), ("is_optional", GenericTypeInfo(arity=Arity.FromString('?')))])
_featurizers_template_TypeInfo_Contents = OrderedDict([("name", GenericTypeInfo()), ("types", GenericTypeInfo(arity=Arity.FromString('+')))])
_featurizers_templates_TypeInfo_Contents = OrderedDict([("name", GenericTypeInfo()), ("types", GenericTypeInfo(arity=Arity.FromString('+')))])
_featurizers_transformed_type_mappings_TypeInfo_Contents = OrderedDict([("input_type", GenericTypeInfo()), ("is_input_optional", GenericTypeInfo(arity=Arity.FromString('?'))), ("transformed_type", GenericTypeInfo()), ("is_output_optional", GenericTypeInfo(arity=Arity.FromString('?')))])
_featurizers_TypeInfo = AnyOfTypeInfo([ClassTypeInfo(_featurizers_TypeInfo_Contents, require_exact_match=False), DictTypeInfo(_featurizers_TypeInfo_Contents, require_exact_match=False)], arity=Arity.FromString('+'))
_featurizers_name_TypeInfo = StringTypeInfo(min_length=1)
@ -169,13 +170,14 @@ _featurizers_configuration_params_TypeInfo = An
_featurizers_configuration_params_type_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_configuration_params_name_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_configuration_params_is_optional_TypeInfo = BoolTypeInfo(arity=Arity.FromString('?'))
_featurizers_template_TypeInfo = AnyOfTypeInfo([ClassTypeInfo(_featurizers_template_TypeInfo_Contents, require_exact_match=False), DictTypeInfo(_featurizers_template_TypeInfo_Contents, require_exact_match=False)], arity=Arity.FromString('?'))
_featurizers_template_name_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_template_types_TypeInfo = StringTypeInfo(min_length=1, arity=Arity.FromString('+'))
_featurizers_input_type_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_is_input_optional_TypeInfo = BoolTypeInfo(arity=Arity.FromString('?'))
_featurizers_transformed_type_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_is_output_optional_TypeInfo = BoolTypeInfo(arity=Arity.FromString('?'))
_featurizers_templates_TypeInfo = AnyOfTypeInfo([ClassTypeInfo(_featurizers_templates_TypeInfo_Contents, require_exact_match=False), DictTypeInfo(_featurizers_templates_TypeInfo_Contents, require_exact_match=False)], arity=Arity.FromString('*'))
_featurizers_templates_name_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_templates_types_TypeInfo = StringTypeInfo(min_length=1, arity=Arity.FromString('+'))
_featurizers_transformed_type_mappings_TypeInfo = AnyOfTypeInfo([ClassTypeInfo(_featurizers_transformed_type_mappings_TypeInfo_Contents, require_exact_match=False), DictTypeInfo(_featurizers_transformed_type_mappings_TypeInfo_Contents, require_exact_match=False)], arity=Arity.FromString('+'))
_featurizers_transformed_type_mappings_input_type_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_transformed_type_mappings_is_input_optional_TypeInfo = BoolTypeInfo(arity=Arity.FromString('?'))
_featurizers_transformed_type_mappings_transformed_type_TypeInfo = StringTypeInfo(min_length=1)
_featurizers_transformed_type_mappings_is_output_optional_TypeInfo = BoolTypeInfo(arity=Arity.FromString('?'))
# ----------------------------------------------------------------------
# |
@ -379,98 +381,123 @@ class Deserializer(object):
# ----------------------------------------------------------------------
@classmethod
def featurizers_template(cls, item, always_include_optional, process_additional_data):
if item in [DoesNotExist, None]:
_featurizers_template_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_template_Item(item, always_include_optional, process_additional_data)
_featurizers_template_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_template_name(cls, item):
if item in [DoesNotExist, None]:
_featurizers_template_name_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_template_name_Item(item)
_featurizers_template_name_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_template_types(cls, items):
def featurizers_templates(cls, items, always_include_optional, process_additional_data):
if items in [DoesNotExist, None, []]:
_featurizers_template_types_TypeInfo.ValidateArity(None)
_featurizers_templates_TypeInfo.ValidateArity(None)
return DoesNotExist
results = []
for this_index, this_item in enumerate(items or []):
try:
results.append(cls._featurizers_template_types_Item(this_item))
results.append(cls._featurizers_templates_Item(this_item, always_include_optional, process_additional_data))
except:
_DecorateActiveException("Index {}".format(this_index))
_featurizers_template_types_TypeInfo.ValidateArity(results)
_featurizers_templates_TypeInfo.ValidateArity(results)
return results
# ----------------------------------------------------------------------
@classmethod
def featurizers_input_type(cls, item):
def featurizers_templates_name(cls, item):
if item in [DoesNotExist, None]:
_featurizers_input_type_TypeInfo.ValidateArity(None)
_featurizers_templates_name_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_input_type_Item(item)
result = cls._featurizers_templates_name_Item(item)
_featurizers_input_type_TypeInfo.ValidateArity(result)
_featurizers_templates_name_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_is_input_optional(cls, item):
if item in [DoesNotExist, None]:
_featurizers_is_input_optional_TypeInfo.ValidateArity(None)
def featurizers_templates_types(cls, items):
if items in [DoesNotExist, None, []]:
_featurizers_templates_types_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_is_input_optional_Item(item)
results = []
_featurizers_is_input_optional_TypeInfo.ValidateArity(result)
for this_index, this_item in enumerate(items or []):
try:
results.append(cls._featurizers_templates_types_Item(this_item))
except:
_DecorateActiveException("Index {}".format(this_index))
_featurizers_templates_types_TypeInfo.ValidateArity(results)
return results
# ----------------------------------------------------------------------
@classmethod
def featurizers_transformed_type_mappings(cls, items, always_include_optional, process_additional_data):
if items in [DoesNotExist, None, []]:
_featurizers_transformed_type_mappings_TypeInfo.ValidateArity(None)
return DoesNotExist
results = []
for this_index, this_item in enumerate(items or []):
try:
results.append(cls._featurizers_transformed_type_mappings_Item(this_item, always_include_optional, process_additional_data))
except:
_DecorateActiveException("Index {}".format(this_index))
_featurizers_transformed_type_mappings_TypeInfo.ValidateArity(results)
return results
# ----------------------------------------------------------------------
@classmethod
def featurizers_transformed_type_mappings_input_type(cls, item):
if item in [DoesNotExist, None]:
_featurizers_transformed_type_mappings_input_type_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_transformed_type_mappings_input_type_Item(item)
_featurizers_transformed_type_mappings_input_type_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_transformed_type(cls, item):
def featurizers_transformed_type_mappings_is_input_optional(cls, item):
if item in [DoesNotExist, None]:
_featurizers_transformed_type_TypeInfo.ValidateArity(None)
_featurizers_transformed_type_mappings_is_input_optional_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_transformed_type_Item(item)
result = cls._featurizers_transformed_type_mappings_is_input_optional_Item(item)
_featurizers_transformed_type_TypeInfo.ValidateArity(result)
_featurizers_transformed_type_mappings_is_input_optional_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_is_output_optional(cls, item):
def featurizers_transformed_type_mappings_transformed_type(cls, item):
if item in [DoesNotExist, None]:
_featurizers_is_output_optional_TypeInfo.ValidateArity(None)
_featurizers_transformed_type_mappings_transformed_type_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_is_output_optional_Item(item)
result = cls._featurizers_transformed_type_mappings_transformed_type_Item(item)
_featurizers_is_output_optional_TypeInfo.ValidateArity(result)
_featurizers_transformed_type_mappings_transformed_type_TypeInfo.ValidateArity(result)
return result
# ----------------------------------------------------------------------
@classmethod
def featurizers_transformed_type_mappings_is_output_optional(cls, item):
if item in [DoesNotExist, None]:
_featurizers_transformed_type_mappings_is_output_optional_TypeInfo.ValidateArity(None)
return DoesNotExist
result = cls._featurizers_transformed_type_mappings_is_output_optional_Item(item)
_featurizers_transformed_type_mappings_is_output_optional_TypeInfo.ValidateArity(result)
return result
@ -533,56 +560,34 @@ class Deserializer(object):
except:
_DecorateActiveException("configuration_params")
# template
# templates
try:
cls._ApplyOptionalChild(item, "template", result, lambda value: cls.featurizers_template(value, always_include_optional, process_additional_data), always_include_optional)
cls._ApplyOptionalChildren(item, "templates", result, lambda value: cls.featurizers_templates(value, always_include_optional, process_additional_data), always_include_optional)
except:
_DecorateActiveException("template")
_DecorateActiveException("templates")
# input_type
# transformed_type_mappings
try:
setattr(result, "input_type", cls.featurizers_input_type(
setattr(result, "transformed_type_mappings", cls.featurizers_transformed_type_mappings(
cls._GetPythonAttribute(
item,
"input_type",
"transformed_type_mappings",
is_optional=False,
),
)
)
except:
_DecorateActiveException("input_type")
always_include_optional,
process_additional_data
# is_input_optional
try:
cls._ApplyOptionalChild(item, "is_input_optional", result, cls.featurizers_is_input_optional, always_include_optional, default_value_func=lambda: StringSerialization.DeserializeItem(_featurizers_is_input_optional_TypeInfo, "false"))
except:
_DecorateActiveException("is_input_optional")
# transformed_type
try:
setattr(result, "transformed_type", cls.featurizers_transformed_type(
cls._GetPythonAttribute(
item,
"transformed_type",
is_optional=False,
),
)
)
except:
_DecorateActiveException("transformed_type")
# is_output_optional
try:
cls._ApplyOptionalChild(item, "is_output_optional", result, cls.featurizers_is_output_optional, always_include_optional, default_value_func=lambda: StringSerialization.DeserializeItem(_featurizers_is_output_optional_TypeInfo, "false"))
except:
_DecorateActiveException("is_output_optional")
_DecorateActiveException("transformed_type_mappings")
# Additional data
if process_additional_data:
cls._ApplyAdditionalData(
item,
result,
exclude_names={"name", "estimator_name", "num_output_columns", "custom_structs", "configuration_params", "template", "input_type", "is_input_optional", "transformed_type", "is_output_optional"},
exclude_names={"name", "estimator_name", "num_output_columns", "custom_structs", "configuration_params", "templates", "transformed_type_mappings"},
)
_featurizers_TypeInfo.ValidateItem(
@ -797,12 +802,12 @@ class Deserializer(object):
# ----------------------------------------------------------------------
@classmethod
def _featurizers_template_Item(cls, item, always_include_optional, process_additional_data):
def _featurizers_templates_Item(cls, item, always_include_optional, process_additional_data):
attributes = OrderedDict()
# name
try:
attributes["name"] = cls.featurizers_template_name(
attributes["name"] = cls.featurizers_templates_name(
cls._GetPythonAttribute(
item,
"name",
@ -818,7 +823,7 @@ class Deserializer(object):
# types
try:
setattr(result, "types", cls.featurizers_template_types(
setattr(result, "types", cls.featurizers_templates_types(
cls._GetPythonAttribute(
item,
"types",
@ -837,7 +842,7 @@ class Deserializer(object):
exclude_names={"name", "types"},
)
_featurizers_template_TypeInfo.ValidateItem(
_featurizers_templates_TypeInfo.ValidateItem(
result,
recurse=False,
require_exact_match=not process_additional_data,
@ -847,33 +852,94 @@ class Deserializer(object):
# ----------------------------------------------------------------------
@classmethod
def _featurizers_template_name_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_template_name_TypeInfo, item, **{})
def _featurizers_templates_name_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_templates_name_TypeInfo, item, **{})
# ----------------------------------------------------------------------
@classmethod
def _featurizers_template_types_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_template_types_TypeInfo, item, **{})
def _featurizers_templates_types_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_templates_types_TypeInfo, item, **{})
# ----------------------------------------------------------------------
@classmethod
def _featurizers_input_type_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_input_type_TypeInfo, item, **{})
def _featurizers_transformed_type_mappings_Item(cls, item, always_include_optional, process_additional_data):
result = _CreatePythonObject(
attributes=None,
)
# input_type
try:
setattr(result, "input_type", cls.featurizers_transformed_type_mappings_input_type(
cls._GetPythonAttribute(
item,
"input_type",
is_optional=False,
),
)
)
except:
_DecorateActiveException("input_type")
# is_input_optional
try:
cls._ApplyOptionalChild(item, "is_input_optional", result, cls.featurizers_transformed_type_mappings_is_input_optional, always_include_optional, default_value_func=lambda: StringSerialization.DeserializeItem(_featurizers_transformed_type_mappings_is_input_optional_TypeInfo, "false"))
except:
_DecorateActiveException("is_input_optional")
# transformed_type
try:
setattr(result, "transformed_type", cls.featurizers_transformed_type_mappings_transformed_type(
cls._GetPythonAttribute(
item,
"transformed_type",
is_optional=False,
),
)
)
except:
_DecorateActiveException("transformed_type")
# is_output_optional
try:
cls._ApplyOptionalChild(item, "is_output_optional", result, cls.featurizers_transformed_type_mappings_is_output_optional, always_include_optional, default_value_func=lambda: StringSerialization.DeserializeItem(_featurizers_transformed_type_mappings_is_output_optional_TypeInfo, "false"))
except:
_DecorateActiveException("is_output_optional")
# Additional data
if process_additional_data:
cls._ApplyAdditionalData(
item,
result,
exclude_names={"input_type", "is_input_optional", "transformed_type", "is_output_optional"},
)
_featurizers_transformed_type_mappings_TypeInfo.ValidateItem(
result,
recurse=False,
require_exact_match=not process_additional_data,
)
return result
# ----------------------------------------------------------------------
@classmethod
def _featurizers_is_input_optional_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_is_input_optional_TypeInfo, item, **{})
def _featurizers_transformed_type_mappings_input_type_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_transformed_type_mappings_input_type_TypeInfo, item, **{})
# ----------------------------------------------------------------------
@classmethod
def _featurizers_transformed_type_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_transformed_type_TypeInfo, item, **{})
def _featurizers_transformed_type_mappings_is_input_optional_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_transformed_type_mappings_is_input_optional_TypeInfo, item, **{})
# ----------------------------------------------------------------------
@classmethod
def _featurizers_is_output_optional_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_is_output_optional_TypeInfo, item, **{})
def _featurizers_transformed_type_mappings_transformed_type_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_transformed_type_mappings_transformed_type_TypeInfo, item, **{})
# ----------------------------------------------------------------------
@classmethod
def _featurizers_transformed_type_mappings_is_output_optional_Item(cls, item):
return JsonSerialization.DeserializeItem(_featurizers_transformed_type_mappings_is_output_optional_TypeInfo, item, **{})
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------

Просмотреть файл

@ -48,8 +48,6 @@ _REPO_DATA = [
_ACTIVATION_REPO_CONFIGURATION = "python" # Can be None
raise Exception("Remove this exception when '_REPO_DATA', '_ACTIVATION_REPO_CONFIGURATION' have been updated for your environment")
# ----------------------------------------------------------------------
inflect = inflect_mod.engine()

Просмотреть файл

@ -112,32 +112,51 @@ def EntryPoint(
new_data = []
for item in data:
if not hasattr(item, "template"):
new_data.append([item])
if not hasattr(item, "templates"):
for mapping in item.transformed_type_mappings:
new_item = copy.deepcopy(item)
new_item.input_type = mapping.input_type
new_item.transformed_type = mapping.transformed_type
new_item.is_input_optional = mapping.is_input_optional
new_item.is_output_optional = mapping.is_output_optional
new_data.append([new_item])
continue
regex = re.compile(r"\b{}\b".format(item.template.name))
new_data_items = []
for template in item.templates:
regex = re.compile(r"\b{}\b".format(template.name))
for template_type in item.template.types:
new_item = copy.deepcopy(item)
new_item.template = template_type
for template_type in template.types:
new_item = copy.deepcopy(item)
new_item.template = template_type
for configuration_param in getattr(new_item, "configuration_params", []):
configuration_param.type = regex.sub(template_type, configuration_param.type)
# Remove the template mapping and list of templates
del new_item.templates
del new_item.transformed_type_mappings
new_item.input_type = regex.sub(template_type, new_item.input_type)
new_item.transformed_type = regex.sub(template_type, new_item.transformed_type)
for configuration_param in getattr(new_item, "configuration_params", []):
configuration_param.type = regex.sub(template_type, configuration_param.type)
for custom_struct in getattr(new_item, "custom_structs", []):
for member in custom_struct.members:
member.type = regex.sub(template_type, member.type)
for custom_struct in getattr(new_item, "custom_structs", []):
for member in custom_struct.members:
member.type = regex.sub(template_type, member.type)
new_data_items.append(new_item)
for mapping in item.transformed_type_mappings:
# Since we can have multiple templates this is for when a mapping doesn't use a template or not the current template
if mapping.input_type != template.name and mapping.transformed_type != template.name:
continue
new_item.input_type = regex.sub(template_type, mapping.input_type)
new_item.transformed_type = regex.sub(template_type, mapping.transformed_type)
new_item.is_input_optional = mapping.is_input_optional
new_item.is_output_optional = mapping.is_output_optional
# This will end up copying one more time than needed, but I couldn't think of a better way for now.
new_data_items.append(copy.deepcopy(new_item))
new_data.append(new_data_items)
data = new_data
dm.stream.write("Generating content...")