repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
featuretools | featuretools-main/featuretools/primitives/utils.py | import importlib.util
import os
from inspect import getfullargspec, getsource, isclass
from typing import Dict, List
import pandas as pd
from woodwork import list_logical_types, list_semantic_tags, type_system
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import NaturalLanguage
import fe... | 15,059 | 32.318584 | 133 | py |
featuretools | featuretools-main/featuretools/primitives/__init__.py | # flake8: noqa
import inspect
import logging
import traceback
import pkg_resources
from featuretools.primitives.standard import *
from featuretools.primitives.utils import (
get_aggregation_primitives,
get_default_aggregation_primitives,
get_default_transform_primitives,
get_transform_primitives,
... | 2,800 | 30.47191 | 119 | py |
featuretools | featuretools-main/featuretools/primitives/standard/__init__.py | # flake8: noqa
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.primitives.base.transform_primitive_base import TransformPrimitive
from featuretools.primitives.standard.aggregation import *
from featuretools.primitives.standard.transform import *
| 305 | 50 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_true.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable, IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library, import_or_none
dd = import_or_none(... | 1,515 | 28.72549 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/any_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library, import_or_none
dd = import_or_none("dask.dataframe")... | 1,266 | 26.543478 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/is_unique.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable
from featuretools.primitives.base import AggregationPrimitive
class IsUnique(AggregationPrimitive):
"""Determines whether or not a series of discrete is all unique.
Description:
Given a series of discr... | 1,035 | 26.263158 | 68 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Count(AggregationPrimitive):
"""Determines the tot... | 1,207 | 28.463415 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/skew.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Skew(AggregationPrimitive):
"""Computes the extent to which a distribution differs from a normal dist... | 951 | 29.709677 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/min_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Min(AggregationPrimitive):
"""Calculates the smallest value, ignoring `NaN` values.
Examples:
... | 831 | 27.689655 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/median_count.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class MedianCount(AggregationPrimitive):
"""Calculates the number of occurrences of the median value in a list
Args:
ski... | 1,396 | 29.369565 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/average_count_per_unique.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double
from featuretools.primitives.base import AggregationPrimitive
class AverageCountPerUnique(AggregationPrimitive):
"""Determines the average count across all unique value.
Args:
skipna (bool): Determines if to us... | 1,740 | 32.480769 | 83 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/first_last_time_delta.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base import AggregationPrimitive
class FirstLastTimeDelta(AggregationPrimitive):
"""Determines the time between the first and last time value
in seconds.
... | 1,250 | 31.921053 | 85 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_false_since_last_true.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class NumFalseSinceLastTrue(AggregationPrimitive):
"""Calculates the number of 'False' values since the last `True` value.
... | 1,585 | 36.761905 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_last_min.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base import AggregationPrimitive
class TimeSinceLastMin(AggregationPrimitive):
"""Calculates the time since the minimum value occurred.
Desc... | 1,969 | 32.965517 | 78 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_last.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils import convert_time_units
from featuretools.utils.gen_utils import Library
class TimeSinceLast(Aggregati... | 2,198 | 36.913793 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_last_max.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base import AggregationPrimitive
class TimeSinceLastMax(AggregationPrimitive):
"""Calculates the time since the maximum value occurred.
Desc... | 1,969 | 32.965517 | 78 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_unique.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library, import_or_none
dd = import_or_none("dask.dataframe")
class... | 1,737 | 28.965517 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/mean.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Mean(AggregationPrimitive):
"""Computes the average for a list of values.
Args:
skipna (b... | 1,313 | 26.375 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_outside_range.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountOutsideRange(AggregationPrimitive):
"""Determines the number of values that fall outside a cert... | 1,598 | 32.3125 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_consecutive_true.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, Integer
from featuretools.primitives.base import AggregationPrimitive
class MaxConsecutiveTrue(AggregationPrimitive):
"""Determines the maximum number of consecutive True values in the input
Examples:
>>> max... | 1,759 | 41.926829 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_consecutive_greater_mean.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class NumConsecutiveGreaterMean(AggregationPrimitive):
"""Determines the length of the longest subsequence above the mean.
Descr... | 2,828 | 34.810127 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_unique_days.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueDays(AggregationPrimitive):
"""Determines the number of unique days.
Description:
Given a list of datetimes, return the numb... | 1,188 | 30.289474 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/percent_unique.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double
from featuretools.primitives.base import AggregationPrimitive
class PercentUnique(AggregationPrimitive):
"""Determines the percent of unique values.
Description:
Given a list of values, determine what percent o... | 1,392 | 28.638298 | 78 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_inside_range.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountInsideRange(AggregationPrimitive):
"""Determines the number of values that fall within a certai... | 1,650 | 32.693878 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/all_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library, import_or_none
dd = import_or_none("dask.dataframe")... | 1,261 | 26.434783 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_unique_weeks.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueWeeks(AggregationPrimitive):
"""Determines the number of unique weeks.
Description:
Given a list of datetimes, return the nu... | 1,284 | 31.125 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/avg_time_between.py | from datetime import datetime
import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils import convert_time_units
from featu... | 2,754 | 35.25 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_inside_nth_std.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountInsideNthSTD(AggregationPrimitive):
"""Determines the count of observations that lie inside
the... | 1,132 | 28.051282 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/min_count.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class MinCount(AggregationPrimitive):
"""Calculates the number of occurrences of the min value in a list
Args:
skipna (b... | 1,328 | 29.204545 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/is_monotonically_increasing.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable
from featuretools.primitives.base import AggregationPrimitive
class IsMonotonicallyIncreasing(AggregationPrimitive):
"""Determines if a series is monotonically increasing.
Description:
Given a list of ... | 1,008 | 30.53125 | 69 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/mode.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Mode(AggregationPrimitive):
"""Determines the most commonly repeated value.
Description:
... | 882 | 26.59375 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/first.py | from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class First(AggregationPrimitive):
"""Determines the first value in a list.
Examples:
>>> first = First()
... | 664 | 23.62963 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/kurtosis.py | from scipy.stats import kurtosis
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, Integer
from featuretools.primitives.base import AggregationPrimitive
class Kurtosis(AggregationPrimitive):
"""Calculates the kurtosis for a list of numbers
Args:
fisher (bool)... | 2,570 | 32.828947 | 84 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_consecutive_false.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, Integer
from featuretools.primitives.base import AggregationPrimitive
class MaxConsecutiveFalse(AggregationPrimitive):
"""Determines the maximum number of consecutive False values in the input
Examples:
>>> m... | 1,907 | 43.372093 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_zero_crossings.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base import AggregationPrimitive
class NumZeroCrossings(AggregationPrimitive):
"""Determines the number of times a list crosses 0.
Description:
Given a list of nu... | 1,166 | 33.323529 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/date_first_event.py | from pandas import NaT
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime
from featuretools.primitives.base import AggregationPrimitive
class DateFirstEvent(AggregationPrimitive):
"""Determines the first datetime from a list of datetimes.
Examples:
>>> from d... | 1,043 | 28.828571 | 85 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_below_mean.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountBelowMean(AggregationPrimitive):
"""Determines the number of values that are below the mean.
... | 1,265 | 28.44186 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_first.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils import convert_time_units
from featuretools.utils.gen_utils import Library
class TimeSinceFirst(Aggregat... | 2,195 | 36.862069 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_most_common_frequency.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical
from featuretools.primitives.base import AggregationPrimitive
class NMostCommonFrequency(AggregationPrimitive):
"""Determines the frequency of the n most common items.
Args:
... | 2,361 | 33.735294 | 89 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_outside_nth_std.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountOutsideNthSTD(AggregationPrimitive):
"""Determines the number of observations that lie outside
... | 1,128 | 27.948718 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/percent_true.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable, Double
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library, import_or_none
dd = import_or_none("dask.dataframe")
class Pe... | 2,090 | 31.671875 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_consecutive_zeros.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, Integer
from featuretools.primitives.base import AggregationPrimitive
class MaxConsecutiveZeros(AggregationPrimitive):
"""Determines the maximum number of consecutive zero values in the input
Args:
skipna (boo... | 2,379 | 38.666667 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_min_delta.py | from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base import AggregationPrimitive
class MaxMinDelta(AggregationPrimitive):
"""Determines the difference between the max and min value.
Args:
skipna (bool): Determines if to use NA/null values.
Defaults to True to... | 1,126 | 26.487805 | 63 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/std.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Std(AggregationPrimitive):
"""Computes the dispersion relative to the mean value, ignoring `NaN`.
... | 868 | 28.965517 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_greater_than.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountGreaterThan(AggregationPrimitive):
"""Determines the number of values greater than a controllable threshold.
Args:
... | 1,030 | 29.323529 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_consecutive_positives.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, Integer
from featuretools.primitives.base import AggregationPrimitive
class MaxConsecutivePositives(AggregationPrimitive):
"""Determines the maximum number of consecutive positive values in the input
Args:
ski... | 2,447 | 39.8 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_above_mean.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountAboveMean(AggregationPrimitive):
"""Calculates the number of values that are above the mean.
... | 1,264 | 28.418605 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_consecutive_negatives.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, Integer
from featuretools.primitives.base import AggregationPrimitive
class MaxConsecutiveNegatives(AggregationPrimitive):
"""Determines the maximum number of consecutive negative values in the input
Args:
ski... | 2,451 | 39.866667 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/is_monotonically_decreasing.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable
from featuretools.primitives.base import AggregationPrimitive
class IsMonotonicallyDecreasing(AggregationPrimitive):
"""Determines if a series is monotonically decreasing.
Description:
Given a list of ... | 1,008 | 30.53125 | 69 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_last_true.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable, Datetime, Double
from featuretools.primitives.base import AggregationPrimitive
class TimeSinceLastTrue(AggregationPrimitive):
"""Calculates the time since the last `... | 2,207 | 34.047619 | 82 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_consecutive_less_mean.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class NumConsecutiveLessMean(AggregationPrimitive):
"""Determines the length of the longest subsequence below the mean.
Descript... | 2,799 | 34.443038 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_true_since_last_false.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, IntegerNullable
from featuretools.primitives.base import AggregationPrimitive
class NumTrueSinceLastFalse(AggregationPrimitive):
"""Calculates the number of 'True' values since the last `False` value.
... | 1,453 | 36.282051 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/last.py | from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Last(AggregationPrimitive):
"""Determines the last value in a list.
Examples:
>>> last = Last()
>>> ... | 656 | 23.333333 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_count.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base import AggregationPrimitive
class MaxCount(AggregationPrimitive):
"""Calculates the number of occurrences of the max value in a list
Args:
skipna (bool): Determines if to use NA/null values. Defaults... | 1,247 | 28.023256 | 71 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/__init__.py | from featuretools.primitives.standard.aggregation.all_primitive import All
from featuretools.primitives.standard.aggregation.any_primitive import Any
from featuretools.primitives.standard.aggregation.avg_time_between import AvgTimeBetween
from featuretools.primitives.standard.aggregation.average_count_per_unique import... | 5,915 | 48.3 | 89 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/variance.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double
from featuretools.primitives.base import AggregationPrimitive
class Variance(AggregationPrimitive):
"""Calculates the variance of a list of numbers.
Description:
Given a list of numbers, retu... | 1,007 | 26.243243 | 78 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/median.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Median(AggregationPrimitive):
"""Determines the middlemost number in a list of values.
Examples:... | 768 | 25.517241 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_unique_months.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueMonths(AggregationPrimitive):
"""Determines the number of unique months.
Description:
Given a list of datetimes, return the ... | 1,262 | 31.384615 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/max_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Max(AggregationPrimitive):
"""Calculates the highest value, ignoring `NaN` values.
Examples:
... | 830 | 27.655172 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/num_peaks.py | import pandas as pd
from scipy.signal import find_peaks
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base import AggregationPrimitive
class NumPeaks(AggregationPrimitive):
"""Determines the number of peaks in a list of numbers.
Descr... | 1,032 | 27.694444 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/trend.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils import calculate_trend
from featuretools.utils.gen_utils import Library
class Trend(Aggregat... | 1,445 | 32.627907 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/entropy.py | from scipy import stats
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class Entropy(AggregationPrimitive):
"""Calculates the entropy for a categorical column
Descriptio... | 1,527 | 31.510638 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_unique_days_of_calendar_year.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueDaysOfCalendarYear(AggregationPrimitive):
"""Determines the number of unique calendar days.
Description:
Given a list of dat... | 1,275 | 33.486486 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_most_common.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.utils.gen_utils import Library
class NMostCommon(AggregationPrimitive):
"""Determines the `n` most common elements.
Description:
... | 1,761 | 31.62963 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/count_less_than.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Integer
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
class CountLessThan(AggregationPrimitive):
"""Determines the number of values less than a controllable threshold.
Args:
... | 1,005 | 28.588235 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/time_since_last_false.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable, Datetime, Double
from featuretools.primitives.base import AggregationPrimitive
class TimeSinceLastFalse(AggregationPrimitive):
"""Calculates the time since the last ... | 2,223 | 34.301587 | 83 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/n_unique_days_of_month.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Integer
from featuretools.primitives.base import AggregationPrimitive
class NUniqueDaysOfMonth(AggregationPrimitive):
"""Determines the number of unique days of month.
Description:
Given a list of datetimes,... | 1,290 | 32.102564 | 79 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/sum_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base.aggregation_primitive_base import AggregationPrimitive
from featuretools.primitives.standard.aggregation.count import Count
from featuretools.utils.gen_utils import Library
class Sum(AggregationPrimitive):
"""Cal... | 943 | 28.5 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/aggregation/has_no_duplicates.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable
from featuretools.primitives.base import AggregationPrimitive
class HasNoDuplicates(AggregationPrimitive):
"""Determines if there are duplicates in the input.
Args:
skipna (bool): Determines if to use ... | 1,498 | 26.759259 | 68 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/absolute_diff.py | from woodwork.column_schema import ColumnSchema
from featuretools.primitives.base import TransformPrimitive
class AbsoluteDiff(TransformPrimitive):
"""Calculates the absolute difference from the previous element
in a list of numbers.
Description:
The absolute difference from the previous elem... | 2,599 | 35.619718 | 81 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/not_primitive.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean, BooleanNullable
from featuretools.primitives.base import TransformPrimitive
from featuretools.utils.gen_utils import Library
class Not(TransformPrimitive):
"""Negates a boolean value.
Examples:
... | 917 | 27.6875 | 65 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/savgol_filter.py | from math import floor
import numpy as np
from scipy.signal import savgol_coeffs, savgol_filter
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double
from featuretools.primitives.base import TransformPrimitive
class SavgolFilter(TransformPrimitive):
"""Applies a Savitzky-Gola... | 5,532 | 37.423611 | 99 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/file_extension.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Filepath
from featuretools.primitives.base import TransformPrimitive
class FileExtension(TransformPrimitive):
"""Determines the extension of a filepath.
Description:
Given a list of filepaths, return the extension
... | 919 | 28.677419 | 81 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/full_name_to_first_name.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical, PersonFullName
from featuretools.primitives.base import TransformPrimitive
class FullNameToFirstName(TransformPrimitive):
"""Determines the first name from a person's name.
Description:
... | 2,179 | 40.132075 | 84 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/is_null.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean
from featuretools.primitives.base import TransformPrimitive
from featuretools.utils.gen_utils import Library
class IsNull(TransformPrimitive):
"""Determines if a value is null.
Examples:
>>> is_null = IsNull()... | 738 | 25.392857 | 65 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/percent_change.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double
from featuretools.primitives.base import TransformPrimitive
class PercentChange(TransformPrimitive):
"""Determines the percent difference between values in a list.
Description:
Given a list of numbers, return t... | 4,377 | 39.537037 | 94 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/full_name_to_title.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical, PersonFullName
from featuretools.primitives.base import TransformPrimitive
class FullNameToTitle(TransformPrimitive):
"""Determines the title from a person's name.
Description:
Given a list of names, dete... | 1,132 | 33.333333 | 84 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/full_name_to_last_name.py | import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical, PersonFullName
from featuretools.primitives.base import TransformPrimitive
class FullNameToLastName(TransformPrimitive):
"""Determines the first name from a person's name.
Description:
... | 1,803 | 37.382979 | 103 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/nth_week_of_month.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Datetime, Double
from featuretools.primitives.base import TransformPrimitive
class NthWeekOfMonth(TransformPrimitive):
"""Determines the nth week of the month from a given date.
Descript... | 1,697 | 35.12766 | 88 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/__init__.py | # flake8: noqa
from featuretools.primitives.standard.transform.absolute_diff import AbsoluteDiff
from featuretools.primitives.standard.transform.binary import *
from featuretools.primitives.standard.transform.cumulative import *
from featuretools.primitives.standard.transform.datetime import *
from featuretools.primiti... | 1,685 | 55.2 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/is_in.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean
from featuretools.primitives.base import TransformPrimitive
from featuretools.utils.gen_utils import Library
class IsIn(TransformPrimitive):
"""Determines whether a value is present in a provided list.
Examples:
... | 1,322 | 31.268293 | 82 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/longitude.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import LatLong
from featuretools.primitives.base import TransformPrimitive
class Longitude(TransformPrimitive):
"""Returns the second tuple value in a list of LatLong tuples.
For use with the LatLong logical typ... | 895 | 27.903226 | 66 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/is_in_geobox.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import BooleanNullable, LatLong
from featuretools.primitives.base import TransformPrimitive
class IsInGeoBox(TransformPrimitive):
"""Determines if coordinates are inside a box defined by two
corner coordinate point... | 1,722 | 35.659574 | 85 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/utils.py | import numpy as np
def _haversine_calculate(lat_1s, lon_1s, lat_2s, lon_2s, unit):
# https://stackoverflow.com/a/29546836/2512385
lon1, lat1, lon2, lat2 = map(np.radians, [lon_1s, lat_1s, lon_2s, lat_2s])
dlon = lon2 - lon1
dlat = lat2 - lat1
a = np.sin(dlat / 2.0) ** 2 + np.cos(lat1) * np.cos(lat... | 518 | 33.6 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/haversine.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import LatLong
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.latlong.utils import (
_haversine_calculate,
)
class Haversine(TransformPrimitive):
"""Calc... | 2,530 | 32.302632 | 86 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/geomidpoint.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import LatLong
from featuretools.primitives.base import TransformPrimitive
class GeoMidpoint(TransformPrimitive):
"""Determines the geographic center of two coordinates.
Examples:
>>> geomidpoint = GeoMidp... | 1,211 | 30.076923 | 76 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/latitude.py | import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import LatLong
from featuretools.primitives.base import TransformPrimitive
class Latitude(TransformPrimitive):
"""Returns the first tuple value in a list of LatLong tuples.
For use with the LatLong logical type.... | 881 | 27.451613 | 65 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/__init__.py | from featuretools.primitives.standard.transform.latlong.cityblock_distance import (
CityblockDistance,
)
from featuretools.primitives.standard.transform.latlong.geomidpoint import GeoMidpoint
from featuretools.primitives.standard.transform.latlong.haversine import Haversine
from featuretools.primitives.standard.tra... | 530 | 58 | 86 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/latlong/cityblock_distance.py | import numpy as np
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, LatLong
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.latlong.utils import (
_haversine_calculate,
)
class CityblockDista... | 2,452 | 34.550725 | 86 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/number_of_hashtags.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.standard.transform.natural_language.count_string import (
CountString,
)
class NumberOfHashtags(CountString):
"""Determines the number of hashtags in a string.
... | 1,750 | 38.795455 | 137 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/total_word_length.py | from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.natural_language.constants import (
PUNCTUATION_AND_WHITESPACE,
)
class TotalWordLength(T... | 1,486 | 32.795455 | 91 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/number_of_unique_words.py | from string import punctuation
from typing import Iterable
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.natural_languag... | 2,223 | 33.215385 | 102 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/upper_case_count.py | # -*- coding: utf-8 -*-
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.standard.transform.natural_language.count_string import (
CountString,
)
class UpperCaseCount(CountString):
"""Calculates the number of uppe... | 1,152 | 31.942857 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/upper_case_word_count.py | import re
from string import punctuation
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.natural_language.constants import... | 1,539 | 30.428571 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/constants.py | from string import punctuation
DELIMITERS = "[ \n\t]"
PUNCTUATION_AND_WHITESPACE = f"[{punctuation}\n\t ]"
common_words_1000 = frozenset(
[
"the",
"of",
"to",
"and",
"a",
"in",
"is",
"it",
"you",
"that",
"he",
"was",
... | 17,039 | 15.871287 | 52 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/whitespace_count.py | from featuretools.primitives.standard.transform.natural_language.count_string import (
CountString,
)
class WhitespaceCount(CountString):
"""Calculates number of whitespaces in a string.
Description:
Given a list of strings, determine the whitespaces in each string
If a string is missing,... | 644 | 24.8 | 86 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/number_of_common_words.py | from string import punctuation
from typing import Iterable
import pandas as pd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.natural_languag... | 2,663 | 35.493151 | 113 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/count_string.py | import re
import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
class CountString(TransformPrimitive):
"""Determines how many times a given string shows up in a text field... | 4,705 | 42.574074 | 92 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/title_word_count.py | # -*- coding: utf-8 -*-
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.standard.transform.natural_language.count_string import (
CountString,
)
class TitleWordCount(CountString):
"""Determines the number of titl... | 1,180 | 31.805556 | 87 | py |
featuretools | featuretools-main/featuretools/primitives/standard/transform/natural_language/median_word_length.py | from numpy import median
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Double, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
from featuretools.primitives.standard.transform.natural_language.constants import (
DELIMITERS,
)
class MedianWordLength(... | 1,664 | 32.3 | 91 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.