maxpumperla / hyperas

Keras + Hyperopt: A very simple wrapper for convenient hyperparameter optimization
http://maxpumperla.com/hyperas/
MIT License
2.17k stars 316 forks source link

getting issue in this code is there anyone can help me out? It will be greatfull... #293

Open rajitsri opened 1 year ago

rajitsri commented 1 year ago

Building another model/classifier ISOLATION FOREST

from sklearn.ensemble import IsolationForest ifc=IsolationForest(max_samples=len(X_train), contamination=outlier_fraction,random_state=1) ifc.fit(X_train) scores_pred = ifc.decision_function(X_train) y_pred = ifc.predict(X_test)

Reshape the prediction values to 0 for valid, 1 for fraud.

y_pred[y_pred == 1] = 0 y_pred[y_pred == -1] = 1

n_errors = (y_pred != Y_test).sum()

JonnoFTW commented 1 year ago

This unformatted code doesn't appear to have anything to do with hyperas.