-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathml.py
More file actions
69 lines (32 loc) · 1023 Bytes
/
ml.py
File metadata and controls
69 lines (32 loc) · 1023 Bytes
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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
# coding: utf-8
# In[3]:
import matplotlib.pyplot as plt
import pylab as pl
import numpy as np #for matrix ...
import pandas as pd #for reading ...
#get_ipython().run_line_magic('matplotlib', 'inline #this is for nootBook and datas')
# In[31]:
allData = pd.read_csv("C:/Users/ASUS.PIESC/Downloads/FuelConsumption.csv",encoding = "ISO-8859-1",low_memory=False)
allData.head()#take a simple look on file
# In[11]:
allData.describe()
# In[42]:
simpleRow = allData[{'EngineSize','Cylinders','Transmission','Fuel','Smog','CO2'}]
# In[43]:
simpleRow.head(10) #take a simple view of list
# In[22]:
visualTable = allData[['EngineSize','Cylinders','Transmission','Fuel']]
visualTable.hist()
plt.show()
# In[44]:
plt.scatter(simpleRow.EngineSize, simpleRow.Cylinders , color='blue')
plt.xlabel("EngineSize")
plt.ylabel("Cylinders")
plt.show()
# In[45]:
TestPart = np.random.rand(len(allData)) < 0,8
# In[46]:
train = simpleRow[TestPart]
test = simpleRow[~TestPart]
# In[ ]: