On 12/05/2013 06:41 PM, Jibran Khan wrote:
Hi there,
Can anyone help me out of this.
I am using Scikit-learn module of Python for classification analysis
of my data. I am using MODIS satellite sensor image (raster data in
.hdf format having 1-7 spectral bands) and I actually need to perform
decision tree classification of this dataset. I have converted the
raster data into Numpy Array having cell size 1,1 and 2400 number of
rows & columns. Is it possible to implement decision tree on it? Now
with reference to this useful Scikit-learn decision tree page
(http://scikit-learn.org/stable/modules/tree.html) I have gone through
the general workflow, but, I need some help that how to input this
Numpy array and implement decision tree classification on it.
Hi Jibran,
scikit-learn always uses input data of shape [nSamples, nFeatures],
where nSamples in your case means pixels, and nFeatures are the bands of
your modis data. So for example if your modis data is now of shape [7,
2400, 2400], you'd have to reshape that to become [2400*2400, 7], e.g.
"data = data.reshape(7, 5760000).T"
Then use that (or a subset of it) as input for you sklearn decision tree.
Best,
Vincent.
Jibran
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general