📄 adaboost_common.h
字号:
#if !defined(AFX_TEST_H__B678A414_54CC_480B_8068_4FAEED66F002__INCLUDED_)
#define AFX_TEST_H__B678A414_54CC_480B_8068_4FAEED66F002__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/* # define MICROSOFT */
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <float.h>
#include "matrix.h"
#include "randomForest.h"
#define VERSION "V1.0"
#define VERSION_DATE "11.5.03"
#define CFLOAT float /* the type of float to use for caching */
/* kernel evaluations. Using float saves */
/* us some memory, but you can use double, too */
#define FNUM long /* the type used for storing feature ids */
#define FVAL float /* the type used for storing feature values */
#define LINEAR 0 /* linear kernel type */
#define POLY 1 /* polynoial kernel type */
typedef struct word
{
FNUM wnum;
FVAL weight;
} SVM_WORD;
typedef struct doc
{
long docnum;
double twonorm_sq;
SVM_WORD *words;
} DOC;
typedef struct adaboost_parm
{
} ADABBOST_PARM;
typedef struct adaboostResults
{
//long sv_num;
//long at_upper_bound;
//double b;
DOC **supvec;
//double *alpha;
//long *index; /* index from docnum to position in model */
long totwords; /* number of features */
long totdoc; /* number of training documents */
//KERNEL_PARM kernel_parm; /* kernel */
/* the following values are not written to file */
//double loo_error,loo_recall,loo_precision; /* leave-one-out estimates */
//double xa_error,xa_recall,xa_precision; /* xi/alpha estimates */
//double *lin_weights; /* weights for linear case using folding */
} RESULTS;
afx_msg void OnPaint ();
int randomForest_weakLearner(Matrix*,int,int,int,Matrix*,Matrix*,Matrix*, Matrix*,long,long,long,long,int,int,int,Matrix*,Matrix*,int train_array[],int label_train_array[],int test_array[],int label_test_array[],int);
int read_documents(char *, DOC *, long *, long, long, long *, long *);
int read_train_file(char *,long,long,long, Matrix*,Matrix*);
int read_test_file(char *,long,long,long,Matrix*,Matrix*);
int adaBoost(Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,long,long,long,long,int,int,Matrix*,int train_array[],int label_train_array[],int test_array[],int label_test_array[],double,int,int,int,int,int);
int weakLearner(Matrix*, Matrix*,Matrix*,Matrix*, Matrix,long,long, int, int*, int*,int,int,double);
int getError(Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,Matrix*,long, long,int,int,int);
int parse_dataset(char *, long *, long *, long);
int parse_document(char *, DOC *, long *, long *, long);
int nol_ll(char *file,long *nol,long *wol,long *ll);
long get_runtime();
void *my_malloc(long);
void copyright_notice();
void SetInitParam();
int isnan(double);
void printe(char* str);
void printm(char* str);
#endif // !defined(AFX_TEST_H__B678A414_54CC_480B_8068_4FAEED66F002__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -