Giter VIP home page Giter VIP logo

ml_model's People

Contributors

htshinichi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ml_model's Issues

运行NaiveBayes遇到一个问题

没有改动源代码,下载后运行发现如下异常信息

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.