TypeError: __init__() got an unexpected keyword argument ‘random_state’ problem

can someone help me? I try to run this code, but the following error shows up:

TypeError                                 Traceback (most recent call last)
C:UsersAZMANM~1AppDataLocalTemp/ipykernel_15348/2082714433.py in <module>
  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 }

TypeError: __init__() got an unexpected keyword argument 'random_state'

This is my source code

classifiers = {
"Isolation Forest":IsolationForest(n_estimators=100, max_samples=len(X), 
                                   contamination=outlier_fraction,random_state=state, verbose=0),
"Local Outlier Factor":LocalOutlierFactor(n_neighbors=20, algorithm='auto', 
                                          leaf_size=30, metric='minkowski',
                                          p=2, metric_params=None, contamination=outlier_fraction),
"Support Vector Machine":OneClassSVM(kernel='rbf', degree=3, gamma=0.1,nu=0.05, 
                                     max_iter=-1, random_state=state)}

Source: Python-3x Questions

LEAVE A COMMENT