class H2OAutoMLParams(H2OCommonSupervisedParams, HasMonotoneConstraints): ## # Param definitions ## ignoredCols = Param( Params._dummy(), "ignoredCols", "Ignored column names", H2OTypeConverters.toListString()) includeAlgos = Param( Params._dummy(), "includeAlgos", "Algorithms to include when using automl", H2OTypeConverters.toEnumListString("ai.h2o.automl.Algo")) excludeAlgos = Param( Params._dummy(), "excludeAlgos", "Algorithms to exclude when using automl", H2OTypeConverters.toEnumListString("ai.h2o.automl.Algo")) projectName = Param( Params._dummy(), "projectName", "identifier for models that should be grouped together in the leaderboard " "(e.g., airlines and iris)", H2OTypeConverters.toNullableString()) maxRuntimeSecs = Param( Params._dummy(), "maxRuntimeSecs", "Maximum time in seconds for automl to be running", H2OTypeConverters.toFloat()) stoppingRounds = Param( Params._dummy(), "stoppingRounds", "Stopping rounds", H2OTypeConverters.toInt()) stoppingTolerance = Param( Params._dummy(), "stoppingTolerance", "Stopping tolerance", H2OTypeConverters.toFloat()) stoppingMetric = Param( Params._dummy(), "stoppingMetric", "Stopping metric", H2OTypeConverters.toEnumString("hex.ScoreKeeper$StoppingMetric")) sortMetric = Param( Params._dummy(), "sortMetric", "Sort metric for the AutoML leaderboard", H2OTypeConverters.toEnumString("ai.h2o.sparkling.ml.algos.H2OAutoMLSortMetric")) balanceClasses = Param( Params._dummy(), "balanceClasses", "Balance classes", H2OTypeConverters.toBoolean()) classSamplingFactors = Param( Params._dummy(), "classSamplingFactors", "Class sampling factors", H2OTypeConverters.toNullableListFloat()) maxAfterBalanceSize = Param( Params._dummy(), "maxAfterBalanceSize", "Max after balance size", H2OTypeConverters.toFloat()) keepCrossValidationPredictions = Param( Params._dummy(), "keepCrossValidationPredictions", "Keep cross validation predictions", H2OTypeConverters.toBoolean()) keepCrossValidationModels = Param( Params._dummy(), "keepCrossValidationModels", "Keep cross validation models", H2OTypeConverters.toBoolean()) maxModels = Param( Params._dummy(), "maxModels", "Max models to train in AutoML", H2OTypeConverters.toInt()) ## # Getters ## def getIgnoredCols(self): return self.getOrDefault(self.ignoredCols) def getTryMutations(self): return self.getOrDefault(self.tryMutations) def getExcludeAlgos(self): return self.getOrDefault(self.excludeAlgos) def getIncludeAlgos(self): return self.getOrDefault(self.includeAlgos) def getProjectName(self): return self.getOrDefault(self.projectName) def getMaxRuntimeSecs(self): return self.getOrDefault(self.maxRuntimeSecs) def getStoppingRounds(self): return self.getOrDefault(self.stoppingRounds) def getStoppingTolerance(self): return self.getOrDefault(self.stoppingTolerance) def getStoppingMetric(self): return self.getOrDefault(self.stoppingMetric) def getSortMetric(self): return self.getOrDefault(self.sortMetric) def getBalanceClasses(self): return self.getOrDefault(self.balanceClasses) def getClassSamplingFactors(self): return self.getOrDefault(self.classSamplingFactors) def getMaxAfterBalanceSize(self): return self.getOrDefault(self.maxAfterBalanceSize) def getKeepCrossValidationPredictions(self): return self.getOrDefault(self.keepCrossValidationPredictions) def getKeepCrossValidationModels(self): return self.getOrDefault(self.keepCrossValidationModels) def getMaxModels(self): return self.getOrDefault(self.maxModels) ## # Setters ## def setIgnoredCols(self, value): return self._set(ignoredCols=value) def setTryMutations(self, value): return self._set(tryMutations=value) def setIncludeAlgos(self, value): return self._set(includeAlgos=value) def setExcludeAlgos(self, value): return self._set(excludeAlgos=value) def setProjectName(self, value): return self._set(projectName=value) def setMaxRuntimeSecs(self, value): return self._set(maxRuntimeSecs=value) def setStoppingRounds(self, value): return self._set(stoppingRounds=value) def setStoppingTolerance(self, value): return self._set(stoppingTolerance=value) def setStoppingMetric(self, value): return self._set(stoppingMetric=value) def setSortMetric(self, value): return self._set(sortMetric=value) def setBalanceClasses(self, value): return self._set(balanceClasses=value) def setClassSamplingFactors(self, value): return self._set(classSamplingFactors=value) def setMaxAfterBalanceSize(self, value): return self._set(maxAfterBalanceSize=value) def setKeepCrossValidationPredictions(self, value): return self._set(keepCrossValidationPredictions=value) def setKeepCrossValidationModels(self, value): return self._set(keepCrossValidationModels=value) def setMaxModels(self, value): return self._set(maxModels=value)
class H2OAutoMLParams(H2OCommonSupervisedParams, HasMonotoneConstraints): ## # Param definitions ## ignoredCols = Param( Params._dummy(), "ignoredCols", "Ignored column names", H2OTypeConverters.toNullableListString()) includeAlgos = Param( Params._dummy(), "includeAlgos", "Algorithms to include when using automl", H2OTypeConverters.toEnumListString("ai.h2o.automl.Algo", True)) excludeAlgos = Param( Params._dummy(), "excludeAlgos", "Algorithms to exclude when using automl", H2OTypeConverters.toEnumListString("ai.h2o.automl.Algo", True)) projectName = Param( Params._dummy(), "projectName", "identifier for models that should be grouped together in the leaderboard " "(e.g., airlines and iris)", H2OTypeConverters.toNullableString()) maxRuntimeSecs = Param( Params._dummy(), "maxRuntimeSecs", "Maximum time in seconds for automl to be running", H2OTypeConverters.toFloat()) stoppingRounds = Param( Params._dummy(), "stoppingRounds", "Stopping rounds", H2OTypeConverters.toInt()) stoppingTolerance = Param( Params._dummy(), "stoppingTolerance", "Stopping tolerance", H2OTypeConverters.toFloat()) stoppingMetric = Param( Params._dummy(), "stoppingMetric", "Stopping metric", H2OTypeConverters.toEnumString("hex.ScoreKeeper$StoppingMetric")) sortMetric = Param( Params._dummy(), "sortMetric", "Sort metric for the AutoML leaderboard", H2OTypeConverters.toEnumString("ai.h2o.sparkling.ml.utils.H2OAutoMLSortMetric")) balanceClasses = Param( Params._dummy(), "balanceClasses", "Balance classes", H2OTypeConverters.toBoolean()) classSamplingFactors = Param( Params._dummy(), "classSamplingFactors", "Class sampling factors", H2OTypeConverters.toNullableListFloat()) maxAfterBalanceSize = Param( Params._dummy(), "maxAfterBalanceSize", "Max after balance size", H2OTypeConverters.toFloat()) keepCrossValidationPredictions = Param( Params._dummy(), "keepCrossValidationPredictions", "Keep cross validation predictions", H2OTypeConverters.toBoolean()) keepCrossValidationModels = Param( Params._dummy(), "keepCrossValidationModels", "Keep cross validation models", H2OTypeConverters.toBoolean()) keepCrossValidationFoldAssignment = Param( Params._dummy(), "keepCrossValidationFoldAssignment", "Whether to keep cross-validation assignments.", H2OTypeConverters.toBoolean()) maxModels = Param( Params._dummy(), "maxModels", "Max models to train in AutoML", H2OTypeConverters.toInt()) maxRuntimeSecsPerModel = Param( Params._dummy(), "maxRuntimeSecsPerModel", "Maximum time to spend on each individual model (optional).", H2OTypeConverters.toFloat()) exportCheckpointsDir = Param( Params._dummy(), "exportCheckpointsDir", "Path to a directory where every generated model will be stored.", H2OTypeConverters.toNullableString()) exploitationRatio = Param( Params._dummy(), "exploitationRatio", "The budget ratio (between 0 and 1) dedicated to the exploitation (vs exploration) phase.", H2OTypeConverters.toFloat()) ## # Getters ## def getIgnoredCols(self): return self.getOrDefault(self.ignoredCols) def getTryMutations(self): return self.getOrDefault(self.tryMutations) def getExcludeAlgos(self): return self.getOrDefault(self.excludeAlgos) def getIncludeAlgos(self): return self.getOrDefault(self.includeAlgos) def getProjectName(self): return self.getOrDefault(self.projectName) def getMaxRuntimeSecs(self): return self.getOrDefault(self.maxRuntimeSecs) def getStoppingRounds(self): return self.getOrDefault(self.stoppingRounds) def getStoppingTolerance(self): return self.getOrDefault(self.stoppingTolerance) def getStoppingMetric(self): return self.getOrDefault(self.stoppingMetric) def getSortMetric(self): return self.getOrDefault(self.sortMetric) def getBalanceClasses(self): return self.getOrDefault(self.balanceClasses) def getClassSamplingFactors(self): return self.getOrDefault(self.classSamplingFactors) def getMaxAfterBalanceSize(self): return self.getOrDefault(self.maxAfterBalanceSize) def getKeepCrossValidationPredictions(self): return self.getOrDefault(self.keepCrossValidationPredictions) def getKeepCrossValidationModels(self): return self.getOrDefault(self.keepCrossValidationModels) def getKeepCrossValidationFoldAssignment(self): return self.getOrDefault(self.keepCrossValidationFoldAssignment) def getMaxModels(self): return self.getOrDefault(self.maxModels) def getMaxRuntimeSecsPerModel(self): return self.getOrDefault(self.maxRuntimeSecsPerModel) def getExportCheckpointsDir(self): return self.getOrDefault(self.exportCheckpointsDir) def getExploitationRatio(self): return self.getOrDefault(self.exploitationRatio) ## # Setters ## def setIgnoredCols(self, value): return self._set(ignoredCols=value) def setTryMutations(self, value): return self._set(tryMutations=value) def setIncludeAlgos(self, value): return self._set(includeAlgos=value) def setExcludeAlgos(self, value): return self._set(excludeAlgos=value) def setProjectName(self, value): return self._set(projectName=value) def setMaxRuntimeSecs(self, value): return self._set(maxRuntimeSecs=value) def setStoppingRounds(self, value): return self._set(stoppingRounds=value) def setStoppingTolerance(self, value): return self._set(stoppingTolerance=value) def setStoppingMetric(self, value): return self._set(stoppingMetric=value) def setSortMetric(self, value): return self._set(sortMetric=value) def setBalanceClasses(self, value): return self._set(balanceClasses=value) def setClassSamplingFactors(self, value): return self._set(classSamplingFactors=value) def setMaxAfterBalanceSize(self, value): return self._set(maxAfterBalanceSize=value) def setKeepCrossValidationPredictions(self, value): return self._set(keepCrossValidationPredictions=value) def setKeepCrossValidationModels(self, value): return self._set(keepCrossValidationModels=value) def setKeepCrossValidationFoldAssignment(self, value): return self._set(keepCrossValidationFoldAssignment=value) def setMaxModels(self, value): return self._set(maxModels=value) def setMaxRuntimeSecsPerModel(self, value): return self._set(maxRuntimeSecsPerModel=value) def setExportCheckpointsDir(self, value): return self._set(exportCheckpointsDir=value) def setExploitationRatio(self, value): return self._set(exploitationRatio=value)