featuretools | open source python library for automated feature | Machine Learning library
kandi X-RAY | featuretools Summary
kandi X-RAY | featuretools Summary
"One of the holy grails of machine learning is to automate more and more of the feature engineering process." ― Pedro Domingos, A Few Useful Things to Know about Machine Learning. Featuretools is a python library for automated feature engineering. See the documentation for more information.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of featuretools
featuretools Key Features
featuretools Examples and Code Snippets
import featuretools as ft
from featuretools.tsfresh import AggAutocorrelation, Mean
entityset = ft.demo.load_mock_customer(return_entityset=True)
agg_primitives = [Mean, AggAutocorrelation(f_agg='mean', maxlag=5)]
feature_matrix, features = ft.dfs(e
from tsfresh.feature_extraction.feature_calculators import agg_autocorrelation
data = list(range(10))
param = [{'f_agg': 'mean', 'maxlag': 5}]
agg_autocorrelation(data, param=param)
[('f_agg_"mean"__maxlag_5', 0.1717171717171717)]
from featuretool
Community Discussions
Trending Discussions on featuretools
QUESTION
I'm writing a notebook using this data from Kaggle. Here's a screenshot of the two tables just to show we have ID columns in both.
Here's my code when trying to set up the Entity Set and add a relationship.
...ANSWER
Answered 2022-Feb-04 at 13:41If you are adding a relationship to an EntitySet
by passing in a Relationship
object, you need to make sure to use the relationship
keyword in your call like this:
QUESTION
Recently I've updated featuretools to v1.0.0 and faced the following issue. I have instances that vary within time and I want to build time dependent features for them. Besides, I want to save some historical characteristics of those instances. So my cutoff time dataset consists of such columns as: time, instance_id and feature1, feature2, ..., target
When I tried to to run dfs, I got the error 'NoneType' object has no attribute 'logical_types'
I have found out that it is caused by the inner function get_ww_types_from_features
It tries to get the column types of cutoff time df, assuming it has woodwork type
...ANSWER
Answered 2021-Oct-29 at 11:35cutoff_times = pd.DataFrame()
cutoff_times['customer_id'] = [1, 2, 3, 1]
cutoff_times['time'] = pd.to_datetime(['2014-1-1 04:00',
'2014-1-1 05:00',
'2014-1-1 06:00',
'2014-1-1 08:00'])
cutoff_times['label'] = [True, True, False, True]
cutoff_times
fm, features = ft.dfs(entityset=es,`enter code here`
target_dataframe_name='customers',
cutoff_time=cutoff_times,
cutoff_time_in_index=True)
fm
QUESTION
I tried to learn featuretools following documentation from featuretools.com.
A error came up: AttributeError: 'EntitySet' object has no attribute 'entity_from_dataframe'
Could you help me? Thank you.
Code:
...ANSWER
Answered 2021-Oct-21 at 17:08The documentation you are using is for an older version of Featuretools. You can find the updated Getting Started documentation that works with Featuretools version 1.0 here: https://featuretools.alteryx.com/en/stable/getting_started/getting_started_index.html
QUESTION
New to feature tools, getting this error while creating entity
...ANSWER
Answered 2021-Oct-20 at 15:07Yes, Featuretools generally expects a one to many relationship between tables in an EntitySet, which is why the child column cannot be the index of its table.
There's not a way to override this in relationship creation, but you can take steps to use a different index column in the child dataframe, allowing order_id
to be the child column of the relationship.
You could create a new index column in prejoin_foodorder
by setting make_index=True
and the index to be some column name that's not in the DataFrame when adding the table to the EntitySet. This will create a new integer column in the DataFrame that ranges from 0 to the length of the dataframe. That column will then be used as the DataFrame's index, leaving order_id
to be used as the child column of a relationship.
QUESTION
I am trying to work with Featuretools to develop an automated feature engineering workflow for the customer churn dataset. The end outcome is a function that takes in a dataset and label times for customers and builds a feature matrix that can be used to train a machine learning model.
As part of this exercise I am trying to execute the below code for plotting a histogram and got "TypeError: import_optional_dependency() got an unexpected keyword argument 'errors' ". Please help resolve this TypeError.
...ANSWER
Answered 2021-Sep-14 at 20:32Try to upgrade pandas
:
QUESTION
I have an imbalanced dataset which has 200 million data from class 0 and 8000 data from class 1. I followed two different approaches to build a model.
- Randomly sample a new dataset which has a ratio of 1:4. Meaning 32000 from class 0 and 8000 from class 1. Then use featuretools to generate features(70 features generated in my case) and split dataset into train and test set with test_size = 0.2 and stratify minority class. Build a model with Random Forest algorithm and predict the test set.
Code:
...ANSWER
Answered 2021-Aug-02 at 16:31I agree the model possibly overfitted and failed to generalize given the new personal id. I suggest passing the labels in with the cutoff times to get a more structured training and testing set. I'll go through a quick example using this data.
QUESTION
I have more than 100,000 rows of training data with timestamps and would like to calculate a feature matrix for new test data, of which there are only 10 rows. Some of the features in the test data will end up aggregating some of the training data. I need the implementation to be fast since this is one step in a real-time inference pipeline.
I can think of two ways this can be implemented:
Concatenating the train and test entity sets and running DFS and then only using the last 10 rows and throwing away the rest. This is very time consuming. Is there a way to calculate a subset of an entity set while using data from the entire entity set?
Using the steps outlined in Calculating Feature Matrix for New Data section on the Featuretools Deployment page. However, as demonstrated below, this doesn't seem to work.
Create all/train/test entity sets:
...ANSWER
Answered 2021-Jul-14 at 14:52You can control which instances you want to generate features for with the cutoff_time
dataframe (or the instance_ids
argument in DFS if the cutoff time is a single datetime). Featuretools will only generate features for instances whose IDs are in the cutoff time dataframe and will ignore all others:
QUESTION
Using Featuretools, I want to convert the value of a certain feature to rank.
This will be the exact question. If anyone can help me, please answer.
First, the following code uses the rank function of pandas and displays the result. I believe this result is correct.
...ANSWER
Answered 2021-Jul-12 at 13:22NEW ANSWER:
Based on your updated code, the problem is arising because you are setting njobs=-1
. When you do this, behind the scenes, Featuretools is distributing the calculation of the feature matrix to multiple workers. In doing so, Featuretools is breaking up the dataframe for calculating the transform feature values among the workers and sending pieces to each worker.
This creates a problem with the Rank
primitive you have defined as this primitive requires all of the data to be present to get a correct answer. For situations like this you need to set uses_full_entity=True
when defining the primitive to force featuretools to include all of the data when the primitive function is called to compute the feature values.
If you update the Rank
primitive definition as follows, you will get the correct answer:
QUESTION
ANSWER
Answered 2021-Feb-10 at 16:47Thanks for the question! You can get those features from the transaction time by setting the target entity to transactions
in DFS. You also want to specify which transform primitives to apply. Let me know if this helps.
QUESTION
As of version v0.12.0, FeatureTools allows you to assign custom names to multi-output primitives: https://github.com/alteryx/featuretools/pull/794. By default, the when you define custom multi-output primitives, the column names for the generated features are appended with a [0]
, [1]
, [2]
, etc. So let us say that I have the following code to output a multi-output primitive:
ANSWER
Answered 2021-Jan-09 at 02:08Thanks for the question! This feature hasn't been documented well.
The main issue with your code was that string_count_generate_name
should return a list of strings, one for each column.
It looks like you were adapting the StringCount
example from the docs -- I think for this primitive it would be less error-prone to always use "sine" and "cosine" for the custom names, and remove the optional string
argument from sine_and_cosine_datestamp
. I also updated the feature name text to match your desired text.
After these changes:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install featuretools
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page