learn_sampset_boxT_learn_sampset_boxLearnSampsetBoxLearnSampsetBoxlearn_sampset_box (算子)
名称
learn_sampset_boxT_learn_sampset_boxLearnSampsetBoxLearnSampsetBoxlearn_sampset_box — 用一个数据集训练分类器。
警告
learn_sampset_boxlearn_sampset_boxLearnSampsetBoxLearnSampsetBoxLearnSampsetBoxlearn_sampset_box 已过时,仅出于向后兼容性考虑而保留。新应用程序应使用 MLP、SVM、KNN 或 GMM 算子替代。
签名
void LearnSampsetBox(const HTuple& ClassifHandle, const HTuple& SampKey, const HTuple& Outfile, const HTuple& NSamples, const HTuple& StopError, const HTuple& ErrorN)
void HFeatureSet::LearnSampsetBox(const HClassBox& ClassifHandle, const HString& Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
void HFeatureSet::LearnSampsetBox(const HClassBox& ClassifHandle, const char* Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
void HFeatureSet::LearnSampsetBox(const HClassBox& ClassifHandle, const wchar_t* Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
(
Windows only)
void HClassBox::LearnSampsetBox(const HFeatureSet& SampKey, const HString& Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
void HClassBox::LearnSampsetBox(const HFeatureSet& SampKey, const char* Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
void HClassBox::LearnSampsetBox(const HFeatureSet& SampKey, const wchar_t* Outfile, Hlong NSamples, double StopError, Hlong ErrorN) const
(
Windows only)
static void HOperatorSet.LearnSampsetBox(HTuple classifHandle, HTuple sampKey, HTuple outfile, HTuple NSamples, HTuple stopError, HTuple errorN)
void HFeatureSet.LearnSampsetBox(HClassBox classifHandle, string outfile, int NSamples, double stopError, int errorN)
void HClassBox.LearnSampsetBox(HFeatureSet sampKey, string outfile, int NSamples, double stopError, int errorN)
描述
learn_sampset_boxlearn_sampset_boxLearnSampsetBoxLearnSampsetBoxLearnSampsetBoxlearn_sampset_box trains the classifier with data for the
key SampKeySampKeySampKeySampKeysampKeysamp_key (see read_sampsetread_sampsetReadSampsetReadSampsetReadSampsetread_sampset). The training sequence
is terminated at least after NSamplesNSamplesNSamplesNSamplesNSamplesnsamples examples.
If NSamplesNSamplesNSamplesNSamplesNSamplesnsamples is bigger than the number of examples in
SampKeySampKeySampKeySampKeysampKeysamp_key, then a cyclic start at the beginning occurs.
If the error underpasses the value StopErrorStopErrorStopErrorStopErrorstopErrorstop_error, then the training
sequence is prematurely terminated. StopErrorStopErrorStopErrorStopErrorstopErrorstop_error is calculated with
N / ErrorN. Whereby N means the number of examples which were wrong
classified during the last ErrorNErrorNErrorNErrorNerrorNerror_n training examples.
Typically ErrorNErrorNErrorNErrorNerrorNerror_n is the number of examples in SampKeySampKeySampKeySampKeysampKeysamp_key
and NSamplesNSamplesNSamplesNSamplesNSamplesnsamples is a multiple of it.
If you want a data set with 100 examples to run 5 times at most and if you
want it to terminate with an error lower than 5%, then the corresponding
values are NSamplesNSamplesNSamplesNSamplesNSamplesnsamples = 500, ErrorNErrorNErrorNErrorNerrorNerror_n = 100 and
StopErrorStopErrorStopErrorStopErrorstopErrorstop_error = 0.05.
A protocol of the training activity is going to be written in file
OutfileOutfileOutfileOutfileoutfileoutfile。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
此算子修改后续输入参数的状态:
在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。
参数
ClassifHandleClassifHandleClassifHandleClassifHandleclassifHandleclassif_handle (输入控制,状态被修改) class_box → HClassBox, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the classifier.
SampKeySampKeySampKeySampKeysampKeysamp_key (输入控制) feature_set → HFeatureSet, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Number of the data set to train.
OutfileOutfileOutfileOutfileoutfileoutfile (输入控制) filename.write → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of the protocol file.
默认值:
'training_prot'
"training_prot"
"training_prot"
"training_prot"
"training_prot"
"training_prot"
NSamplesNSamplesNSamplesNSamplesNSamplesnsamples (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of arrays of attributes to learn.
默认值:
500
StopErrorStopErrorStopErrorStopErrorstopErrorstop_error (输入控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Classification error for termination.
默认值:
0.05
ErrorNErrorNErrorNErrorNerrorNerror_n (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Error during the assignment.
默认值:
100
结果
learn_sampset_boxlearn_sampset_boxLearnSampsetBoxLearnSampsetBoxLearnSampsetBoxlearn_sampset_box 返回 2 ( H_MSG_TRUE )。
An exception is raised if key SampKeySampKeySampKeySampKeysampKeysamp_key does not exist
or there are problems while opening the file.
可能的前趋
create_class_boxcreate_class_boxCreateClassBoxCreateClassBoxCreateClassBoxcreate_class_box
可能的后继
test_sampset_boxtest_sampset_boxTestSampsetBoxTestSampsetBoxTestSampsetBoxtest_sampset_box,
enquire_class_boxenquire_class_boxEnquireClassBoxEnquireClassBoxEnquireClassBoxenquire_class_box,
write_class_boxwrite_class_boxWriteClassBoxWriteClassBoxWriteClassBoxwrite_class_box,
close_class_boxclose_class_boxCloseClassBoxCloseClassBoxCloseClassBoxclose_class_box,
clear_sampsetclear_sampsetClearSampsetClearSampsetClearSampsetclear_sampset
另见
test_sampset_boxtest_sampset_boxTestSampsetBoxTestSampsetBoxTestSampsetBoxtest_sampset_box,
enquire_class_boxenquire_class_boxEnquireClassBoxEnquireClassBoxEnquireClassBoxenquire_class_box,
learn_class_boxlearn_class_boxLearnClassBoxLearnClassBoxLearnClassBoxlearn_class_box,
read_sampsetread_sampsetReadSampsetReadSampsetReadSampsetread_sampset
模块
基础