Giter Site home page Giter Site logo

springboard-curriculum / featuretools Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 263.0 20.69 MB

Adapted exercise from here: https://github.com/Featuretools/predict-customer-churn/blob/master/churn/3.%20Feature%20Engineering.ipynb

Jupyter Notebook 100.00%

featuretools's Introduction

featuretools's People

Contributors

andrewm4894 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

featuretools's Issues

Have an error when 'run deep feature synthesis'

Hi,

I need help with this exercise. I got an error as below.
AttributeError: Cutoff time DataFrame must contain a column with either the same name as the target entity time_index or a column named "time"

The picture shows where I got this error. And I paste the full error message below the picture. Thank you,
image

Built 881 features
C:\Users\prue1\anaconda3\lib\site-packages\featuretools\synthesis\dfs.py:317: UnusedPrimitiveWarning: Some specified primitives were not used during DFS:
where_primitives: ['any']
This may be caused by a using a value of max_depth that is too small, not setting interesting values, or it may indicate no compatible variable types for the primitive were found in the data.
warnings.warn(warning_msg, UnusedPrimitiveWarning)

AttributeError Traceback (most recent call last)
in
2
3 start = timer()
----> 4 feature_matrix, feature_defs = ft.dfs(entityset=es, target_entity='members',
5 cutoff_time = cutoff_times,
6 agg_primitives = agg_primitives,

~\anaconda3\lib\site-packages\featuretools\utils\entry_point.py in function_wrapper(*args, **kwargs)
38 ep.on_error(error=e,
39 runtime=runtime)
---> 40 raise e
41
42 # send return value

~\anaconda3\lib\site-packages\featuretools\utils\entry_point.py in function_wrapper(*args, **kwargs)
30 # call function
31 start = time.time()
---> 32 return_value = func(*args, **kwargs)
33 runtime = time.time() - start
34 except Exception as e:

~\anaconda3\lib\site-packages\featuretools\synthesis\dfs.py in dfs(entities, relationships, entityset, target_entity, cutoff_time, instance_ids, agg_primitives, trans_primitives, groupby_trans_primitives, allowed_paths, max_depth, ignore_entities, ignore_variables, primitive_options, seed_features, drop_contains, drop_exact, where_primitives, max_features, cutoff_time_in_index, save_progress, features_only, training_window, approximate, chunk_size, n_jobs, dask_kwargs, verbose, return_variable_types, progress_callback, include_cutoff_time)
276 return features
277
--> 278 feature_matrix = calculate_feature_matrix(features,
279 entityset=entityset,
280 cutoff_time=cutoff_time,

~\anaconda3\lib\site-packages\featuretools\computational_backends\calculate_feature_matrix.py in calculate_feature_matrix(features, entityset, cutoff_time, instance_ids, entities, relationships, cutoff_time_in_index, training_window, approximate, save_progress, verbose, chunk_size, n_jobs, dask_kwargs, progress_callback, include_cutoff_time)
158 target_entity = entityset[features[0].entity.id]
159
--> 160 cutoff_time = _validate_cutoff_time(cutoff_time, target_entity)
161
162 if isinstance(cutoff_time, pd.DataFrame):

~\anaconda3\lib\site-packages\featuretools\computational_backends\utils.py in _validate_cutoff_time(cutoff_time, target_entity)
230 if "time" not in cutoff_time.columns:
231 if target_entity.time_index and target_entity.time_index not in cutoff_time.columns:
--> 232 raise AttributeError('Cutoff time DataFrame must contain a column with either the same name'
233 ' as the target entity time_index or a column named "time"')
234 # rename to time

AttributeError: Cutoff time DataFrame must contain a column with either the same name as the target entity time_index or a column named "time"

Featuretools issue

I have some issues related to the exercise in Ch 16.2: "Automated Feature Engineering with Featuretools"
I tried to practice it on the Jupyter notebook but realized that many of the codes in this notebook are not working. I tried but got stuck in the code related to featuretools.primitives and gave up.

Codes:
from featuretools.primitives import make_agg_primitive
from featuretools.primitives import make_trans_primitive

Error messages:
cannot import name 'make_agg_primitive' from 'featuretools.primitives'
cannot import name 'make_trans_primitive' from 'featuretools.primitives'

Feature engineering example

This is a very minor issue with the wording used in the "Domain Knowledge Features" section of the Feature Engineering notebook.

I believe the sentence should indicate there is an anomaly where some memberships expire before the transactions date (instead of after). The following code appears to apply a filter to include only data where memberships expire after the transaction date.

From the notebook:
There is one slight anomaly with the transactions where some membership expire dates are after the transactions date, so we will filter those out.

#Filter anomalies
trans = trans[trans['membership_expire_date'] > trans['transaction_date']]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.