Comments (4)
@zhaoxinjie
先回答第一个问题
感知机是二分类,常用的是$y\in \Y ={-1,+1}$,这种情况直接用y就OK
但是还有一种二分类标签用$y\in \Y ={0,1}$,为了兼容用这种标签的数据形式,做了这个操作实现标签从${0,1}$到${-1,+1}的映射。
这样会把$\Y={+1,-1}$映射到$\Y={+1,-3}$,符号没有变化。
from lihang.
@zhaoxinjie
回答第二个问题
这部分代码写的不好
if wx * yy_ > 0:
correct_count += 1
if correct_count > self.max_iter_:
logger.info(correct_count)
break
continue
self.w += self.eta_ * yy_ * xx_
n_iter_ += 1
这里面用了continue会跳过后面的n_iter_累加,所以又加了correct_count来判
我在review03的branch里面push了个新的更新
if wx * yy_ <= 0:
self.w += self.eta_ * yy_ * xx_
n_iter_ += 1
不知道这样是不是可接受。
大多数算法都用到wx+b,刷参数,无论刷出来是否高效,最后可能都能用。这个就是算法有意思的地方吧。
from lihang.
哇,原来如此,百思不得其解,被你一语道破,太谢谢了!
其实这个也有点问题,是不是? 相当于有一个方向调整的学习率要大一些。
反正,能用再说,具体问题具体看吧。算法不能离开数据集,和数据在一起才是完整的算法。
from lihang.
哇,原来如此,百思不得其解,被你一语道破,太谢谢了!
from lihang.
Related Issues (20)
- 说实话你这个解说问题太太多
- 提升方法推导过程提问 HOT 1
- 这行 j 因该是 i HOT 2
- 关于支持向量机有6个向量拉格朗日对偶来求怎么理解?
- GMM聚类怎么确定类别的?
- 楼主能否提供PDF?
- 解压密码是多少
- 图片无法正常显示 HOT 1
- 楼主可以提供EPUB模式吗
- 为什么SVD拿到的结果和书中不一样 HOT 1
- 有没有那么一瞬间觉得PCA和LSA是一回事?
- 感知机中的w怎么画出来的?
- 方差为1和标准差为1是一个概念么?
- 逻辑回归只能用Sigmoid么?比如ReLU行不行 HOT 1
- how to show the 'hits'? HOT 2
- 关于LSA的一些问题
- 库文件主函数中设置日志的意义是什么?
- 统计学习视频
- 什么时候后面几章内容也能出来啊
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lihang.