minCount: modo de recuento de selección de características

Modo de recuento de selección de características usado en la transformación de selección de características selectFeatures.

Uso

  minCount(count = 1, ...)

Argumentos

count

Umbral para la selección de características basada en recuento. Se selecciona una característica si y solo si al menos los ejemplos de count tienen un valor no predeterminado en la característica. El valor predeterminado es 1.

...

Argumentos adicionales que se pasarán directamente al motor de proceso de Microsoft.

Detalles

Cuando se usa el modo de recuento en la transformación de selección de características, se selecciona una característica si el número de ejemplos tiene en la característica al menos los ejemplos de recuento especificados de valores no predeterminados. La transformación de selección de características del modo de recuento es útil cuando se utiliza junto con una transformación de hash de categoría (ver también: categoricalHash). La selección de características de recuento puede quitar las características generadas por la transformación hash que no tienen datos en los ejemplos.

Value

Cadena de caracteres que define el modo de recuento.

Autor(es)

Microsoft Corporation Microsoft Technical Support

Vea también

mutualInformationselectFeatures

Ejemplos


 trainReviews <- data.frame(review = c( 
         "This is great",
         "I hate it",
         "Love it",
         "Do not like it",
         "Really like it",
         "I hate it",
         "I like it a lot",
         "I kind of hate it",
         "I do like it",
         "I really hate it",
         "It is very good",
         "I hate it a bunch",
         "I love it a bunch",
         "I hate it",
         "I like it very much",
         "I hate it very much.",
         "I really do love it",
         "I really do hate it",
         "Love it!",
         "Hate it!",
         "I love it",
         "I hate it",
         "I love it",
         "I hate it",
         "I love it"),
      like = c(TRUE, FALSE, TRUE, FALSE, TRUE,
         FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE,
         FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, 
         FALSE, TRUE, FALSE, TRUE), stringsAsFactors = FALSE
     )

     testReviews <- data.frame(review = c(
         "This is great",
         "I hate it",
         "Love it",
         "Really like it",
         "I hate it",
         "I like it a lot",
         "I love it",
         "I do like it",
         "I really hate it",
         "I love it"), stringsAsFactors = FALSE)

 # Use a categorical hash transform which generated 128 features.
 outModel1 <- rxLogisticRegression(like~reviewCatHash, data = trainReviews, l1Weight = 0, 
     mlTransforms = list(categoricalHash(vars = c(reviewCatHash = "review"), hashBits = 7)))
 summary(outModel1)

 # Apply a categorical hash transform and a count feature selection transform
 # which selects only those hash features that has value.
 outModel2 <- rxLogisticRegression(like~reviewCatHash, data = trainReviews, l1Weight = 0, 
     mlTransforms = list(
   categoricalHash(vars = c(reviewCatHash = "review"), hashBits = 7), 
   selectFeatures("reviewCatHash", mode = minCount())))
 summary(outModel2)

 # Apply a categorical hash transform and a mutual information feature selection transform
 # which selects those features appearing with at least a count of 5.
 outModel3 <- rxLogisticRegression(like~reviewCatHash, data = trainReviews, l1Weight = 0, 
     mlTransforms = list(
   categoricalHash(vars = c(reviewCatHash = "review"), hashBits = 7), 
   selectFeatures("reviewCatHash", mode = minCount(count = 5))))
 summary(outModel3)