Python 随机森林分类器的拟合问题

Python 随机森林分类器的拟合问题,python,scikit-learn,Python,Scikit Learn,我正在使用IPython的UI和适当的库(Anaconda、pandas、numpy) 我已经声明了一个pandas对象df,我已经更改了它,使第一列是我希望预测的期望值,但是我的代码仍然在第10行停止。第11行没有运行。相反,Terminal IPython窗口退出并显示此错误: ~/anaconda/bin/python.app: line 3: 45581 Killed: 9 ~/anaconda/python.app/Contents/MacOS/python

我正在使用IPython的UI和适当的库(Anaconda、pandas、numpy)

我已经声明了一个pandas对象df,我已经更改了它,使第一列是我希望预测的期望值,但是我的代码仍然在第10行停止。第11行没有运行。相反,Terminal IPython窗口退出并显示此错误:

~/anaconda/bin/python.app: line 3: 45581 Killed: 9               ~/anaconda/python.app/Contents/MacOS/python "$@"
代码开头

In [1]: import pandas as pd

In [2]: import numpy as np

In [3]: df = pd.read_csv('train.csv', header=0)

In [4]: cols = list(df)

In [5]: cols.insert(0, cols.pop(cols.index('Cover_Type'))) %Cover type is column I wanted to bring to column position 1 or value I'm predicting

In [6]: cols

In [7]: df = df.ix[:, cols]

In [8]: df

In [9]: forest = RandomForestClassifier(n_estimators = 100)

In [10]: forest = forest.fit(train_data[0::,1::],train_data[0::,0])

In [11]: output = forest.predict(test_data)

In [12]: train_data = df.values

In [13]: train_data

您正在使用第10行中不可用的列车数据。以后再分配


首先分配列车数据,然后在林中使用。拟合

列车数据来自何处?列车运行数据的尺寸是多少?这个错误可能是由某种内存限制引起的?