Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# Any results you write to the current directory are saved as output.
/kaggle/input/pg.csv
import pandas as pd
pg = pd.read_csv("../input/pg.csv")
# Run this code!
# It sets up the graphing configuration.
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as graph
%matplotlib inline
graph.rcParams['figure.figsize'] = (15,5)
graph.rcParams["font.family"] = 'DejaVu Sans'
graph.rcParams["font.size"] = '12'
graph.rcParams['image.cmap'] = 'rainbow'
import pandas as pd
import numpy as np
# Loads the SVM library
from sklearn import svm
# Loads the dataset
pg = pd.read_csv("../input/pg.csv")
###
print(pg.head())
ListingNumber LoanAmount BorrowerRate OrigMID ObservationMonth \
0 3900518 2000.0 0.177 201601 201601
1 3900518 2000.0 0.177 201601 201602
2 3900518 2000.0 0.177 201601 201603
3 3900518 2000.0 0.177 201601 201604
4 3900518 2000.0 0.177 201601 201605
CycleCounter DaysPastDue_EOM PrincipalPaid InterestPaid CumulCO \
0 0 0 0.00 0.00 0.0
1 1 0 41.93 30.07 0.0
2 2 0 44.47 27.53 0.0
3 3 0 43.23 28.77 0.0
4 4 0 44.79 27.21 0.0
BOMPrinAdjusted EOMPrinAdjusted pagaya
0 2000.00 2000.00 False
1 2000.00 1958.07 False
2 1958.07 1913.60 False
3 1913.60 1870.37 False
4 1870.37 1825.58 False
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport