-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathset_extraction_cup.py
More file actions
56 lines (33 loc) · 1.04 KB
/
set_extraction_cup.py
File metadata and controls
56 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""set_extraction_cup.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1vYdkM5Swv3irUE_8ot0udIwrFNOxhIpW
# Libraries
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from sklearn.utils import shuffle
"""# Data Loading
"""
cols = ["ID", "INPUT0", "INPUT1", "INPUT2", "INPUT3", "INPUT4", "INPUT5", "INPUT6", "INPUT7", "INPUT8"]
dtf = pd.read_csv('data/ML-CUP22-TS.csv', skiprows=7, header=None, sep=",", names=cols)
dtf.head(3)
dtf.set_index("ID", inplace=True)
dtf.head(3)
dtf.shape
dtf.info()
dtf.corr()
fig, ax = plt.subplots(figsize=(10,10))
sns.heatmap(dtf.corr(), annot=True)
plt.show()
# data normalization
scaler = StandardScaler()
cols = dtf.columns
dtf = pd.DataFrame(scaler.fit_transform(dtf.values), columns=cols) # now x values are scaled (not targets)
dtf.head(3)
x_test_cup = dtf.values
print("x_test_cup", x_test_cup.shape)