SVM applied in images using Julia Language

Viewed 78

I would like to create programming involving a support vector machine (SVM) in Julia with scikit-Learn of Python.

So I need a training set (X_train) and a test set (y_train).

As an example, I have an X set of type 500 x 3 (this is my full data).

Hence, I get a subset A of X of type Array 110 x 3 and a subset B of X of type Array 120 x 3. The union of sets A and B will be my X_train training set.

My y_train set is obtained as follows:

For every vector element of A, I associate with the number 0 and for every vector element of B, I associate with the number 1.

So I have the following training and exit set:

T = {(a1, 0), (a2, 0), ..., (a110,0), (b1, 1), (b2, 1), ..., (b120, 1)}.

These sets A and B are disjoint and obtained from an RGB img vector image that I transformed into X of the 500 x 3 array type.

After having the T set, I should use Python's scikitlearn library in Julia, the svc.fit() command and probably the svc.predict() command to create a prediction model for the remaining pixels that have not been trained.

Could someone help me make this code?

I am not able to associate every element from A to 0 and every element from B to 1.

To concatenate I am using vcat(A, B) and defining X_train = vcat(A, B).

I've tried many things and I can't get out of here.

In summary:

I have an X set of vectors in 3 coordinates. And I would like to associate a numerical value between 0 and 1 for each X vector. So I took a part of the X set as the X_train training set. This X_train set is the union of two disjoint subsets A and B in which for each vector of A I know that y is 0 and for each vector of B I know that y is 1. I would now like to train the X_train set and get a y function that gives me a value between 0 to 1 of the whole X set. This via SVM. I believe that there are many other supervised approaches, but with that I can follow.

0 Answers
Related