GROWTH函数预算出未来3个月的产品销售量

 

 

GROWTH函数说明:

根据现有的数据预测指数增长值。根据现有的 x 值和 y 值,GROWTH 函数返回一组新的 x 值对应的 y 值。可以使用 GROWTH 工作表函数来拟合满足现有 x 值和 y 值的指数曲线。

语法

GROWTH(known_y's, [known_x's], [new_x's], [const])
  • Known_y's  必需。满足指数回归拟合曲线 y=b*m^x 的一组已知的 y 值。
    • 如果数组 known_y's 在单独一列中,则 known_x's 的每一列被视为一个独立的变量。
    • 如果数组 known_y's 在单独一行中,则 known_x's 的每一行被视为一个独立的变量。
    • 如果 known_y*s 中的任何数为零或为负数,GROWTH 函数将返回错误值 #NUM!。
  • Known_x's  可选。满足指数回归拟合曲线 y=b*m^x 的一组已知的可选 x 值。
    • 数组 known_x's 可以包含一组或多组变量。如果仅使用一个变量,那么只要 known_x's 和 known_y's 具有相同的维数,则它们可以是任何形状的区域。如果用到多个变量,则 known_y's 必须为向量(即必须为一行或一列)。
    • 如果省略 known_x's,则假设该数组为 {1,2,3,...},其大小与 known_y's 相同。
  • New_x's  可选。需要通过 GROWTH 函数为其返回对应 y 值的一组新 x 值。
    • New_x's 与 known_x's 一样,对每个自变量必须包括单独的一列(或一行)。因此,如果 known_y's 是单列的,known_x's 和 new_x's 应该有同样的列数。如果 known_y's 是单行的,known_x's 和 new_x's 应该有同样的行数。
    • 如果省略 new_x's,则假设它和 known_x's 相同。
    • 如果 known_x's 与 new_x's 都被省略,则假设它们为数组 {1,2,3,...},其大小与 known_y's 相同。
  • Const  可选。一逻辑值,用于指定是否将常量 b 强制设为 1。
    • 如果 const 为 TRUE 或省略,b 将按正常计算。
    • 如果 const 为 FALSE,b 将设为 1,m 值将被调整以满足 y = m^x。

说明

  • 对于返回结果为数组的公式,在选定正确的单元格个数后,必须以数组公式的形式输入。
  • 当为参数(如 known_x's)输入数组常量时,应当使用逗号分隔同一行中的数据,用分号分隔不同行中的数据。
### MLXTEND FP-Growth Function Usage and Documentation The `mlxtend` library provides various tools for data science tasks including frequent pattern mining through its implementation of the FP-Growth algorithm. Below is detailed information on how one can use this functionality within mlxtend. #### Installation To begin working with the FP-Growth function provided by `mlxtend`, ensure that the package has been installed properly: ```bash pip install mlxtend ``` #### Importing Necessary Modules Import statements bring necessary components into your Python environment so they may be utilized effectively during coding sessions or projects involving transactional datasets where finding associations between items might prove beneficial. ```python from mlxtend.preprocessing import TransactionEncoder from mlxtend.frequent_patterns import fpgrowth, association_rules import pandas as pd ``` #### Preparing Data Data preparation involves converting raw input lists containing transactions (sets of item occurrences) into a binary format suitable for analysis via algorithms like FP-Growth which require such structured inputs. ```python dataset = [['Milk', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'], ['Dill', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'], ['Milk', 'Apple', 'Kidney Beans', 'Eggs'], ['Milk', 'Unicorn', 'Corn', 'Kidney Beans', 'Yogurt'], ['Corn', 'Onion', 'Onion', 'Kidney Beans', 'Ice cream', 'Eggs']] te = TransactionEncoder() te_ary = te.fit(dataset).transform(dataset) df = pd.DataFrame(te_ary, columns=te.columns_) print(df.head()) ``` This snippet transforms the dataset into a DataFrame representation ready for further processing steps. #### Applying FP-Growth Algorithm With prepared data at hand, invoking the actual FP-Growth method becomes straightforward; specifying parameters allows customization according to specific requirements regarding minimum support thresholds etc., ensuring results align closely enough with research objectives or business needs. ```python frequent_itemsets = fpgrowth(df, min_support=0.6, use_colnames=True) print(frequent_itemsets) ``` Here, setting `min_support=0.6` filters out less common combinations while retaining those appearing frequently across multiple records – adjusting this value impacts both computational efficiency and output comprehensiveness significantly depending upon context-specific constraints faced when conducting analyses similar in nature. #### Generating Association Rules After obtaining sets of commonly co-occurring elements, deriving actionable insights often entails generating rules linking antecedents towards consequent outcomes based off discovered patterns present throughout examined collections of entities under consideration here represented numerically inside matrices processed earlier. ```python rules = association_rules(frequent_itemsets, metric="lift", min_threshold=1.2) print(rules[['antecedents', 'consequents', 'support', 'confidence', 'lift']]) ``` By employing metrics such as lift alongside confidence levels exceeding predefined limits set forth previously (`min_threshold=1.2`), meaningful relationships emerge highlighting potential correlations worthy exploring deeper beyond surface-level observations alone possible otherwise without leveraging these advanced techniques offered freely thanks largely due contributions made available open source communities surrounding libraries like `mlxtend`.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值