title: 'numpy.ndarray' object has no attribute 'columns'
body: <p>I am trying to find out the feature importance for Random Forest Classification Task. But it gives me following error :</p>
  
  <blockquote>
    <p>'numpy.ndarray' object has no attribute 'columns'</p>
  </blockquote>
  
  <p>Here is a portion of my code :</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import matplotlib.pyplot as plt
  %matplotlib inline
  
  
  # importing dataset
  
  dataset=pd.read_csv('Churn_Modelling.csv')
  X = dataset.iloc[:,3:12].values
  Y = dataset.iloc[:,13].values
  
  #spliting dataset into test set and train set
  
  from sklearn.model_selection import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.20)
  
  from sklearn.ensemble import RandomForestRegressor
  
  regressor = RandomForestRegressor(n_estimators=20, random_state=0)  
  regressor.fit(X_train, y_train) 
  
  #feature importance
  
  feature_importances = pd.DataFrame(rf.feature_importances_,index = X_train.columns,columns=['importance']).sort_values('importance',ascending=False)
  
  
  </code></pre>
  
  <p>I expect this should give the features importance score for each column of my dataset. (Note: the original data is in CSV formate)</p>