title: Sklearn.PCA-unexpected keyword argument 'random_state'
body: <pre><code>def doPCA(data, dimensions=2):
  from sklearn.decomposition import PCA
  model = PCA(n_components=dimensions, svd_solver='randomized', random_state=7)
  model.fit(data)
  return model
  </code></pre>
  
  <blockquote>
    <p>File "/home/dogus/Downloads/DAT210x-master/Module5/assignment4.py",
    line 221, in 
        display_pca = doPCA(T)</p>
    
    <p>File "/home/dogus/Downloads/DAT210x-master/Module5/assignment4.py",
    line 56, in doPCA
        model = PCA(n_components=dimensions, svd_solver='randomized', random_state=None)</p>
    
    <p>TypeError: <strong>init</strong>() got an unexpected keyword argument
    'random_state'</p>
  </blockquote>
  
  <ul>
  <li>I use Spyder with python2.7 in Ubuntu. </li>
  <li>I installed sklearn with conda,i also installed it via 'pip install'.</li>
  <li>I tried random_state=None but gave me the same error.</li>
  <li>Then i ran it via terminal and it worked without any error.</li>
  </ul>
  
  <p>Edit:</p>
  
  <ul>
  <li>Scikit-learn(1.18.1),spyder,scipy,numpy,ipython updated via anaconda.</li>
  <li>Then i restarted Spyder and tried to run the code but gave me the
  same error.</li>
  <li>I ran the codes via IPython and Python consoles.</li>
  </ul>
  
  <p>Problem caused by Spyder? How can i fix it?</p>