nlp-learning-tutorials's Introduction
nlp-learning-tutorials's People
Forkers
yishuihanhan recotone damonpaul iiclear sunny8898 xiongfeiqin yushijie1997 fyowen zpnew cathy127 jadeluo 31501098waz qqlmoony 1019love0 snowjake geek12580 umnachtung chuxiao0206 xvwh schlzzz43 zhangzhiting cao-ming yjs789 kangofchen zqp563830312 hualangzeng kaethefu minyanan leeblong wangtaicheng pandascute jimoc2048bits panxiangwei kevinnevergu douyuc thecoldtea cyx3212 robertaaa ethanzh0515 aliawhy ljlc echo1314 icyeyeball hushaoshuai linerxb lovlo wangliansong woshipengsen wangpin000 johnparkerlee 3sunny twilight1223 timetravel21 cangxiaoshu fickle519 nlp-nlp bzqweiyi jiawenlinlin yf664970520 ahtcmshen hunagjingwei zqgithubs zhangchunyu1998 lhhan1996 ruinsin 0ox1 zhaoxuangithub xieyuanhuata jsusu jasonkim001 asd644599667 wwwzhangshenzecn lt15523290043 qiangge1987 pppppp040 cjrzh jft-ai littleurgent rine-hub rzylucas ajiling wuxiaobo liuyangzy futureflsl sinker2267 nswd s-eliauk freedom-love qiwangzhixinxin 9vivian88 gn9280 dddbb43 styjb czw461124251 audrena realxm hee0624 lwwwc lukai404 psychomassonnlp-learning-tutorials's Issues
preprocessing.OneHotEncoder TypeError: __init__() got an unexpected keyword argument 'categories'
您好 在pycharm上运行您的代码 其中独热编码这一段 要报错 没有category这个关键词 请问是什么原因呢
onehot_encoder = preprocessing.OneHotEncoder(sparse=False,categories=[range(labels_nums)])
TypeError: init() got an unexpected keyword argument 'categories'
ValueError: Found unknown categories [-1] in column 0 during fit
在学习你的博客时我遇到了一个问题,因为我是新手。不太明白如何处理。
File "D:/code/github/nlp-learning-tutorials/THUCNews/train_val.py", line 196, in main out_dir=out_dir) File "D:/code/github/nlp-learning-tutorials/THUCNews/train_val.py", line 149, in train train_batch_data, train_batch_label = create_batch_data.get_next_batch(train_batch) File "D:\code\github\nlp-learning-tutorials\THUCNews\utils\create_batch_data.py", line 67, in get_next_batch return batch.__next__() File "D:\code\github\nlp-learning-tutorials\THUCNews\utils\create_batch_data.py", line 62, in get_data_batch batch_labels = onehot_encoder.fit_transform(batch_labels) File "C:\python36\lib\site-packages\sklearn\preprocessing\_encoders.py", line 516, in fit_transform return self.fit(X).transform(X) File "C:\python36\lib\site-packages\sklearn\preprocessing\_encoders.py", line 427, in fit self._fit(X, handle_unknown=self.handle_unknown) File "C:\python36\lib\site-packages\sklearn\preprocessing\_encoders.py", line 88, in _fit raise ValueError(msg) ValueError: Found unknown categories [-1] in column 0 during fit
我打印one_hot之前的batch_labels显示的是
[[-1] [-1] ... [-1] [-1]]
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.