フィルターのクリア

Compute the acuarcy or error of the output?

1 回表示 (過去 30 日間)
Salem
Salem 2016 年 4 月 21 日
コメント済み: Greg Heath 2016 年 4 月 24 日
I have two vectors Y and Yprd, each one is 1x602 double. Y contains the real data which represent the class label either one or zero. Yprd contains the prediction of the data which real numbers. Here is an example Y=[0 1 1 1 0] Yprd=[0.456 0.986 -0.008 0.987 0.0002] I would like to compute the accuracy of the model (or error) when at Yprd vector any values greater than 0.5 can be one and less than can zero.
  2 件のコメント
John D'Errico
John D'Errico 2016 年 4 月 21 日
What model? I don't see that you have posed any model at all here. Before you can talk about prediction error, you must have a model.
Salem
Salem 2016 年 4 月 22 日
I used neural network model, I built it myself as I want some specific operations.

サインインしてコメントする。

採用された回答

Roger Stafford
Roger Stafford 2016 年 4 月 22 日
Ymodel = 1*(Y>.5) + 0*(Y<=.5); % The model from the predictions (right half unnecessary)
p = sum(abs(Y-Ymodel))/size(Y,2); % Fractional error
  1 件のコメント
Greg Heath
Greg Heath 2016 年 4 月 24 日
The usual convention for classifiers is to have c-dimensional {0,1} unit vectors for targets and nonnegative c-dimensional unit vectors for outputs
The relationship between the column vectors and the class indices are given by the functions
IND2VEC and VEC2IND
see their help and documentation.
Hope this helps.
Greg

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by