Skip to content

Commit

Permalink
improve weight message.
Browse files Browse the repository at this point in the history
  • Loading branch information
cregouby committed Sep 29, 2024
1 parent c8c82d2 commit fe56a04
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 49 deletions.
8 changes: 4 additions & 4 deletions R/hardhat.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#' If no argument is supplied, this will use the default values in [tabnet_config()].
#' @param from_epoch When a `tabnet_model` is provided, restore the network weights from a specific epoch.
#' Default is last available checkpoint for restored model, or last epoch for in-memory model.
#' @param weights Unused.
#' @param weights Unused. Placeholder for hardhat::importance_weight() variables.
#' @param ... Model hyperparameters.
#' Any hyperparameters set here will update those set by the config argument.
#' See [tabnet_config()] for a list of all possible hyperparameters.
Expand Down Expand Up @@ -119,7 +119,7 @@ tabnet_fit.default <- function(x, ...) {
tabnet_fit.data.frame <- function(x, y, tabnet_model = NULL, config = tabnet_config(), ...,
from_epoch = NULL, weights = NULL) {
if (!is.null(weights)) {
message(gettextf("Configured `weights` will not be used"))
message(gettextf("Configured `weights` variables will not be used as predictors"))
}
processed <- hardhat::mold(x, y)
check_type(processed$outcomes)
Expand All @@ -142,7 +142,7 @@ tabnet_fit.data.frame <- function(x, y, tabnet_model = NULL, config = tabnet_con
tabnet_fit.formula <- function(formula, data, tabnet_model = NULL, config = tabnet_config(), ...,
from_epoch = NULL, weights = NULL) {
if (!is.null(weights)) {
message(gettextf("Configured `weights` will not be used"))
message(gettextf("Configured `weights` variables will not be used as predictors"))
}
processed <- hardhat::mold(
formula, data,
Expand Down Expand Up @@ -171,7 +171,7 @@ tabnet_fit.formula <- function(formula, data, tabnet_model = NULL, config = tabn
tabnet_fit.recipe <- function(x, data, tabnet_model = NULL, config = tabnet_config(), ...,
from_epoch = NULL, weights = NULL) {
if (!is.null(weights)) {
message(gettextf("Configured `weights` will not be used"))
message(gettextf("Configured `weights` variables will not be used as predictors"))
}
processed <- hardhat::mold(x, data)
check_type(processed$outcomes)
Expand Down
Binary file modified inst/po/fr/LC_MESSAGES/R-tabnet.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion man/tabnet_fit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 38 additions & 23 deletions po/R-fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,81 @@ msgid ""
msgstr ""
"Project-Id-Version: tabnet 0.4.0.9000\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-21 22:37+0100\n"
"PO-Revision-Date: 2024-02-21 22:42+0100\n"
"POT-Creation-Date: 2024-09-29 08:20+0200\n"
"PO-Revision-Date: 2024-09-29 08:25+0200\n"
"Last-Translator: Christophe Regouby <[email protected]>\n"
"Language-Team: fr\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0.1\n"
"X-Generator: Poedit 3.5\n"

#: dials.R:3
msgid "Package \"dials\" needed for this function to work. Please install it."
msgstr ""
"Le package \"dials\" doit être installé pour cette fonction. Merci de "
"l'installer."

#: dials.R:8
msgid "Package \"cli\" needed for this function to work. Please install it."
msgstr ""
"Le package \"cli\" doit être installé pour cette fonction. Merci de "
"l'installer."

#: dials.R:143
msgid "{.var cat_emb_dim} cannot be used as a {.fun tune} parameter yet."
msgstr ""

#: explain.R:48
#, c-format
msgid "`tabnet_explain()` is not defined for a '%s'."
msgstr "`tabnet_explain()` n’est pas défini pour un '%s'."

#: hardhat.R:109
#: hardhat.R:113
#, c-format
msgid "`tabnet_fit()` is not defined for a '%s'."
msgstr "`tabnet_fit()` n’est pas défini pour un '%s'."

#: hardhat.R:118 hardhat.R:141 hardhat.R:170
#: hardhat.R:122 hardhat.R:145 hardhat.R:174
#, c-format
msgid "Configured `weights` will not be used"
msgstr "Les `weights` configurés ne seront pas utilisés."
msgid "Configured `weights` variables will not be used as predictors"
msgstr ""
"Les variables `weights` configurées ne seront pas utilisés comme prédicteurs."

#: hardhat.R:309
#: hardhat.R:317
#, c-format
msgid "`tabnet_pretrain()` is not defined for a '%s'."
msgstr "`tabnet_pretrain()` n’est pas défini pour un '%s'."

#: hardhat.R:417
#: hardhat.R:425
#, c-format
msgid "'%s' is not recognised as a proper TabNet model"
msgstr "'%s' n’est pas reconnu comme un modèle TabNet correct"

#: hardhat.R:424
#: hardhat.R:432
#, c-format
msgid "The model was trained for less than '%s' epochs"
msgstr "Le modèle a été entrainé sur moins de '%s' époques"

#: hardhat.R:436
#: hardhat.R:444
#, c-format
msgid "Found missing values in the `%s` outcome column."
msgstr "Il y a des valeurs manquantes dans la colonne de résultats `%s`."

#: hardhat.R:446 hardhat.R:561
#: hardhat.R:454 hardhat.R:569
msgid "Model dimensions don't match."
msgstr "Les dimensions ne correspondent pas entre les modèles."

#: hardhat.R:471
#: hardhat.R:479
#, c-format
msgid ""
"No model serialized weight can be found in `%s`, check the model history"
msgstr ""
"Il n’y a pas de points sérialisés de modèle dans `%s`, veuillez vérifier "
"l’historique du modèle"

#: hardhat.R:479
#: hardhat.R:487
msgid ""
"`tabnet_pretrain()` from a model is not currently supported.\n"
"The pretraining here will start with a network initialization"
Expand All @@ -74,42 +85,42 @@ msgstr ""
"pour l'instant.\n"
"Le pré-entraînement va commencer par une initialisation du réseau."

#: hardhat.R:516
#: hardhat.R:524
#, c-format
msgid "The model was trained for less than `%s` epochs"
msgstr "Le modèle a été entrainé sur moins de '%s' époques"

#: hardhat.R:613
#: hardhat.R:621
#, c-format
msgid "Mixed multi-outcome type '%s' is not supported"
msgstr "Le type '%s' n’est pas supporté pour des modèles multi-résultat"

#: hardhat.R:621
#: hardhat.R:629
#, c-format
msgid "Unknown outcome type '%s'"
msgstr "Le type `%s` est inconnu pour une colonne de résultat"

#: hardhat.R:628
#: hardhat.R:636
#, c-format
msgid "Outcome is factor and the prediction type is '%s'."
msgstr ""
"La colonne de résultats est catégorielle et la prédiction est de type '%s'."

#: hardhat.R:631
#: hardhat.R:639
#, c-format
msgid "Outcome is numeric and the prediction type is '%s'."
msgstr ""
"La colonne de résultats est numérique et la prédiction est de type '%s'."

#: hardhat.R:669
#: hardhat.R:677
msgid ""
"The provided hierarchical object is not recognized with a valid format that "
"can be checked"
msgstr ""
"L’objet hiérarchique fournit n’est pas reconnu dans un format valide qui "
"peut être vérifié"

#: hardhat.R:674
#: hardhat.R:682
#, c-format
msgid ""
"The attributes or colnames in the provided hierarchical object use the "
Expand Down Expand Up @@ -155,7 +166,7 @@ msgstr ""
msgid "[Epoch %03d] Loss: %3f, Valid loss: %3f"
msgstr ""

#: model.R:592
#: model.R:592 pretraining.R:217
#, c-format
msgid "Early stopping at epoch %03d"
msgstr "Arrêt anticipé à l’époque %03d"
Expand All @@ -172,13 +183,17 @@ msgstr ""
"aléatoirement à une taille de 1e5. Vous pouvez rendre ce message silencieux "
"en configurant l’argument `importance_sample_size`."

#: parsnip.R:460
#: parsnip.R:465
msgid ""
"Package \"parsnip\" needed for this function to work. Please install it."
msgstr ""
"Le package \"parsnip\" est nécessaire pour exécuter cette fonction, Veuillez "
"l'installer."

#: parsnip.R:549
msgid "parsnip"
msgstr ""

#: pretraining.R:243
#, c-format
msgid ""
Expand Down
54 changes: 33 additions & 21 deletions po/R-tabnet.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: tabnet 0.5.0.9000\n"
"POT-Creation-Date: 2024-02-21 22:37+0100\n"
"Project-Id-Version: tabnet 0.6.0.9000\n"
"POT-Creation-Date: 2024-09-29 08:20+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -14,89 +14,97 @@ msgstr ""
msgid "Package \"dials\" needed for this function to work. Please install it."
msgstr ""

#: dials.R:8
msgid "Package \"cli\" needed for this function to work. Please install it."
msgstr ""

#: dials.R:143
msgid "{.var cat_emb_dim} cannot be used as a {.fun tune} parameter yet."
msgstr ""

#: explain.R:48
#, c-format
msgid "`tabnet_explain()` is not defined for a '%s'."
msgstr ""

#: hardhat.R:109
#: hardhat.R:113
#, c-format
msgid "`tabnet_fit()` is not defined for a '%s'."
msgstr ""

#: hardhat.R:118 hardhat.R:141 hardhat.R:170
#: hardhat.R:122 hardhat.R:145 hardhat.R:174
#, c-format
msgid "Configured `weights` will not be used"
msgid "Configured `weights` variables will not be used as predictors"
msgstr ""

#: hardhat.R:309
#: hardhat.R:317
#, c-format
msgid "`tabnet_pretrain()` is not defined for a '%s'."
msgstr ""

#: hardhat.R:417
#: hardhat.R:425
#, c-format
msgid "'%s' is not recognised as a proper TabNet model"
msgstr ""

#: hardhat.R:424
#: hardhat.R:432
#, c-format
msgid "The model was trained for less than '%s' epochs"
msgstr ""

#: hardhat.R:436
#: hardhat.R:444
#, c-format
msgid "Found missing values in the `%s` outcome column."
msgstr ""

#: hardhat.R:446 hardhat.R:561
#: hardhat.R:454 hardhat.R:569
msgid "Model dimensions don't match."
msgstr ""

#: hardhat.R:471
#: hardhat.R:479
#, c-format
msgid ""
"No model serialized weight can be found in `%s`, check the model history"
msgstr ""

#: hardhat.R:479
#: hardhat.R:487
msgid ""
"`tabnet_pretrain()` from a model is not currently supported.\n"
"The pretraining here will start with a network initialization"
msgstr ""

#: hardhat.R:516
#: hardhat.R:524
#, c-format
msgid "The model was trained for less than `%s` epochs"
msgstr ""

#: hardhat.R:613
#: hardhat.R:621
#, c-format
msgid "Mixed multi-outcome type '%s' is not supported"
msgstr ""

#: hardhat.R:621
#: hardhat.R:629
#, c-format
msgid "Unknown outcome type '%s'"
msgstr ""

#: hardhat.R:628
#: hardhat.R:636
#, c-format
msgid "Outcome is factor and the prediction type is '%s'."
msgstr ""

#: hardhat.R:631
#: hardhat.R:639
#, c-format
msgid "Outcome is numeric and the prediction type is '%s'."
msgstr ""

#: hardhat.R:669
#: hardhat.R:677
msgid ""
"The provided hierarchical object is not recognized with a valid format that "
"can be checked"
msgstr ""

#: hardhat.R:674
#: hardhat.R:682
#, c-format
msgid ""
"The attributes or colnames in the provided hierarchical object use the "
Expand Down Expand Up @@ -134,7 +142,7 @@ msgstr ""
msgid "[Epoch %03d] Loss: %3f, Valid loss: %3f"
msgstr ""

#: model.R:592
#: model.R:592 pretraining.R:217
#, c-format
msgid "Early stopping at epoch %03d"
msgstr ""
Expand All @@ -147,11 +155,15 @@ msgid ""
"message by using the `importance_sample_size` argument."
msgstr ""

#: parsnip.R:460
#: parsnip.R:465
msgid ""
"Package \"parsnip\" needed for this function to work. Please install it."
msgstr ""

#: parsnip.R:549
msgid "parsnip"
msgstr ""

#: pretraining.R:243
#, c-format
msgid ""
Expand Down

0 comments on commit fe56a04

Please sign in to comment.