Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure related kernels call labels->ensure_valid #545

Merged
merged 3 commits into from
May 22, 2012
Merged

Ensure related kernels call labels->ensure_valid #545

merged 3 commits into from
May 22, 2012

Conversation

pluskid
Copy link
Contributor

@pluskid pluskid commented May 22, 2012

att

@pluskid
Copy link
Contributor Author

pluskid commented May 22, 2012

fixed indent conventions

sonney2k pushed a commit that referenced this pull request May 22, 2012
Ensure related kernels call labels->ensure_valid
@sonney2k sonney2k merged commit 1cc1e70 into shogun-toolbox:master May 22, 2012
sonney2k pushed a commit that referenced this pull request May 22, 2012
Ensure related kernels call labels->ensure_valid
@iglesias
Copy link
Collaborator

I do not seem to find this message in GitHub any more so I am unsure
whether you still have the problem. Anyway, just in case. How have you
compared the format of the arrays returned by the label generator and the
of the loaded arrays? From past experience, it might be that you have to
cast the numpy array to a floating point number type. A hint can be to look
into the dtype attribute of the numpy array.

On 15 October 2015 at 22:30, Ignacio Arroyo notifications@github.com
wrote:

Hi, Please HELP! I have the problem of ensure_valid() when I load binary
labels from file:

self.__testperformace = 100 - evalua.evaluate(out, targetsTs) * 100
RuntimeWarning: [WARN] In file ~/shogun/src/shogun/labels/BinaryLabels.cpp
line 98: BinaryLabels::ensure_valid(): Not a two class labeling - no
positively labeled examples found

The format of the data matrix when loaded into python is:

(Pdb) dataSet
array([[-4.4362 , -6.6584 , -0.69521 , ..., -3.676 , 0.80314 , -5.766 ],
[ 5.3013 , 0.81858 , -1.21 , ..., 2.9577 , -6.7262 , 1.9982 ],
[ 1.0749 , 0.48598 , 0.67389 , ..., 1.1345 , -0.65294 , -2.9625 ],
...,
[ 0.077453, -0.90907 , -0.040345, ..., 0.063672, 0.74749 ,
-0.18453 ],
[-0.068912, -0.34938 , 1.0102 , ..., 0.19859 , -0.07797 ,
0.11058 ],
[ 0.17131 , -0.51044 , 0.147 , ..., 0.26172 , -0.14581 ,
-0.41228 ]])

and the format of corresponding labels is:

(Pdb) labels
array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.])

I have seen a conversation where presumably the issue was fixed. It is
said validation of +1 tags is redundant. However, I dont know if Im doing
something wrong. The training and test procedures run well and results are
equally got. The "annoying" thing is that Shogun prints the above warning
each time, so it is very time consuming for my application.
http://shogun-toolbox.org/page/contact/irclog/2012-05-22/

It is needed to say that when I use an internal label generator (like the
used in the demo bellow), the warning does not take place.
http://www.shogun-toolbox.org/static/notebook/current/MKL.html
I compared the format of arrays returned by the label generator and the
one of the loaded arrays from file and it is the same thing. I really dont
understand where could be the problem.

Thank you very much for your help...


Reply to this email directly or view it on GitHub
#545 (comment)
.

@iarroyof
Copy link

Thank you very much for answering.

Actually I solved the issue and I removed the comment. I think it is still
here wrongly. Any way, I was trying to test by using negative samples
uniquely, so the evaluation method emited the warning. I included positive
test samples and the warning has gonne.
El 16/10/2015 04:31, "Fernando Iglesias" notifications@github.com
escribió:

I do not seem to find this message in GitHub any more so I am unsure
whether you still have the problem. Anyway, just in case. How have you
compared the format of the arrays returned by the label generator and the
of the loaded arrays? From past experience, it might be that you have to
cast the numpy array to a floating point number type. A hint can be to look
into the dtype attribute of the numpy array.

On 15 October 2015 at 22:30, Ignacio Arroyo notifications@github.com
wrote:

Hi, Please HELP! I have the problem of ensure_valid() when I load binary
labels from file:

self.__testperformace = 100 - evalua.evaluate(out, targetsTs) * 100
RuntimeWarning: [WARN] In file
~/shogun/src/shogun/labels/BinaryLabels.cpp
line 98: BinaryLabels::ensure_valid(): Not a two class labeling - no
positively labeled examples found

The format of the data matrix when loaded into python is:

(Pdb) dataSet
array([[-4.4362 , -6.6584 , -0.69521 , ..., -3.676 , 0.80314 , -5.766 ],
[ 5.3013 , 0.81858 , -1.21 , ..., 2.9577 , -6.7262 , 1.9982 ],
[ 1.0749 , 0.48598 , 0.67389 , ..., 1.1345 , -0.65294 , -2.9625 ],
...,
[ 0.077453, -0.90907 , -0.040345, ..., 0.063672, 0.74749 ,
-0.18453 ],
[-0.068912, -0.34938 , 1.0102 , ..., 0.19859 , -0.07797 ,
0.11058 ],
[ 0.17131 , -0.51044 , 0.147 , ..., 0.26172 , -0.14581 ,
-0.41228 ]])

and the format of corresponding labels is:

(Pdb) labels
array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,
-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.])

I have seen a conversation where presumably the issue was fixed. It is
said validation of +1 tags is redundant. However, I dont know if Im doing
something wrong. The training and test procedures run well and results
are
equally got. The "annoying" thing is that Shogun prints the above warning
each time, so it is very time consuming for my application.
http://shogun-toolbox.org/page/contact/irclog/2012-05-22/

It is needed to say that when I use an internal label generator (like the
used in the demo bellow), the warning does not take place.
http://www.shogun-toolbox.org/static/notebook/current/MKL.html
I compared the format of arrays returned by the label generator and the
one of the loaded arrays from file and it is the same thing. I really
dont
understand where could be the problem.

Thank you very much for your help...


Reply to this email directly or view it on GitHub
<
https://github.com/shogun-toolbox/shogun/pull/545#issuecomment-148511742>
.


Reply to this email directly or view it on GitHub
#545 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants