Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMoreo authored Sep 17, 2024
1 parent da6bb62 commit a1af311
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@ The following script fetches a dataset of tweets, trains, applies, and evaluates

```python
import quapy as qp
from sklearn.linear_model import LogisticRegression

dataset = qp.datasets.fetch_twitter('semeval16')
dataset = qp.datasets.fetch_UCIBinaryDataset("yeast")
training, test = dataset.train_test

# create an "Adjusted Classify & Count" quantifier
model = qp.method.aggregative.ACC(LogisticRegression())
model.fit(dataset.training)
model = qp.method.aggregative.ACC()
model.fit(training)

estim_prevalence = model.quantify(dataset.test.instances)
true_prevalence = dataset.test.prevalence()
estim_prevalence = model.quantify(test.X)
true_prevalence = test.prevalence()

error = qp.error.mae(true_prevalence, estim_prevalence)

print(f'Mean Absolute Error (MAE)={error:.3f}')
```

Expand Down

0 comments on commit a1af311

Please sign in to comment.