sql - ORA-06502: PL/SQL: 数字或值错误: 字符串缓冲区太小: 构建模型时
问题描述
我正在尝试使用 oracle SQL 构建一个朴素的贝叶斯模型。我能够构建、编译和查看分类值的结果,但是,当尝试构建混淆矩阵并查看准确性时,我收到以下错误:
Error report -
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_DATA_MINING", line 2618
ORA-06512: at line 4
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause: An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action: Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.
我用于构建矩阵的代码如下:
DECLARE
v_accuracy NUMBER;
BEGIN
DBMS_DATA_MINING.COMPUTE_CONFUSION_MATRIX (
accuracy => v_accuracy,
apply_result_table_name => 'demo_class_nb_test_results',
target_table_name => 'BankDataTest',
case_id_column_name => 'ID',
target_column_name => 'Y',
confusion_matrix_table_name => 'demo_class_nb_confusion_matrix1',
score_column_name => 'PREDICTED_VALUE',
score_criterion_column_name => 'PROBABILITY',
cost_matrix_table_name => null,
apply_result_schema_name => null,
target_schema_name => null,
cost_matrix_schema_name => null,
score_criterion_type => 'PROBABILITY');
DBMS_OUTPUT.PUT_LINE('**** MODEL ACCURACY ****: ' || ROUND(v_accuracy,4));
END;
有人可以解释为什么我会收到这样的错误吗?
解决方案
我找出了这个错误的原因,这是由于使用的表名的长度confusion_matrix_table_name
太长了。因此,只需减少名称长度即可。
改变:
confusion_matrix_table_name => 'demo_class_nb_confusion_matrix1',
至:
confusion_matrix_table_name => 'nb_confusion_matrix',
推荐阅读
- oracle - 在从不同模式调用过程时如何在 oracle 中查找所有嵌套的依赖对象
- netbeans - Netbeans,添加 Glasfish 服务器“不存在”
- c# - WPF 应用程序在保持理想模式一段时间后进入无响应状态
- python - Python 3.6 - 将不同类型的列表作为输入
- android - 当 flowable 发射时从单个发射
- artifactory - 无法使用 JFrog Artifactory REST API 获取加密密码。
- javascript - Typescript:如何用布尔值或回调函数定义联合类型?
- android - 无法将图像从 ImageView 上传到 Android 中的 FireBase 存储
- cordova-plugins - Branch.io 深层链接在 Cordova 上总是返回空
- validation - Xpages - SSJS 验证,CSJS onComplete