itemset.h

来自「关联规则挖掘数据产生程序.VISUAL C++ 可产生满足要求的挖掘数据.」· C头文件 代码 · 共 36 行

H
36
字号
// ItemSet.h: interface for the ItemSet class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ITEMSET_H__66C6CF9A_7C6E_4D7F_917C_141AB37E9E67__INCLUDED_)
#define AFX_ITEMSET_H__66C6CF9A_7C6E_4D7F_917C_141AB37E9E67__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Dist.h"
#include "Taxonomy.h"


class ItemSet  
{
private:
  int nitems;		// number of items
  Taxonomy *tax;	// taxonomy (optional)
  float *cum_prob;	// cumulative probability
  float *tax_prob;	// cumulative probability of choosing a child
  UniformDist rand;

  void normalize(float prob[], int low, int high);
public:
  ItemSet(int nitems, Taxonomy *tax = NULL);
  ~ItemSet();
  void display(ofstream &fp);
  int get_item(void);		// returns a random item (weighted)
  int specialize(int itm);	// if no taxonomy, returns itm
  float weight(int itm);	// returns prob. of choosing item
};

#endif // !defined(AFX_ITEMSET_H__66C6CF9A_7C6E_4D7F_917C_141AB37E9E67__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?