StudySpec.fromJson constructor
StudySpec.fromJson(
- Object? j
Implementation
factory StudySpec.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return StudySpec(
decayCurveStoppingSpec: switch (json['decayCurveStoppingSpec']) {
null => null,
Object $1 => StudySpec_DecayCurveAutomatedStoppingSpec.fromJson($1),
},
medianAutomatedStoppingSpec:
switch (json['medianAutomatedStoppingSpec']) {
null => null,
Object $1 => StudySpec_MedianAutomatedStoppingSpec.fromJson($1),
},
convexStopConfig: switch (json['convexStopConfig']) {
null => null,
Object $1 => StudySpec_ConvexStopConfig.fromJson($1),
},
convexAutomatedStoppingSpec:
switch (json['convexAutomatedStoppingSpec']) {
null => null,
Object $1 => StudySpec_ConvexAutomatedStoppingSpec.fromJson($1),
},
metrics: switch (json['metrics']) {
null => [],
List<Object?> $1 => [
for (final i in $1) StudySpec_MetricSpec.fromJson(i),
],
_ => throw const FormatException('"metrics" is not a list'),
},
parameters: switch (json['parameters']) {
null => [],
List<Object?> $1 => [
for (final i in $1) StudySpec_ParameterSpec.fromJson(i),
],
_ => throw const FormatException('"parameters" is not a list'),
},
algorithm: switch (json['algorithm']) {
null => StudySpec_Algorithm.$default,
Object $1 => StudySpec_Algorithm.fromJson($1),
},
observationNoise: switch (json['observationNoise']) {
null => StudySpec_ObservationNoise.$default,
Object $1 => StudySpec_ObservationNoise.fromJson($1),
},
measurementSelectionType: switch (json['measurementSelectionType']) {
null => StudySpec_MeasurementSelectionType.$default,
Object $1 => StudySpec_MeasurementSelectionType.fromJson($1),
},
transferLearningConfig: switch (json['transferLearningConfig']) {
null => null,
Object $1 => StudySpec_TransferLearningConfig.fromJson($1),
},
studyStoppingConfig: switch (json['studyStoppingConfig']) {
null => null,
Object $1 => StudySpec_StudyStoppingConfig.fromJson($1),
},
);
}