October 2018
Intermediate to advanced
172 pages
4h 6m
English
Now that we have visualized how a simple linear regression model works in two dimensions, we can use the linear regression algorithm to predict the total amount of a mobile transaction, using all of the other features in our mobile transaction dataset.
The first step is to import our fraud prediction dataset into our workspace and divide it into training and test sets. This can be done by using the following code:
import pandas as pdfrom sklearn.model_selection import train_test_split# Reading in the dataset df = pd.read_csv('fraud_prediction.csv')#Creating the features features = df.drop('isFraud', axis = 1).valuestarget = df['isFraud'].valuesX_train, X_test, y_train, y_test = ...Read now
Unlock full access