How to properly calculate all weights with FSelector package?
<p>I'm trying to calculate weights of a dataset in R by using the FSelector package. The data is taken <a href="https://archive.ics.uci.edu/ml/datasets/ILPD+(Indian+Liver+Patient+Dataset)" rel="nofollow">from this location</a>.</p>

<pre><code>data = read.csv("filepath/Indian Liver Patient Dataset (ILPD).csv")
names(data)&lt;-c("Age","Gender", "TB", "DB", "Alkphos", "Sgpt", "Sgot", "TP", "ALB", "A/G Ratio", "Selector")
library(FSelector)
weights &lt;- gain.ratio(Selector ~., data)
print(weights)
</code></pre>

<p>I can't calculate all of the weights. When I use the <code>gain.ratio</code> function, the <code>Age</code> weight is NaN. When I use <code>chi.squared</code> function instead, both <code>Age</code> and <code>A/G Ratio</code> are zeroes. When I take first 200 elements from <code>data</code> and calculate weights, only five of them are calculated corectly, and other are zeroes or NaN.</p>

<p>I tried deleting wrong elements from data by <code>data &lt;- na.omit(data)</code> but it didn't change the result.</p>

<p>How can I calculate weights correctly?</p>

<p>Below is an example of a weight print.</p>

<pre><code>Age             0.0000000
Gender          0.1304229
TB              0.3281865
DB              0.3238010
Alkphos         0.2965842
Sgpt            0.2734633
Sgot            0.3120432
TP              0.2504747
ALB             0.3051724
A/G Ratio       0.0000000
</code></pre>