Skip to content

Commit a46de20

Browse files
modified env.yaml, cleaned up structure, made basic API
1 parent c14a1c4 commit a46de20

27 files changed

+651363
-2
lines changed
File renamed without changes.

backend/Data/malicious_phish.csv

+651,199
Large diffs are not rendered by default.
File renamed without changes.

backend/app/api/models/fraud.py

Whitespace-only changes.

backend/app/api/models/phish_model.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pickle
2+
3+
4+
class RFModel:
5+
def __init__(self):
6+
self.model = self.load_model("phish_model.pkl")
7+
self.vectorizer = self.load_model("vectorizer.pkl")
8+
9+
def load_model(self, model_path):
10+
with open(model_path, "rb") as f:
11+
model = pickle.load(f)
12+
return model
13+
14+
def predict(self, input_data):
15+
# Use the loaded model to make predictions on the input data
16+
input_vectorized = self.vectorizer.transform(input_data)
17+
predictions = self.model.predict(input_data)
18+
return predictions

0 commit comments

Comments
 (0)