diff --git a/src/main/kotlin/cs/ut/logging/NirdLogger.kt b/src/main/kotlin/cs/ut/logging/NirdLogger.kt index 2d3dd00..37230b1 100644 --- a/src/main/kotlin/cs/ut/logging/NirdLogger.kt +++ b/src/main/kotlin/cs/ut/logging/NirdLogger.kt @@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest class NirdLogger(private val id: String = "GLOBAL", caller: Class) { - val log = Logger.getLogger(caller)!! + val log = Logger.getLogger(caller::class.java)!! fun debug(msg: Any?) { log.debug("[${this.id}] $msg") diff --git a/src/main/kotlin/cs/ut/ui/controllers/TrainingController.kt b/src/main/kotlin/cs/ut/ui/controllers/TrainingController.kt index 6bce354..6b54676 100644 --- a/src/main/kotlin/cs/ut/ui/controllers/TrainingController.kt +++ b/src/main/kotlin/cs/ut/ui/controllers/TrainingController.kt @@ -58,23 +58,25 @@ class TrainingController : SelectorComposer(), Redirectable { private lateinit var gridContainer: Vlayout @Wire - private lateinit var thresholdContainer: Hbox + private lateinit var genDataSetParam: A @Wire - private lateinit var genDataSetParam: A + private lateinit var radioGroup: Radiogroup @Wire - private lateinit var trainingGrid: Grid + private lateinit var avgRadio: Radio - private lateinit var radioGroup: Radiogroup + @Wire + private lateinit var customRadio: Radio + + @Wire + private lateinit var customBox: Doublebox private lateinit var gridController: ModeController override fun doAfterCompose(comp: Component?) { super.doAfterCompose(comp) - radioGroup = Radiogroup() - initClientLogs() if (initPredictions()) { genDataSetParam.isDisabled = false @@ -85,9 +87,9 @@ class TrainingController : SelectorComposer(), Redirectable { private fun getLogFileName(): String = (clientLogs.selectedItem.getValue() as File).nameWithoutExtension private fun initPredictions(): Boolean { - radioGroup.getChildren().clear() - thresholdContainer.getChildren().clear() - thresholdContainer.isVisible = false + customBox.isDisabled = true + avgRadio.isDisabled = true + customRadio.isDisabled = true predictionType.items.clear() log.debug("Cleared prediction type items") @@ -126,11 +128,15 @@ class TrainingController : SelectorComposer(), Redirectable { val param = (e.selectedItems.first() as Comboitem).getValue() as ModelParameter log.debug("Prediction type model changed to $param") if (param.id == OUTCOME) { - thresholdContainer.isVisible = true + customBox.isDisabled = false + avgRadio.isDisabled = false + customRadio.isDisabled = false log.debug("Prediciton type is $OUTCOME generating radio buttons") } else { log.debug("Clearing thresholdContainer") - thresholdContainer.isVisible = false + customBox.isDisabled = true + avgRadio.isDisabled = true + customRadio.isDisabled = true } }) @@ -140,33 +146,24 @@ class TrainingController : SelectorComposer(), Redirectable { } private fun ModelParameter.setUpRadioButtons() { - val avg = radioGroup.appendItem(NirdizatiUtil.localizeText("threshold.avg"), this.parameter) - avg.setValue(this.parameter.toDouble()) - radioGroup.selectedItem = avg - - val custom = radioGroup.appendItem(NirdizatiUtil.localizeText("threshold.custom"), this.parameter) - custom.setValue(DEFAULT) - val customBox = Doublebox() - customBox.width = "60px" + avgRadio.setValue(this.parameter.toDouble()) + customRadio.setValue(DEFAULT) customBox.setValue(DEFAULT) - customBox.style = "padding-top: 10px" - customBox.vflex = "1" + customBox.addEventListener(Events.ON_CHANGE, { _ -> log.debug("New value for custom threshold ${customBox.value}") val res: Double? = customBox.value if (res == null || res <= 0) { - custom.setValue(DEFAULT) + customRadio.setValue(DEFAULT) customBox.setValue(DEFAULT) customBox.errorMessage = NirdizatiUtil.localizeText("threshold.custom_error", 0) } else { customBox.clearErrorMessage() - custom.setValue(res) + customBox.setValue(res) + customRadio.setValue(res) } }) - - thresholdContainer.appendChild(radioGroup) - thresholdContainer.appendChild(customBox) } private fun initClientLogs() { diff --git a/src/main/kotlin/cs/ut/util/Const.kt b/src/main/kotlin/cs/ut/util/Const.kt index 5b91eda..c6b20fc 100644 --- a/src/main/kotlin/cs/ut/util/Const.kt +++ b/src/main/kotlin/cs/ut/util/Const.kt @@ -36,7 +36,7 @@ const val PAGE_TRAINING = "training" const val PAGE_VALIDATION = "validation" const val LAST_STATE = "last_state" -const val PREFIX = "prefix_lenght_based" +const val PREFIX = "prefix_length_based" const val FREQUENCY = "frequency" const val COMBINED = "combined" const val INDEX = "index_based" diff --git a/src/main/resources/configuration.xml b/src/main/resources/configuration.xml index 09296cb..592cdeb 100644 --- a/src/main/resources/configuration.xml +++ b/src/main/resources/configuration.xml @@ -282,7 +282,7 @@ - prefix_lenght_based + prefix_length_based prefix bucketing true diff --git a/src/main/webapp/WEB-INF/zk-label.properties b/src/main/webapp/WEB-INF/zk-label.properties index 689586e..99d27e8 100644 --- a/src/main/webapp/WEB-INF/zk-label.properties +++ b/src/main/webapp/WEB-INF/zk-label.properties @@ -16,7 +16,7 @@ header.validation=Validation header.admin=Admin view training.selected_log=Currently selected log: training.prediction_type=What do you want to predict? -training.advanced=Multiple models +training.advanced=Multiple models: training.start_training=Train model training.file_not_found=File with such name could not be found training.empty_prediction=Prediction type cannot be empty @@ -35,7 +35,7 @@ encoding.index_based=Index based bucketing.zero=Zero bucketing.state_based=State based bucketing.clustering=Clustering -bucketing.prefix_lenght_based=Prefix lenght based +bucketing.prefix_length_based=Prefix length based learner.random_forest=Random forest learner.gradient_boosting=Gradient boosting learner.decision_tree=Decision tree diff --git a/src/main/webapp/css/main.sass b/src/main/webapp/css/main.sass index c7a5c5f..9cfc966 100644 --- a/src/main/webapp/css/main.sass +++ b/src/main/webapp/css/main.sass @@ -41,6 +41,9 @@ .no-hor-overflow overflow-x: hidden +.no-overflow + overflow: hidden + .padding-bottom-20px padding-bottom: 20px diff --git a/src/main/webapp/views/training.zul b/src/main/webapp/views/training.zul index a21cb65..b952956 100644 --- a/src/main/webapp/views/training.zul +++ b/src/main/webapp/views/training.zul @@ -1,28 +1,30 @@ - - - - - - - - - -