minCount: 기능 선택 개수 모드

기능 선택 변환 selectFeatures에서 사용되는 기능 선택의 개수 모드입니다.

사용

  minCount(count = 1, ...)

인수

count

개수 기반 기능 선택의 임계값입니다. 기능에서 count 이상의 예제가 기본값이 아닌 값을 갖는 경우에만 기능이 선택됩니다. 기본값은 1입니다.

...

Microsoft 컴퓨팅 엔진에 직접 전달할 추가 인수입니다.

세부 정보

기능 선택 변환에서 개수 모드를 사용할 때 기능의 기본값이 아닌 값에 지정된 개수 이상의 예제가 예제 수에 있으면 기능이 선택됩니다. 개수 모드 기능 선택 변환은 범주 해시 변환과 함께 적용될 경우 유용합니다(categoricalHash 참조). 개수 기능 선택에서는 예제에 데이터가 없는 해시 변환에 의해 생성된 기능을 제거할 수 있습니다.

개수 모드를 정의하는 문자열입니다.

작성자

Microsoft Corporation Microsoft Technical Support

참고 항목

mutualInformationselectFeatures


 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)