Open sukanyabag opened 4 years ago
Same Issue plz help
Can you share the screen shot it is difficult to understand
This error message indicates that the OneClassSVM
class in scikit-learn does not have a random_state
parameter. Therefore, passing random_state
as a keyword argument to the constructor of OneClassSVM
results in a TypeError
.
To resolve this issue, you can remove the random_state
parameter from the constructor call. Alternatively, you can use the numpy.random.RandomState
object to set the seed for the random number generator used by the OneClassSVM
object. Here is an example:
import numpy as np
from sklearn.svm import OneClassSVM
state = np.random.RandomState(42)
clf = OneClassSVM(kernel='rbf', degree=3, gamma=0.1, nu=0.05, max_iter=-1, random_state=state)
In this example, the numpy.random.RandomState
object is used to set the seed to 42, which is then passed to the random_state
parameter of the OneClassSVM
constructor.
hope this help! 💪🏻
TypeError Traceback (most recent call last)