Created 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
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 read-only "../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))
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
/kaggle/input/quant/__results__.html
/kaggle/input/quant/__notebook__.ipynb
/kaggle/input/quant/__output__.json
/kaggle/input/quant/df_mi
/kaggle/input/quant/df_scale_finale
/kaggle/input/quant/custom.css
/kaggle/input/quant/__results___files/__results___8_0.png
/kaggle/input/quant/__results___files/__results___55_1.png
/kaggle/input/quant/__results___files/__results___11_0.png
/kaggle/input/quant/__results___files/__results___39_0.png
/kaggle/input/quant/__results___files/__results___40_0.png
/kaggle/input/quant/__results___files/__results___62_3.png
/kaggle/input/quant/__results___files/__results___53_1.png
/kaggle/input/quant/__results___files/__results___10_0.png
/kaggle/input/quant/__results___files/__results___51_1.png
/kaggle/input/quant/__results___files/__results___62_2.png
/kaggle/input/quant/__results___files/__results___62_1.png
/kaggle/input/quant/__results___files/__results___49_1.png
/kaggle/input/quant/__results___files/__results___5_0.png
/kaggle/input/quant/__results___files/__results___12_0.png
/kaggle/input/quant/__results___files/__results___57_1.png
/kaggle/input/quant/__results___files/__results___38_0.png
/kaggle/input/quant/__results___files/__results___42_0.png
/kaggle/input/quant/__results___files/__results___7_0.png
/kaggle/input/quant/__results___files/__results___6_0.png
/kaggle/input/quant/__results___files/__results___13_0.png
/kaggle/input/quant/__results___files/__results___73_0.png
/kaggle/input/quant/__results___files/__results___45_1.png
/kaggle/input/quant-ori/Quantmetry.csv
#file ="../input/quant/df_mi"
file ="../input/quant/df_scale_finale"
df = pd.read_csv(file)
df.head()
import numpy as np
import pandas as pd
import warnings
## Plotting libraries
import seaborn as sns
import matplotlib.pyplot as plt
## Sklearn Libraries
from sklearn.utils import shuffle
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import cross_val_score
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import make_scorer
from sklearn.metrics import f1_score, confusion_matrix, roc_curve, auc, \
classification_report, recall_score, precision_recall_curve
# Define random state
random_state = 2018
np.random.seed(random_state)
warnings.filterwarnings('ignore')
# latex parameter
font = {
'family': 'serif',
'serif': ['Computer Modern Roman'],
'weight' : 'regular',
'size' : 14
}
plt.rc('font', **font)