Import required modules
We will be using IsolationForest Algorithm to perform the anomaly detection. More on IsolationForest here.Load a dataset
Load data from a table into a dataframe (df).Using Streamlit to build an app
We use the Streamlit module (st), built into Peliqan.io, to build a UI and show data.Understanding data
the dataset we are using contained 28 compressed features which are the result of a PCA transformation. Feature ‘Time’ contains the seconds elapsed between each transaction and the first transaction in the dataset. The feature ‘Amount’ is the transaction Amount. Feature ‘Class’ is the response variable and it takes the value 1 in case of fraud and 0 otherwise. Let’s have a look if the data is balanced by plotting the Number of frauds in transactions vs non-frauds.Training the model & predicting
Evaluation & Saving the model
Next Steps
- You can make real-time predictions on new incoming data and send alerts to slack if the model makes a prediction above a certain threshold.
- You can make predictions on real-time incoming data using the saved model. Learn more about making real-time predictions on new incoming data.
- Using Peliqan you can create an app for your users to consume the model you have created in a simple and intuitive UI. Learn more about creating apps for users to consume your model.
