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

Problems with TSVM #3

Open
DripyDev opened this issue May 10, 2021 · 0 comments
Open

Problems with TSVM #3

DripyDev opened this issue May 10, 2021 · 0 comments

Comments

@DripyDev
Copy link

I have been working with your code, mostly with the implementation of TSVM, and I see some problems with it that, I think, I have solved.

  1. On **lines 85-90, on the if, I see that your examples never enter there and therefore you got no errors, but the variables Y2 and Y3 are never declared nor used. Using this repository made by horcham as a guide, I suppose that: Y1=self._Y_l, Y2=self._Y_u, Y3=self._Y and X1=self._X_l, X2=self._X_u, X3=self._X. So, this is the solution that I propose:
...
if a > 0 and b > 0 and a + b > 2.0:
    # Switch labels of a pair of unlabeled samples
    self._Y_u[positive_max_id] = self._Y_u[positive_max_id] * -1
    self._Y_u[negative_max_id] = self._Y_u[negative_max_id] * -1
    self._Y=np.concatenate((self._Y_l, self._Y_u))
    self._clf.fit(self._X, self._Y, sample_weight=sample_weight)
else:
    break
...
  1. On **lines 93-95, when you renew the weights of the unlabeled samples, I think that you should use self._X_l instead of self._X_u, as horcham does.

Except from that, I have found your work very usefull and I thank you for letting the comunity use it.

@DripyDev DripyDev changed the title Problemns with TSVM Problems with TSVM May 10, 2021
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

No branches or pull requests

1 participant