import numpy as np
VALUE = 'VALUE'
MODE = 'MODE'
UNIQUE = 'UNIQUE'
COMMON = 'COMMON'
NEW_VALUE = 'NEW_VALUE'
TRANSFORMER = 'TRANSFORMER'
MEAN = 'MEAN'
SUM = 'SUM'
MIN = 'MIN'
MAX = 'MAX'
STD = 'STD'
VAR = 'VAR'
SIZE = 'SIZE'
COUNT = 'COUNT'
SELF = 'SELF'
MEDIAN = 'MEDIAN'
SUMMARY = 'SUMMARY'
DTYPE = 'DTYPE'
ROLLING_MEAN = '_ROLLING_MEAN'
ROLLING_STDV = '_ROLLING_STDV'
EQ = '=='
NE = '!='
GT = '>'
LT = '<'
GE = '>='
LE = '<='
ADD = '+'
SUB = '-'
MUL = '*'
POWER = '**'
TRUE_DIV = '/'
FLOOR_DIV = '//'
AND = '&'
OR = '|'
DROP_NA = 'DROP_NA'
FILLNA = 'FILL_NA'
COUNTNA = 'COUNTNA'
NUM_UNIQUE = 'NUM_UNIQUE'
HISTOGRAM = 'HISTOGRAM'
VALUES = 'VALUES'
NON_MISSING_COUNT = 'NON_MISSING_COUNT'
NUM_ZERO = 'NUM_ZERO'
NUM_EMPTY_STRINGS = 'NUM_EMPTY_STRINGS'
VALUE_COUNTS = 'FREQUENT_ITEMS'
NONE_TYPE = type(None)
NONE_STRING = 'NONE'
EXPRESSION = '_EXPRESSION_'
COLUMN = 'COLUMN'
APPLY = 'APPLY'
FILTER = 'FILTER'
SEQUENCE = 'SEQUENCE'
LOGICAL = 'LOGICAL'
ARRAY = 'ARRAY'
CONSTANT = 'CONSTANT'
BOW = '_BAG_OF_WORDS'
COUNT_NGRAM = '_COUNT_NGRAM'
TOKENIZE = '_TOKENIZE'
DROP_WORDS = '_DROP_WORDS'
TRIM_BY_VALUES = '_TRIM_BY_VALUES'
TRIM_BY_KEYS = '_TRIM_BY_KEYS'
PACK = '_PACK'
UNPACK = '_UNPACK'
STACK = '_STACK'
UNSTACK = '_UNSTACK'
FUNCTION = 'FUNCTION'
TRANSFORMER = 'TRANSFORMER'
LOGICAL_COMPARISONS = [EQ, NE, LE, GE, LT, GT]
NUMERIC_COMPARISONS = [ADD, SUB, MUL, POWER, FLOOR_DIV, TRUE_DIV, OR, AND]
COMPARISONS = LOGICAL_COMPARISONS + NUMERIC_COMPARISONS
STATISTICS = [MEAN, SUM, VAR, STD, MIN, MAX, COUNTNA, MODE, COMMON, NEW_VALUE, ROLLING_MEAN, SIZE, NUM_UNIQUE, NUM_ZERO,
              VALUE_COUNTS, NUM_EMPTY_STRINGS]
TRANSFORMERS_OPERATORS = [BOW, COUNT_NGRAM, TRIM_BY_VALUES, TRIM_BY_KEYS, DROP_NA, TOKENIZE, DROP_WORDS]
OPERATORS = COMPARISONS + STATISTICS + TRANSFORMERS_OPERATORS + [UNIQUE]
AUTO = 'auto'
COLLABORATIVE_FILTERING = 'COLLABORATIVE_FILTERING'
MATRIX_FACTORIZATION = 'MATRIX_FACTORIZATION'
RANKING_FACTORIZATION = 'RANKING_FACTORIZATION'
CONTENT_RECOMMENDER = 'CONTENT_RECOMMENDER'
POPULARITY_RECOMMENDER = 'POPULARITY_RECOMMENDER'

RECOMMENDERS = [CONTENT_RECOMMENDER, COLLABORATIVE_FILTERING, MATRIX_FACTORIZATION, RANKING_FACTORIZATION,
                POPULARITY_RECOMMENDER, AUTO]

RECOMMENDATIONS_MODULES = ['user', 'provider', 'product']

# config strings
DATAFRAME_CONFIG_FILENAME = 'dataframe.ini'
PIPELINE = 'pipeline'
DTYPE = 'dtype'
DATAFRAME = 'dataframe'
UID = 'uid'
CHAIN = 'chain'
LOCATION = 'location'
VALUES = 'values'
FEATURES = 'features'
EXPRESSIONS = 'expressions'
NAME = 'name'
STATE = 'state'
INPLACE = 'inplace'
VERBOSE = 'verbose'
OUTPUT_COLUMN = 'output_column'
OPTIONS = 'options'
COLUMNS = 'columns'
STEPS = 'steps'
CLASSIFICATION = 'classification'
REGRESSION = 'regression'
TARGET = 'target'
RANKING = 'ranking'
PARAMS = 'params'
FN = 'fn'
DS = 'ds'
marshal_encoding = 'ISO-8859-1'
MODEL = 'model'
PREFIX = 'prefix'
CACHE = 'cache'
__PROXY__ = '__proxy__'
TRAINING_TIME = 'training_time'
CLASS = 'class'
CLASSIFIR_CLASS = 'class'
CLASSIFIR_PROBABILITIS = 'probability'
CLASSIFIR_MARGIN = 'margin'
CLASSIFIR_VECTOR = 'probability_vector'
TOPK = 'topk'
TOPK_PROBABILITY = 'topk_probability'
TOPK_MARGIN = 'topk_margin'
TOPK_RANK = 'topk_rank'
COLUMNS = 'columns'
VARIABLES = 'variables'
SELECTIONS = 'selections'
STATE = 'state'
SELECTIONS_FILTER = '__filter__'
NOT_IMPLEMENTED_ERROR = 'Not implemented'
OUTPUT_TYPE = 'output_type'
JSON = 'json'
PANDAS = 'pandas'
VAEX = 'vaex'
NUMPY = 'numpy'
VIRTUAL = 'virtual'
EXAMPLE = 'example'
CREATED = 'created'
UPDATED = 'updated'
NO_SELECTIONS = {'__filter__': None}
CONSTANTS = [str, int, float, bool]
LISTS = 'LISTS_'
PACK = 'PACK_'
UNPACK = 'UNPACK_'
DATETIME_DTYPE = np.dtype('<M8[ns]')