title: Memory Error when running "normal" Code in Python?
body: <p>I just experimented with the Indian Pima Diabetes Dataset from kaggle.com, which as 7 inputs and 2 outputs. I tried to use the ANFIS-Package in Python with Anaconda and Jupyter Notebook, but even if I am just using 10 or 5 samples, I get an Memory Error. I am really NOT a specialist in programming or computer science, so I have - after reading a lot of advices in the internet - absolutelly NO idea, why this occurs and how I can solve it. So I hope for your help, guys!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import numpy as np
  diabetes = np.loadtxt("C:/Users/elihe/Documents/Studium Master/Masterarbeit/diabetes.txt", delimiter = ',')
  X = diabetes[:5, 0:8]
  y = diabetes[:5, 8]
  
  from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
  
  # Input 0: Schwangerschaften - wenig, normal, viel
  mf = [[['gaussmf',{'mean':2.,'sigma':1.}], ['gaussmf', {'mean':6., 'sigma': 1.}], ['sigmf', {'b': 9., 'c':1.}]],
       # Input 1: Glukose - niedrig, normal, hoch
       [['gaussmf',{'mean':60.,'sigma':10.}], ['gaussmf',{'mean':120.,'sigma':10.}], ['sigmf', {'b': 160., 'c':0.7}]],
       # Input 2: Blutdruck - niedrig, normal, hoch
       [['gaussmf',{'mean':40.,'sigma':5.}], ['gaussmf',{'mean':80.,'sigma':5.}], ['sigmf', {'b': 100., 'c':0.7}]],
       # Input 3: Hautdicke - dünn, normal, dick
       [['gaussmf',{'mean':30.,'sigma':5.}], ['gaussmf',{'mean':60.,'sigma':5.}], ['sigmf', {'b': 80., 'c':0.7}]],
       # Input 4: Insulin - niedrig, mittel, hoch
       [['gaussmf',{'mean':100.,'sigma':15.}], ['gaussmf',{'mean':300.,'sigma':15.}], ['sigmf', {'b': 600., 'c':0.5}]],
       # Input 5: BMI - niedrig, normal, hoch
       [['gaussmf',{'mean':15.,'sigma':3.}], ['gaussmf',{'mean':30.,'sigma':3.}], ['sigmf', {'b': 40., 'c':1.}]],
       # Input 6: Diabetes-Stammbaum-Funktion - niedriges Risiko, normales Risiko, hohes Risiko
       [['gaussmf',{'mean':0.5,'sigma':0.5}], ['gaussmf',{'mean':1.5,'sigma':0.5}], ['sigmf', {'b': 2., 'c':2.}]],
       # Input 7: Alter - jung, normal, alt
       [['gaussmf',{'mean':30,'sigma':3}], ['gaussmf',{'mean':50,'sigma':4}], ['sigmf', {'b': 70., 'c':1.}]]]
  
  import anfis
  from anfis.membership import membershipfunction, mfDerivs
  
  mfc = membershipfunction.MemFuncs(mf)
  
  from anfis import anfis
  anf = anfis.ANFIS(X_train, y_train, mfc)
  
  # Fitting
  anf.trainHybridJangOffLine(epochs=2)
  </code></pre>
  
  <p>and at this point, after everything else goes good, this error occurs:</p>
  
  <pre><code>MemoryErrorTraceback (most recent call last)
  &lt;ipython-input-8-a274e224b0d3&gt; in &lt;module&gt;()
        4 
        5 # Fitting
  ----&gt; 6 anf.trainHybridJangOffLine(epochs=2)
  
  C:\Users\elihe\anaconda3\envs\py27\lib\site-packages\anfis\anfis.pyc in trainHybridJangOffLine(self, epochs, tolerance, initialGamma, k)
       67 
       68             #layer five: least squares estimate
  ---&gt; 69             layerFive = np.array(self.LSE(layerFour,self.Y,initialGamma))
       70             self.consequents = layerFive
       71             layerFive = np.dot(layerFour,layerFive)
  
  C:\Users\elihe\anaconda3\envs\py27\lib\site-packages\anfis\anfis.pyc in LSE(self, A, B, initialGamma)
       46         coeffMat = A
       47         rhsMat = B
  ---&gt; 48         S = np.eye(coeffMat.shape[1])*initialGamma
       49         x = np.zeros((coeffMat.shape[1],1)) # need to correct for multi-dim B
       50         for i in range(len(coeffMat[:,0])):
  
  C:\Users\elihe\anaconda3\envs\py27\lib\site-packages\numpy\lib\twodim_base.pyc in eye(N, M, k, dtype, order)
      199     if M is None:
      200         M = N
  --&gt; 201     m = zeros((N, M), dtype=dtype, order=order)
      202     if k &gt;= M:
      203         return m
  
  MemoryError: 
  </code></pre>
  
  <p>I really don't know, what is going on :(</p>