我需要标签预测的主要功能。
通过使用clf.feature_log_prob_,clf是多项式NB分类器,它返回给定类P(x_i | y)的特征的经验对数概率
class Program
{
const UInt32 WM_KEYDOWN = 0x0100;
const UInt32 WM_KEYUP = 0x0101;
const int VK_CONTROL = 0x11;
const int VK_HOME = 0x24;
const int VK_SPACE = 0x20;
[DllImport("user32.dll")]
static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam);
[STAThread]
static void Main()
{
while (true)
{
var stop = false;
var key = Console.ReadKey(true).Key;
switch (key)
{
case ConsoleKey.Enter:
{
var aimp = Process.GetProcessById(13848); // by id for debugging purposes
var keydown = PostMessage(aimp.MainWindowHandle, WM_KEYDOWN, VK_SPACE, 0);
var keyup = PostMessage(aimp.MainWindowHandle, WM_KEYUP, VK_SPACE, 0);
Console.WriteLine($"Keydown: {keydown}\tKeyup: {keyup}");
break;
}
default:
{
stop = true;
break;
}
}
if (stop) break;
}
}
}
我希望获得对y预测非常重要的前20个功能。