krishnaik06 / Credit-Card-Fraudlent

GNU General Public License v3.0
166 stars 167 forks source link

facing this error. please help #1

Open sukanyabag opened 4 years ago

sukanyabag commented 4 years ago

TypeError Traceback (most recent call last)

in 8 p=2, metric_params=None, contamination=outlier_fraction), 9 "Support Vector Machine":OneClassSVM(kernel='rbf', degree=3, gamma=0.1,nu=0.05, ---> 10 max_iter=-1, random_state = state) 11 12 } ~\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs) 71 FutureWarning) 72 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)}) ---> 73 return f(**kwargs) 74 return inner_f 75 TypeError: __init__() got an unexpected keyword argument 'random_state
code-vivek950 commented 3 years ago

Same Issue plz help

nitin-pandita commented 1 year ago

Can you share the screen shot it is difficult to understand

DataSpieler12345 commented 1 year ago

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! 💪🏻