As Andy said, you need to create some representation in two dimensions.
You can easily do this by selecting just two features (i.e. the two
most discriminating) or PCA is another good option, but it can be difficult
to understand what is meant by the x-axis and y-axis.

Keep in mind that classification and visualisation are
two distinct components here -- classify using all features and visualise
using two dimensions.
(You can try classify with less features, sometimes it works.)

- Robert


On 26 April 2013 06:56, Andreas Mueller <[email protected]> wrote:

>  Hi Gianni.
> There is a fundamental problem with what you want to do, independent of
> SVMs.
> In the plot, the 2d plane of the pot represents the input space.
> Your input space is 6d. You can not represent 6d on a computer monitor
> (that I know of).
> So there is no way to plot your data.
>
> What you could do, is plot 2d projections of you data, for example using
> PCA.
> That makes it somewhat harder to plot decision boundaries, though.
>
> Hth,
> Andy
>
>
> On 04/25/2013 10:31 PM, Gianni Iannelli wrote:
>
> Hi everyone!
>
>  I'm new to scikit and I'm gettin trouble with some visualization
> method!!!
>
>  What I wanna do is visualize in a plot/graph, something like this:
> http://scikit-learn.org/stable/auto_examples/exercises/plot_iris_exercise.html
>
>  Essentialy I would see the background color based on my training set to
> see how the SVM will classify my new elements. It could be a line or a
> color in the bacground.
>
>  Everything is ok if I will use just two features! I can obtain XX and YY
> but, in my case, I have 6 features and I don't know hot to do the grid!!
> Almost all the example use just two features from the iris dataset...There
> is one that use four but essentially it applies a PCA in order to reduce
> the features to two and so, let me say, I kind of cheating in order to get
> the graph....
>
>  Actually my code is the following:
>
>   ....
> graph = pylab.scatter(X_train[:,0],X_train[:,2],c=colors, zorder= 10)
> ax = grafico.axes
> ax.set_xlabel('Feature_1')
> ax.set_ylabel('Feature_2')
> pylab.scatter(clf.support_vectors_[:,0],clf.support_vectors_[:,2],marker =
> 'x', c='y',s=200,zorder= 1, label='Support Vector')
> pylab.legend(loc = 'lower right')
> pylab.show()
>  ....
>
>  Where X_train contain six features and not just two!
>
>  Thanks to everyone!!!
>
>  Solimyr
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>
>
>
> _______________________________________________
> Scikit-learn-general mailing 
> [email protected]https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>


-- 

Public key at: http://pgp.mit.edu/ Search for this email address and select
the key from "2011-08-19" (key id: 54BA8735)
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to