wizard-420 commented on a change in pull request #952: URL: https://github.com/apache/systemml/pull/952#discussion_r436240465
########## File path: dev/docs/builtins-reference.md ########## @@ -318,7 +320,47 @@ slicefinder(X,W, y, k, paq, S); ### Usage ```r X = rand (rows = 50, cols = 10) -y = X %*% rand(rows=ncol(X), 1) +y = X %*% rand(rows = ncol(X), cols = 1) w = lm(X = X, y = y) ress = slicefinder(X = X,W = w, Y = y, k = 5, paq = 1, S = 2); ``` + +## `confusionMatrix`-Function + +A `confusionMatrix` is a technique for summarizing the performance of a classification algorithm. +Calculating a confusion matrix can give you a better idea of what your classification model is getting right and what types of errors it is making. +This confusionMatrix function accepts two matrices with one column each, these two matrices are vector for prediction and one-hot-encoded matrix respectively. +Then it computes the max value of each vector and compare them, after whichit calculates and returns the sum of classifications and the average of each true class. + +### Usage +```r +confusionMatrix(P,Y) +``` + +### Arguments + +| Name | Type | Default | Description | +| :------ | :------------- | :--- | :---------- | +| P | Matrix[Double] | --- |vector of prediction | +| Y | Matrix[Double] | --- | vector of Golden standard One Hot Encoded| + +### Returns + +|Name | Type | Description | +|:-----------------| :------------- | :---------- | +|ConfusionSum | Matrix[Double] | The Confusion Matrix Sums of classifications | +|ConfusionAvg | Matrix[Double] | The Confusion Matrix averages of each true class| + +### Example + #here numClasses is assigned to 1 as numClasses is directly proportional to the + number of columns in the one hot data matrix, as confusion matrix accepts only matrices with one column. Review comment: ok I will make all the neccecary changes ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org