0 votes
1 view
in Data Science by (17.6k points)

I have a dataset with labels and datapoints, problem is that rather then a classification problem I want to get a linair estimator, for example :

dataset=prdataset([2,4,6,8]',[1,2,3,4]') testset=prdataset([3,5,7,9]') classifier=dataset*ldc %should probably be changed? result=testset*classifier

result.data now becomes

ans = 1.0e-307 *

     0.2225    0.2225    0.2225    0.2225

   0.2225    0.2225    0.2225    0.2225

   0.2225    0.2225    0.2225    0.2225

   0.2225    0.2225    0.2225    0.2225

which is very wrong.

Ideally it would be [1.5,2.5,3.5,4.5]' or something to close to it. Any idea how to do this in PRtools or in something simulair? This is a linair dependancy but I would also like to be able to play around with other types of dependancies? Also it would be a huge bonus of the system was somewhat clever about NaN values which heavily polute my real dataset. I have already found that linearr class but when I use that I get weirdly sized datasets in return,

dataset=prdataset([2,4,6,8]',[1,2,3,4]') testset=prdataset([3,5,7,9]') classifier=dataset*linearr%should probably be changed? result=testset*classifier

gives me the values

     0.1000   -0.3000   -0.7000   -1.1000

   -0.5000   -0.5000   -0.5000   -0.5000

   -1.1000   -0.7000   -0.3000    0.1000

   -1.7000   -0.9000   -0.1000    0.7000

which is again incorrect.

In chat they suggested using .* instead of * that resulted in Error using * Inner matrix dimensions must agree.

Error in linearr (line 42)

      beta = prinv(X'*X)*X'*gettargets(x);

Error in prmap (line 139)

      [d, varargout{:}] = feval(mapp,a,pars{:});

Error in  * 

Error in dyadicm (line 81)

    v1 = a*v1;     % train first mapping

Error in prmap (line 139)

      [d, varargout{:}] = feval(mapp,a,pars{:});

Error in  * 

In the linearr code.

Just to be clear I'm looking for a way to, given a large set of values find the set of polynomials that best describes their relation (where the polynomials that are considered is a parameter of the program, in the example 1st order). So in our example the polynomial is 1/2a+0. In my final version I want to use a larger number of parameters (10-20) and it may require quadratic estimation.

1 Answer

0 votes
by (40.4k points)

You can use shallow Neural Network to fit the data. A fairly simple neural network can fit any practical function.

Suppose, for instance, that you have data from a health clinic. You want to design a network that can predict the percentage of body fat of a person, given 13 anatomical measurements. You have a total of 252 example people for which you have those 13 items of data and their associated percentages of body fat.

So, you can solve this problem in two ways:

Use a graphical user interface, nftool, as described in https://in.mathworks.com/help/deeplearning/gs/fit-data-with-a-neural-network.html#f9-43356p.

Use command-line functions, as described in https://in.mathworks.com/help/deeplearning/gs/fit-data-with-a-neural-network.html#f9-33554

It is generally best to start with the GUI, and then to use the GUI to automatically generate command-line scripts. Before using either method, first define the problem by selecting a data set. Each GUI has access to many sample data sets that you can use to experiment with the toolbox (see Sample Data Sets for Shallow Neural Networks). If you have a specific problem that you want to solve, you can load your own data into the workspace. The next section describes the data format.

If you want to be build successful data science career then enroll for best data science certification.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !