htshinichi / ml_model Goto Github PK
View Code? Open in Web Editor NEW机器学习基础算法模型实现
机器学习基础算法模型实现
没有改动源代码,下载后运行发现如下异常信息
C:\Anaconda3\envs\python.exe C:/MachineLearn/ML_model-master/NaiveBayes/DATA_NB_test.py
Traceback (most recent call last):
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\indexes\base.py", line 2442, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc (pandas_libs\index.c:5280)
File "pandas_libs\index.pyx", line 154, in pandas._libs.index.IndexEngine.get_loc (pandas_libs\index.c:5126)
File "pandas_libs\hashtable_class_helper.pxi", line 1210, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas_libs\hashtable.c:20523)
File "pandas_libs\hashtable_class_helper.pxi", line 1218, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas_libs\hashtable.c:20477)
KeyError: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/MachineLearn/ML_model-master/NaiveBayes/DATA_NB_test.py", line 16, in
model_NBC.getPredictions(dia_train,dia_test)
File "C:\MachineLearn\ML_model-master\NaiveBayes\NaiveBayesContinuous.py", line 72, in getPredictions
result,proby = self.predict(TrainData,self.testdata[i])
File "C:\MachineLearn\ML_model-master\NaiveBayes\NaiveBayesContinuous.py", line 54, in predict
self.cmean,self.cstd,self.label_array=self.getMeanStdLabel(trainData)
File "C:\MachineLearn\ML_model-master\NaiveBayes\NaiveBayesContinuous.py", line 29, in getMeanStdLabel
names['mc%s' % j].append(np.mean(names['c%s' % j][k]))
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\frame.py", line 1964, in getitem
return self._getitem_column(key)
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\frame.py", line 1971, in _getitem_column
return self._get_item_cache(key)
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\generic.py", line 1645, in _get_item_cache
values = self._data.get(item)
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\internals.py", line 3590, in get
loc = self.items.get_loc(item)
File "C:\Anaconda3\envs\lib\site-packages\pandas\core\indexes\base.py", line 2444, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc (pandas_libs\index.c:5280)
File "pandas_libs\index.pyx", line 154, in pandas._libs.index.IndexEngine.get_loc (pandas_libs\index.c:5126)
File "pandas_libs\hashtable_class_helper.pxi", line 1210, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas_libs\hashtable.c:20523)
File "pandas_libs\hashtable_class_helper.pxi", line 1218, in pandas._libs.hashtable.PyObjectHashTable.get_item (pandas_libs\hashtable.c:20477)
KeyError: 0
Process finished with exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.