mutualInformation: Mode Informasi Bersama Pemilihan Fitur

Mode informasi bersama dari pemilihan fitur yang digunakan dalam transformasi pemilihan fitur pilihFitur.

Penggunaan

  mutualInformation(numFeaturesToKeep = 1000, numBins = 256, ...)

Argumen

numFeaturesToKeep

Jika jumlah fitur yang akan disimpan ditentukan menjadi n, transformasi memilih n fitur yang memiliki informasi bersama tertinggi dengan variabel dependen. Nilai defaultnya adalah 1000.

numBins

Jumlah maksimum bin untuk nilai numerik. Kekuatan 2 direkomendasikan. Nilai defaultnya adalah 256.

...

Argumen tambahan yang akan diteruskan langsung ke Microsoft Compute Engine.

Detail

Informasi bersama dari dua variabel X acak dan Y merupakan ukuran ketergantungan bersama antara variabel. Secara resmi, informasi bersama dapat ditulis sebagai:

I(X;Y) = E[log(p(x,y)) - log(p(x)) - log(p(y))]

di mana harapan diambil alih distribusi X bersama dan Y. Berikut p(x,y) adalah fungsi kerapatan probabilitas bersama dan XY, p(x) dan p(y) merupakan fungsi kerapatan probabilitas marginal dan XY masing-masing. Secara umum, informasi bersama yang lebih tinggi antara variabel dependen (atau label) dan variabel independen (atau fitur) berarti bahwa label memiliki ketergantungan bersama yang lebih tinggi atas fitur tersebut.

Mode pemilihan fitur informasi bersama memilih fitur berdasarkan informasi bersama. Ini menjaga fitur teratas numFeaturesToKeep dengan informasi bersama terbesar dengan label.

Nilai

string karakter yang menentukan mode .

Penulis

Microsoft Corporation Microsoft Technical Support

Referensi

Wikipedia: Mutual Information

Lihat juga

minCountselectFeatures

Contoh


 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)