INGOR
Loading...
Searching...
No Matches
ytData.h
1/*
2 util/ytData.{h,c} : Data container
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_DATA_H
10#define __YTLIB_DATA_H
11
12#include <stdlib.h>
13
14#include "lang/ytObject.h"
15#include "ytArray.h"
16#include "ytIntArray.h"
17#include "ytStrArray.h"
18#include "ytKeyValues.h"
19
20#include "math/ytRNG.h"
21
22#ifndef DOXY
23#define ytData_TYPE_REAL 0
24#define ytData_TYPE_ORDINAL 1
25#define ytData_TYPE_CATEGORICAL 2
26#define ytData_TYPE_DISCRETE 3
27#endif /* DOXY */
28
46typedef struct {
47 ytObject obj;
48
50 int n;
51
53 int p;
54
64 double * X;
65
71 double * Y;
72
75
81
86
89
95
98
99} ytData;
100
101ytData * ytData_new();
102void ytData_delete(ytData * this);
103
104const char * ytData_typeName(int type);
105void ytData_summary(const ytData * data, FILE * fp);
106void ytData_varSummary(const ytData * data, FILE * fp);
107void ytData_stat(const ytData * this, FILE * fp, int level);
108int ytData_getType(const ytData * this, int j);
109const char * ytData_getTypeName(const ytData * this, int j);
110int ytData_parseType(const char * name);
111const char * ytData_getName(const ytData * this, int j);
112int ytData_findName(const ytData * this, const char * name);
113int ytData_numSamples(const ytData * this);
114int ytData_numVariables(const ytData * this);
115ytData * ytData_bootstrap(const ytData * this, ytRNG * rng, ytData * data);
116void ytData_dynamic(ytData * this);
117ytData * ytData_dynamic2(const ytData * this, int * T);
118void ytData_print(ytData * this, FILE * fp);
119ytData * ytData_pseudoBootstrap(const ytData * this, ytRNG * rng, int blocks, ytData * data);
120ytData * ytData_pidBootstrap(const ytData * this, ytRNG * rng, int n, int F, ytData * data);
121ytArray * ytData_readPrimaryIDList(const ytData * this, const char * file);
122ytData * ytData_listBootstrap(const ytData * this, ytRNG * rng, int n, ytArray * listSet, int F, ytData * data);
123void ytData_extractRange(const ytData * this, ytKeyValues * kv);
124void ytData_checkRange(const ytData * this, ytDoubleArray * xlar, ytDoubleArray * xrar);
125ytData * ytData_hybrid(ytData * this, int n);
126ytData * ytData_dehybrid(ytData * this, int N);
127ytData * ytData_dbn(ytData * this, int T);
128ytArray * ytData_collectPrimaryId(const ytData * this);
129void ytData_varInfo(const ytData * this, int j, FILE * fp);
130const ytStrArray * ytData_getCategories(const ytData * this, int j);
131void ytData_convertAllToReal(ytData * this);
132void ytData_splitXY(ytData * this);
133ytData * ytData_selectVars(const ytData * this, const ytStrArray * names);
134void ytData_dump(const ytData * this, FILE * fp);
135int ytData_countNAN(const ytData * this);
136int ytData_debug(int argc, char * argv[]);
137
138#ifdef USE_MPI
139void ytData_MPI_Bcast(ytData ** data, int root, MPI_Comm comm);
140#endif /* USE_MPI */
141
142#endif /* __YTLIB_DATA_H */
Expandable array.
Expandable array.
Expandable array.
key-value pairs.
The basis class.
Expandable array.
General data container.
Definition ytData.h:46
int p
The number of variables.
Definition ytData.h:53
double * X
n x p explanatory data matrix.
Definition ytData.h:64
ytKeyValues * varAttrs
attributes for variables.
Definition ytData.h:88
ytIntArray * types
Value types of the variables. The j-th element represents the type ID of the j-th variable....
Definition ytData.h:80
int n
The number of samples.
Definition ytData.h:50
double * Y
n x p target data matrix.
Definition ytData.h:71
ytStrArray * names
Names of variables.
Definition ytData.h:74
ytArray * dict
dictionary for categories. The elements are ytStrArray instances, and the j-th element corresponds to...
Definition ytData.h:94
ytKeyValues * meta
meta data
Definition ytData.h:97
ytKeyValues * sampleAttrs
attributes for samples. The value associated with the key is an array. The type of the array depends ...
Definition ytData.h:85
Structure for encapsulating the random number generator.
Definition ytRNG.h:33