Commit
·
f364b27
1
Parent(s):
6a7a69f
change procedure of prediction
Browse files
model.py
CHANGED
@@ -48,13 +48,18 @@ class SmokerModel:
|
|
48 |
X_scaled = self.scale(X)
|
49 |
|
50 |
# Check if the array is 1-dimensional aka one sample
|
51 |
-
if len(X_scaled.shape) != 1:
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
return
|
54 |
|
55 |
# Reshape the array
|
56 |
# X = X.reshape(1, -1)
|
57 |
-
X_scaled = X_scaled.reshape(1, -1)
|
58 |
|
59 |
# # scale the data
|
60 |
# X_scaled = self.scale(X)
|
|
|
48 |
X_scaled = self.scale(X)
|
49 |
|
50 |
# Check if the array is 1-dimensional aka one sample
|
51 |
+
# if len(X_scaled.shape) != 1:
|
52 |
+
# raise ValueError("Input array must be one-dimensional (one sample), but got a shape of {}".format(X.shape))
|
53 |
+
# return
|
54 |
+
|
55 |
+
#check array only has one sample
|
56 |
+
if X.shape[0] != 1:
|
57 |
+
raise ValueError("Input array must contain only one sample, but {} samples were found".format(X.shape[0]))
|
58 |
return
|
59 |
|
60 |
# Reshape the array
|
61 |
# X = X.reshape(1, -1)
|
62 |
+
# X_scaled = X_scaled.reshape(1, -1)
|
63 |
|
64 |
# # scale the data
|
65 |
# X_scaled = self.scale(X)
|