예제 #1
0
        internal static TableVerticalDataSettings DeserializeTableVerticalDataSettings(JsonElement element)
        {
            Optional <TableVerticalValidationDataSettings> validationData = default;
            Optional <string>           weightColumnName = default;
            string                      targetColumnName = default;
            Optional <TestDataSettings> testData         = default;
            TrainingDataSettings        trainingData     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("validationData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        validationData = null;
                        continue;
                    }
                    validationData = TableVerticalValidationDataSettings.DeserializeTableVerticalValidationDataSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("weightColumnName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        weightColumnName = null;
                        continue;
                    }
                    weightColumnName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("targetColumnName"))
                {
                    targetColumnName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("testData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        testData = null;
                        continue;
                    }
                    testData = TestDataSettings.DeserializeTestDataSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("trainingData"))
                {
                    trainingData = TrainingDataSettings.DeserializeTrainingDataSettings(property.Value);
                    continue;
                }
            }
            return(new TableVerticalDataSettings(targetColumnName, testData.Value, trainingData, validationData.Value, weightColumnName.Value));
        }
예제 #2
0
 internal TableVerticalDataSettings(string targetColumnName, TestDataSettings testData, TrainingDataSettings trainingDataSettings, TableVerticalValidationDataSettings validationData, string weightColumnName) : base(targetColumnName, testData, trainingDataSettings)
 {
     ValidationData   = validationData;
     WeightColumnName = weightColumnName;
 }