Skip to content

Commit

Permalink
Create fraud_detection.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 16, 2024
1 parent bf2446f commit 5e2ff01
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ai_ml/models/fraud_detection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pandas as pd
from sklearn.ensemble import RandomForestClassifier

class FraudDetectionModel:
def __init__(self):
self.model = RandomForestClassifier()

def train(self, dataset):
self.model.fit(dataset.drop('target', axis=1), dataset['target'])

def predict(self, transaction):
return self.model.predict(transaction)

0 comments on commit 5e2ff01

Please sign in to comment.