感知器学习 - 最重要的特征(Perceptron learning - most important feature)
对于我在AI课程中的一项任务,我们的任务是创建Widrow Hoff delta规则的感知器学习实现。 我在java中编写了这个实现:
以下github链接包含该项目: https : //github.com/dmcquillan314/CS440-Homework/tree/master/CS440-HW2-1
我遇到的问题不在于感知器的创造。 这工作正常。
在训练后的项目中,感知器然后将未分类的数据集应用于感知器,然后学习每个输入向量的分类。 这也很好。
我的问题涉及学习输入的哪个特征是最重要的。
例如,如果每个输入向量中的特征集是颜色,汽车模型和汽车制造,我们想要分类哪个特征是最重要的。 怎么会这样做呢。
我对此的原始理解使我相信计算相关系数是每个输入的特征值和产生的分类矢量。 然而,事实证明这是一个错误的假设。
还有其他方法可以学习最重要的功能吗?
编辑
样本权重向量:
(-752,4771,17714,762,6,676,3060,-2004,5459,9591.299,3832,14963,20912)
样本输入向量:
(55,1,2,130,262,0,0,155,0,0,1,0,3,0)
(59,1,3,126,218,1,0,134,0,2.2,2,1,6,1)
(45,1,2,128,308,0,2,170,0,0,1,0,3,0)
(59,1,4,110,239,0,2,142,1,1.2,2,1,7,1)
最后一个要素是分类。
当我找到答案时,我会在这里发布答案。 到目前为止,我认为教师给出的答案是不准确的。
For one of my assignments in my AI class we were tasked with creating a perceptron learning implementation of the Widrow Hoff delta rule. I've coded this implementation in java:
The following github link contains the project: https://github.com/dmcquillan314/CS440-Homework/tree/master/CS440-HW2-1
The issue that I'm having is not with the creation of the perceptron. That is working fine.
In the project after training the perceptron I then applied an unclassified dataset to the perceptron to then learn the classifications of each input vector. This also worked fine.
My issue pertains to learning which feature of the inputs is the most important.
For example, if the feature set within each input vector was color, car model, and car make and we wanted to classify which feature was the most important. How would one go about doing so.
My original understanding of this led me to believe that calculating the correlation coefficient the value of that feature for each input and the classification vector that is produced. However, this turned out to be a false assumption.
Is there some other way that the most important feature can be learned?
EDIT
Sample weight vector:
( -752, 4771, 17714, 762, 6, 676, 3060, -2004, 5459, 9591.299, 3832, 14963, 20912 )
Sample input vectors:
(55, 1, 2, 130, 262, 0, 0, 155, 0, 0, 1, 0, 3, 0)
(59, 1, 3, 126, 218, 1, 0, 134, 0, 2.2, 2, 1, 6, 1)
(45, 1, 2, 128, 308, 0, 2, 170, 0, 0, 1, 0, 3, 0)
(59, 1, 4, 110, 239, 0, 2, 142, 1, 1.2, 2, 1, 7, 1)
The last element is the classification.
I will post an answer here when I find one. So far I believe that the answer given by the instructor is inaccurate.
原文:https://stackoverflow.com/questions/21738277
最满意答案
将
g:netrw_keepdir
设置为0可以为你工作而不是尝试绝对路径吗? 这不完全是你想要的(我怀疑它是采用vim CWD并将其应用于netrw而不是其他方式),但是如果你可以使用netrw管理你的vim CWD,你的命令可能只是工作原样。编辑:请看
:help netrw-c
进行详细说明。 netrw中的c
命令可能就足够了。Well, as it turns out, when your cursor is on the
..
in the file list it considers that a directory.All I really needed to do was move the cursor into the banner area before trying to
mt
- ormt
from the parent directory.Whoops!
相关问答
更多-
Vim netrw询问“按ENTER键或键入命令继续”(Vim netrw asking to “Press ENTER or type command to continue”)[2022-10-10]
v:scrollstart的内容可以用来了解为什么会发生这种情况。 有些选项可能与问题有关。 来自vim-faq : Vim will prompt you with the "hit enter to continue" prompt, if there are some messages on the screen for you to read and the screen is about to be redrawn. You can add the 'T' flag to the ' ... -
.vimrc .vim脚本/插件/ whatelse中的绝对路径或相对路径(.vimrc absolute or relative path in .vim script/plugin/whatelse)[2022-05-27]
相对等价于:source是:runtime 。 source ~/.vim/plugin/someplugin.vim 变 runtime plugin/someplugin.vim 有了这个,只要你也修改'runtimepath'选项中的路径,它应该可以工作。 或者,您也可以更改Vim中$HOME的值; 这也影响~的扩展: :let $HOME = '/home/yourlogin' The relative equivalent to :source is :runtime. source ~/. ... -
您已经在问题中使用了正确的术语: 会话可以帮助您。 你创建一个通过:mksession ; 这基本上生成一个Vim脚本,当在新的Vim实例中执行时(通过:source Session.vim ),将恢复所有当前缓冲区。 这也适用于netrw的远程缓冲区 - 我只需通过:e!方式重新加载:e! 再次获取内容。 注意:有一些插件可以进一步简化会话处理; 我可以推荐vim-session插件。 You've already used the right term in your question: session ...
-
Vim netrw源会话错误?(Vim netrw source session error?)[2023-08-26]
netrw插件使用所谓的临时缓冲区来显示文件列表。 内容不会持久化到磁盘; 相反,它们是由插件动态创建和更新的。 会话适用于由文件备份的“普通”缓冲区; 大多数插件都不适合他们。 某些会话管理器插件明确支持某些插件,但一般情况下,建议在创建会话之前关闭所有插件窗口,并在会话恢复后重新打开它们。 The netrw plugin uses a so-called scratch buffer to display the file listing. The contents are not persisted ... -
默认情况下,netrw的浏览目录与vim当前目录的概念不同(为了与vim v6中的资源管理器向后兼容)(另请参阅:help g:netrw_keepdir)。 它不会影响树根; 为此,使用:Ntree [dirname]。 我试过一个映射: map
nt :Ntree 它按预期工作。 确保你有一个netrw v150或更高版本,但是 - :Ntree直到2014年1月才推出。 By default, netrw's browsing directory is not the sam ... -
你的步骤很好。 按照您的说明,我只是成功地将文件从远程scp://链接复制到本地系统(本地是GVIM 7.3.823,netrw v150h,远程Ubuntu 13.04服务器)。 一定要试用最新的开发版本 ; Chip博士不断改进他的插件。 有关进一步的故障排除(以及可能与问题联系的作者),请参阅:help netrw-debug 。 I was able make it working by using :e scp://remoteuser@remotehost/path/. The reason b ...
-
将g:netrw_keepdir设置为0可以为你工作而不是尝试绝对路径吗? 这不完全是你想要的(我怀疑它是采用vim CWD并将其应用于netrw而不是其他方式),但是如果你可以使用netrw管理你的vim CWD,你的命令可能只是工作原样。 编辑:请看:help netrw-c进行详细说明。 netrw中的c命令可能就足够了。 Well, as it turns out, when your cursor is on the .. in the file list it considers that a ...
-
我想你将不得不覆盖映射。 autocmd filetype netrw call Netrw_mappings() function! Netrw_mappings() noremap
% :call CreateInPreview() endfunction 在这个函数中你将不得不重建netrw函数,但它并不难: function! CreateInPreview() let l:filename = input("please enter filename: ") ... -
跑 runtime plugin/netrwPlugin.vim 这将在运行时路径中搜索plugin/netrwPlugin.vim的第一个实例并获取文件。 Run runtime plugin/netrwPlugin.vim This will search for the first instance of plugin/netrwPlugin.vim in your runtime path and source the file.
-
我会用粗略的映射来处理你的第一个要求: :nnoremap
:Explore / 并看看它是否真的需要更复杂。 你的第二个要求听起来不太可能,因为这意味着/用于两个截然不同的动作,在同一模式下听起来非常不像vim一样。 在我看来, 更清晰,更直观。 Vim不进行模糊搜索,因此您需要编写自己的算法或将其从其他人的插件中提取出来。 set incsearch可能是一个很好的临时解决方案(对我来说肯定是)。 autocmd FileType netrw call feedkeys("/ ...