There was an error while loading. Please reload this page.
1 parent 8459c07 commit d440106Copy full SHA for d440106
predicting-house-prices.py
@@ -0,0 +1,32 @@
1
+#predicting-house-prices.py
2
+#Day 6: Multiple Linear Regression: Predicting House Prices
3
+#Intro to Statistics
4
+#By derekhh
5
+#Apr 2, 2016
6
+
7
+from sklearn import linear_model
8
9
+f, n = input().split()
10
+f = int(f)
11
+n = int(n)
12
13
+clf = linear_model.LinearRegression()
14
+x_train = []
15
+y_train = []
16
17
+for i in range(n):
18
+ tmp = [float(n) for n in input().split()]
19
+ x_train.append(tmp[0: len(tmp) - 1])
20
+ y_train.append(tmp[len(tmp) - 1])
21
22
+clf.fit(x_train, y_train)
23
24
+x_test = []
25
+n = int(input())
26
27
28
+ x_test.append(tmp)
29
30
+y_test = clf.predict(x_test)
31
+for y in y_test:
32
+ print(y)
0 commit comments