-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path18_multivariateplot.py
More file actions
46 lines (43 loc) · 1.7 KB
/
Copy path18_multivariateplot.py
File metadata and controls
46 lines (43 loc) · 1.7 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
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import parallel_coordinates
import plotly
import plotly.graph_objs as go
import numpy as np
df = pd.read_csv("14_input_data.csv")
parallel_coordinates(df, 'SalePrice')
plt.savefig('ParallelCoordinates.jpg')
desc_data = df.describe()
desc_data.to_csv('./metrics.csv')
data = [
go.Parcoords(
line = dict(colorscale = 'Jet',
showscale = True,
reversescale = True,
cmin = -4000,
cmax = -100),
dimensions = list([
dict(range = [1,10],
label = 'OverallQual', values = df['OverallQual']),
dict(range = [0,6110],
label = 'TotalBsmtSF', values = df['TotalBsmtSF']),
dict(tickvals = [334,4692],
label = '1stFlrSF', values = df['1stFlrSF']),
dict(range = [334,5642],
label = 'GrLivArea', values = df['GrLivArea']),
dict(range = [0,3],
label = 'FullBath', values = df['FullBath']),
dict(range = [2,14],
label = 'TotRmsAbvGrd', values = df['TotRmsAbvGrd']),
dict(range = [0,3],
label = 'Fireplaces', values = df['Fireplaces']),
dict(range = [0,4],
label = 'GarageCars', values = df['GarageCars']),
dict(range = [0,1418],
label = 'GarageArea', values = df['GarageArea']),
dict(range = [34900,555000],
label = 'SalePrice', values = df['SalePrice'])
])
)
]
plotly.offline.plot(data, filename = './parallel_coordinates_plot.html', auto_open= True)