We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64cb5c3 commit 639ab87Copy full SHA for 639ab87
regression-example-ames-no-preproc.py
@@ -16,6 +16,8 @@
16
17
###
18
19
+LABEL_COLUMN = 'price'
20
+
21
## your data:
22
23
@@ -30,9 +32,11 @@
30
32
31
33
raw_data = pd.read_csv('ames.csv')
34
needed_cols = [
- col for col in raw_data.columns if raw_data[col].dtype != 'object']
35
+ col for col in raw_data.columns
36
+ if raw_data[col].dtype != 'object'
37
+ and col != LABEL_COLUMN]
38
data_numeric = raw_data[needed_cols].fillna(0).astype(float)
-label = raw_data.pop('price')
39
+label = raw_data.pop(LABEL_COLUMN)
40
41
data_np = data_numeric.values
42
0 commit comments