discrimintools.eval_predict#
- discrimintools.eval_predict(obj, digits=4, to_markdown=False, tablefmt='github', **kwargs)[source]#
-
Evaluation of the prediction’ quality on training dataset.
- Parameters:
-
obj (class) – an object of class
CANDISC,CPLS,DiCA,DISCRIM,GFALDA,MDA,PLSDAorPLSLDA.digits (int, default = 4) – The number of decimal printed.
to_markdown (bool, default = False) – To print summaries in markdown-friendly format. Requires the tabulate. package.
tablefmt (str, default = “github”) – The table format.
**kwargs – additionals parameters. These parameters will be passed to tabulate.
- Return type:
-
NoneType
See also
summaryCANDISC-
Printing summaries of Canonical Discriminant Analysis model.
summaryCPLS-
Printing summaries of Partial Least Squares for Classification model.
summaryDA-
Printing summaries of Discriminant Analysis model.
summaryDiCA-
Printing summaries of Discriminant Correspondence Analysis model.
summaryDISCRIM-
Printing summaries of Discriminant Analysis (linear and quadratic) model.
summaryGFALDA-
Printing summaries of General Factor Analysis Linear Discriminant Analysis model.
summaryMDA-
Printing summaries of Mixed Discriminant Analysis model.
summaryPLSDA-
Printing summaries of Partial Least Squares Discriminant Analysis model.
summaryPLSLDA-
Printing summaries of Partial Least Squares Linear Discriminant Analysis model.
summarySTEPDISC-
Printing summaries of Stepwise Discriminant Analysis model.
Examples
>>> from discrimintools.datasets import load_heart >>> from discrimintools import DISCRIM, eval_predict >>> D = load_heart() # load training data >>> y, X = D["disease"], D.drop(columns=["disease"]) # split into X and y >>> clf = DISCRIM() >>> clf.fit(X,y) Categorical features have been encoded into binary variables. DISCRIM(priors='prop') >>> eval_predict(clf) Classification Summary for Calibration Data: Observation Profile: Read Used Number of Observations 150 150 Number of Observations Classified into disease: prediction absence presence Total disease absence 75 7 82 presence 12 56 68 Total 87 63 150 Percent Classified into disease: prediction absence presence Total disease absence 91.4634 8.5366 100.0 presence 17.6471 82.3529 100.0 Total 58.0000 42.0000 100.0 Priors 0.5467 0.4533 NaN Error Count Estimates for disease: absence presence Total Rate 0.0854 0.1765 0.1267 Priors 0.5467 0.4533 NaN Classification Report for disease: precision recall f1-score support absence 0.8621 0.9146 0.8876 82.0000 presence 0.8889 0.8235 0.8550 68.0000 accuracy 0.8733 0.8733 0.8733 0.8733 macro avg 0.8755 0.8691 0.8713 150.0000 weighted avg 0.8742 0.8733 0.8728 150.0000