public static DataFrame Projection(this DataFrame dataFrame, FuzzyVariable fuzzyVariable, bool changeColumn = true, double threshold = DefaultThreshold)
        {
            var originalFrame = dataFrame;
            var newFrame      = default(DataFrame);

            foreach (var term in fuzzyVariable.GetTerms())
            {
                var frame = originalFrame.WithColumn(TempColumnName, Functions.When(ProcessCondition(dataFrame[fuzzyVariable.GetName()], fuzzyVariable, term.GetName()) >= threshold, term.GetName()).Otherwise(""));
                newFrame = newFrame != null?newFrame.Union(frame) : frame;
            }

            if (changeColumn)
            {
                var columns = newFrame?.Columns().ToList();
                if (columns != null)
                {
                    columns.Remove(fuzzyVariable.GetName());
                    newFrame = newFrame.Select(columns.Select(c => newFrame[c]).ToArray());
                }
            }

            newFrame = newFrame?.Filter(newFrame[TempColumnName] != "");

            if (changeColumn)
            {
                newFrame = newFrame?.WithColumnRenamed(TempColumnName, fuzzyVariable.GetName());
            }

            return(newFrame);
        }
        public static DataFrame FuzzyJoin(this DataFrame dataFrame, FuzzyVariable fuzzyVariable, DataFrame right, double threshold = DefaultThreshold)
        {
            var left = dataFrame.Projection(fuzzyVariable, threshold: threshold);

            right = right.Projection(fuzzyVariable, threshold: threshold);

            return(left.Join(right, left[fuzzyVariable.GetName()] == right[fuzzyVariable.GetName()]));
        }
        public static DataFrame FuzzySelect(this DataFrame dataFrame, FuzzyVariable fuzzyVariable, string condition, double threshold = DefaultThreshold)
        {
            var temperatureValue = dataFrame[fuzzyVariable.GetName()];

            return(dataFrame.Filter(ProcessCondition(temperatureValue, fuzzyVariable, condition) >= threshold));
        }
        public static DataFrame FuzzyAnd(this DataFrame dataFrame, FuzzyVariable fuzzyVariable, string[] conditions, double threshold = DefaultThreshold)
        {
            var temperatureValue = dataFrame[fuzzyVariable.GetName()];

            return(dataFrame.Filter(GetAndCondition(temperatureValue, fuzzyVariable, conditions) >= threshold));
        }