This section will provide an overall model with a modern working internet and an AI-powered automatic classification task of heart failure diseases.
3.2. The Proposed ML Model
The proposed ML model reduces the number of features using heuristics derived from data mining. Even with fewer features, it achieves almost the same accuracy as the other standard models. This has advantages in real-time applications as it can decrease laboratory analysis and device costs. Feature engineering and feature selection have many aspects. Our analysis rates 12 features and the relationship of each feature to the target values independently, replacing conventional methods such as logistic regression feature ranking and statistical tests. Equation (
3) ranks the feature importance for target values independently. First, the values for one feature from the dataset are sorted. Then, we include the target values according to the location of each selected value. For example,
Table 2 presents 20 values of patient ages derived from rows 70 to 90 of the dataset. If the target value equals 0, the patient survived during this period; otherwise, they died.
The ranking involves dividing the sorted feature values into two disjoint intervals and finding the border value by maximizing Equation (
3). The maximum value of Equation (
3) for a single feature is assigned to its weight
. Let
and
denote the number of surviving and deceased patients in the first interval and
and
the number of surviving and deceased patients in the second interval of feature
.
where
,
,
are the minimum, border, and maximum values of the feature after dividing the data into disjoint intervals
,
in accordance. The solution of Equation (
3) lies in the interval
. If it is equal to 1, then the objects of the two classes (surviving and deceased) are located in different intervals. Moreover, the first and second brace expressions in Equation (
3) imply the inner-class similarity and difference respectively. The Algorithm 1 below illustrates the steps for calculating the rank for a given feature.
Algorithm 1 Feature Ranking Algorithm |
Input: x and y ▹x and y- values, labels of input feature Output: w, b ▹ Find max w values of Equation ( 3), and border b , ▹ Initial values of output , , , ▹ Sub. and sup. indicate class and interval while
do ▹ The border moves to right. Increase by 1 ▹ Decrease by 1 2nd interval if then ▹ Ensuring disjointablity of intervals ▹ Calculate the f by given u and K if then ▹ If new border’s rank higher, then reassign , end if end if end while
|
We assume a function criterion exists in Algorithm 1. Given below is an example for this function using the values in
Table 2 based on choosing a probable best decision boundary. The object numbers in
Table 2 are 15 and 5 in two classes in accordance. In the current case, we have a class-imbalance problem. At first glance, the first and second intervals are
and
; refer the second part of the table. After the borders are defined, we can calculate the object numbers of each class in every interval. As denoted above,
,
,
,
are the number of objects in classes and intervals respectively, where the superscripts and subscripts indicate the interval and the class indices, respectively. The similarity and the difference can be computed as
and
, and the overall value of Equation (
3) is
, and the binary accuracy is 65%, which is a little high.
Similar to logistic regression, the presented approach uses a feature border calculated by the Algorithm 1 (a feature with the height rank) as a decision boundary instead of determining the threshold, usually
. It is important to remember that a decision based on a single feature can have adverse effects, especially in medicine. In particular, if a patient has cardiovascular disease, there is a high probability of death after a certain period. Therefore, we include other features based on the ranking given by Equation (
3) and the difficulty of measuring them in real time; for instance, determining a patient’s
age does not call for any additional resources or effort, but
platelets in the blood can be measured only in test laboratories. To end this, we leverage Equation (
4) as linear logistic regression instead of leveraging gradient descent optimization with modification of Equation (
2) is divided into two sums for: quantitative and categorical features separately. Equation (
4) transforms all object feature values into a single value, which can used for further analysis by applying Equation (
3).
where
is the class direction,
is the value of Equation (
3),
,
,
are the minimum, border, and maximum values of feature
after dividing the entire range into disjoint intervals
,
. The class direction is implicit. The easiest way, as introduced in the task of maximizing the value of Equation (
3), is determining
case by case, which is NP-complete [
19,
20]; for example, if there 12 features in the datasets, then the number of total cases will be
. This paper proposes to modify this limitation of the existing method. Let us assume the first-class objects are located in the first interval for each feature. To make this assumption work when the class intervals are misplaced, we set the class direction
and otherwise, we assign 1 to the class direction
. To apply Equation (
4) to the categorical features, we preprocess them using a target encoder with an important modification: the value of each category is replaced with its posterior probability over the classes in Equation (
5) [
14].
We can group the features by using Equation (
4) to obtain a single output for multiple inputs, as in the logistic regression model. After we have the output values of the objects in the training set, we apply Equation (
3) to them to locate the border between two classes. Based on the assumption of the object locations in the intervals, we can write Equation (
6) to predict new patients. We used the same approach for computing metrics using a single feature in
Table 3.