forked from moreo/QuaPy
fixing ifcb and documenting
This commit is contained in:
parent
d4fb8a1930
commit
7705c92c8c
|
@ -17,7 +17,7 @@ Change Log 0.1.8
|
|||
As a result, a method with a param grid of 10 combinations for the classifier and 10 combinations for the
|
||||
quantifier, now implies 10 trainings of the classifier + 10*10 trainings of the aggregation function (this is
|
||||
typically much faster than the classifier training), whereas in versions <0.1.8 this amounted to training
|
||||
10*10 classifiers+aggregations.
|
||||
10*10 (classifiers+aggregations).
|
||||
|
||||
- Added different solvers for ACC and PACC quantifiers. In quapy < 0.1.8 these quantifiers try to solve the system
|
||||
of equations Ax=B exactly (by means of np.linalg.solve). As noted by Mirko Bunse (thanks!), such an exact solution
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import os
|
||||
import pandas as pd
|
||||
import math
|
||||
|
||||
from quapy.data import LabelledCollection
|
||||
from quapy.protocol import AbstractProtocol
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -57,7 +59,7 @@ class IFCBTrainSamplesFromDir(AbstractProtocol):
|
|||
# all columns but the first where we get the class
|
||||
X = s.iloc[:, 1:].to_numpy()
|
||||
y = s.iloc[:, 0].to_numpy()
|
||||
yield X, y
|
||||
yield LabelledCollection(X, y, classes=self.classes)
|
||||
|
||||
def total(self):
|
||||
"""
|
||||
|
|
|
@ -810,16 +810,7 @@ def fetch_IFCB(single_sample_train=True, for_model_selection=False, data_home=No
|
|||
|
||||
# In the case the user wants it, join all the train samples in one LabelledCollection
|
||||
if single_sample_train:
|
||||
X, y = [], []
|
||||
for X_, y_ in train_gen():
|
||||
X.append(X_)
|
||||
y.append(y_)
|
||||
|
||||
X = np.vstack(X)
|
||||
y = np.concatenate(y)
|
||||
train = LabelledCollection(X, y, classes = classes)
|
||||
|
||||
train = LabelledCollection.join(*[lc for lc in train_gen()])
|
||||
return train, test_gen
|
||||
|
||||
else:
|
||||
return train_gen, test_gen
|
||||
|
|
Loading…
Reference in New Issue