If I try to do something like:

import numpy as np
from sklearn.ensemble import RandomForestClassifier

X = np.random.random((100, 10))
y = np.random.randint(2, size=100)
estimator = RandomForestClassifier()
estimator.fit(X, y)

a = np.asarray([estimator])

a is a list of the individual DecisionTreeClassifier objects belonging to
the model, instead of a list containing the model itself. The same result
occurs if I add dtype=object to np.asarray.

Why is this happening? Is there a way to prevent it?

Thanks,
Steve
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to