featuretools.primitives.Age#

class featuretools.primitives.Age[source]#

计算给定出生日期的年龄(以浮点数表示的年份).

Description:

年龄以年为单位计算,通过计算出生日期与参考时间之间的天数,然后将结果除以365.

Examples

确定三个人在2019年1月1日的年龄 >>> import pandas as pd >>> reference_date = pd.to_datetime(“01-01-2019”) >>> age = Age() >>> input_ages = [pd.to_datetime(“01-01-2000”), … pd.to_datetime(“05-30-1983”), … pd.to_datetime(“10-17-1997”)] >>> age(input_ages, time=reference_date).tolist() [19.013698630136986, 35.61643835616438, 21.221917808219178]

__init__()#

Methods

__init__()

flatten_nested_input_types(input_types)

将嵌套的列模式输入展平成一个列表.

generate_name(base_feature_names)

generate_names(base_feature_names)

get_args_string()

get_arguments()

get_description(input_column_descriptions[, ...])

get_filepath(filename)

get_function()

Attributes

base_of

base_of_exclude

commutative

default_value

Default value this feature returns if no data found.

description_template

input_types

woodwork.ColumnSchema types of inputs

max_stack_depth

name

Name of the primitive

number_output_features

Number of columns in feature matrix associated with this feature

return_type

ColumnSchema type of return

stack_on

stack_on_exclude

stack_on_self

uses_calc_time

uses_full_dataframe