Devi Prasad Khatua
Devi Prasad Khatua

Reputation: 1235

How to visualize 5-D feature set and regression results using `matplotlib`?

I am using sklearn.svm Support Vector Regression to solve a regression problem on a continous dataset where feature set has 5 dimensions and 1 dimension label set, below is the how the dataset looks like:

>>> type(feature_set)
55: <type 'numpy.ndarray'>
>>> type(label_set)
56: <type 'numpy.ndarray'>
>>> feature_set.shape
57: (31875, 5)
>>> label_set.shape
58: (31875,)

Now I just want to visualize/plot the data and I don't know how to do it. Moreover there are 5 dimensions in the feature set, but we can plot only two dimensions, right?

Here is my regressor:

from sklearn.svm import SVR
reg = SVR()
count = int(len(feature_set)*0.8)
reg.fit(feature_set[:count], label_set[:count])

Is it possible to visualize/plot the outcome of regressor too? I am very new to this and so open to any or different techniques through which I will be able to visualize continuous data(preferred matplotlib). Thank You.

Upvotes: 1

Views: 574

Answers (1)

amhr
amhr

Reputation: 41

You should first take a look at the below scikit-learn example that demonstrates how to use principal component analysis and linear discriminant analysis. If that doesn't take your data to where you want, you could try the computationally more expensive methods of the manifold module.

http://scikit-learn.org/stable/auto_examples/decomposition/plot_pca_vs_lda.html#example-decomposition-plot-pca-vs-lda-py

http://scikit-learn.org/stable/modules/manifold.html

EDIT: It might be a good idea to scale your data before passing them to any dimensionality reduction. See e.g. http://scikit-learn.org/stable/modules/preprocessing.html#preprocessing

Upvotes: 1

Related Questions