April 2017
Beginner to intermediate
358 pages
9h 30m
English
In the previous few examples, we saw that changing the features can have quite a large impact on the performance of the algorithm. Through our small amount of testing, we had more than 10 percent variance just from the features.
You can create features that come from a simple function in pandas by doing something like this:
dataset["New Feature"] = feature_creator()
The feature_creator function must return a list of the feature's value for each sample in the dataset. A common pattern is to use the dataset as a parameter:
dataset["New Feature"] = feature_creator(dataset)
You can create those features more directly by setting all the values to a single default value, like 0 in the next line:
dataset["My New Feature"] ...Read now
Unlock full access