Python Feature Engineering Cookbook by Soledad Galli
Author:Soledad Galli
Language: eng
Format: epub
Tags: COM062000 - COMPUTERS / Data Modeling and Design, COM018000 - COMPUTERS / Data Processing, COM021030 - COMPUTERS / Databases / Data Mining
Publisher: Packt Publishing
Published: 2020-01-21T11:26:50+00:00
boston_dataset = load_boston()
data = pd.DataFrame(boston_dataset.data, columns=boston_dataset.feature_names)
data['MEDV'] = boston_dataset.target
The boundaries for the intervals should be learned using variables in the train set only, and then used to discretize the variables in train and test sets.
Let's divide the data into train and test sets and their targets:
X_train, X_test, y_train, y_test = train_test_split(
data.drop('MEDV', axis=1), data['MEDV'], test_size=0.3,
random_state=0)
We will divide the LSTAT continuous variable into 10 intervals. The width of the intervals is given by the value range divided by the number of intervals.
Let's calculate the range of the LSTAT variable, that is, the difference between its maximum and minimum values:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7857)
Learning SQL by Alan Beaulieu(5414)
Weapons of Math Destruction by Cathy O'Neil(5039)
Big Data Analysis with Python by Ivan Marin(3024)
Blockchain Basics by Daniel Drescher(2893)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2524)
Pandas Cookbook by Theodore Petrou(2503)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(2503)
Mastering Python for Finance by Unknown(2479)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(2477)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(2414)
How The Mind Works by Steven Pinker(2215)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(2194)
Data Engineering with dbt by Roberto Zagni(2074)
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2059)
Driving Data Quality with Data Contracts by Andrew Jones(2056)
Network Science with Python and NetworkX Quick Start Guide by Edward L. Platt(1979)
Python Natural Language Processing by Jalaj Thanaki(1893)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(1857)