<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">BCTSCalibration</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">classifier</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_jobs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.BCTSCalibration"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">NBVSCalibration</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">classifier</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_jobs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.NBVSCalibration"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">RecalibratedProbabilisticClassifier</span></span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifier"title="Permalink to this definition">¶</a></dt>
<p>Abstract class for (re)calibration method from <cite>abstention.calibration</cite>, as defined in
<aclass="reference external"href="http://proceedings.mlr.press/v119/alexandari20a.html">Alexandari, A., Kundaje, A., & Shrikumar, A. (2020, November). Maximum likelihood with bias-corrected calibration
is hard-to-beat at label shift adaptation. In International Conference on Machine Learning (pp. 222-232). PMLR.</a>:</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">RecalibratedProbabilisticClassifierBase</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">classifier</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">calibrator</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_jobs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">classes_</span></span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.classes_"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the classes on which the classifier has been trained on</p>
<spanclass="sig-name descname"><spanclass="pre">fit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.fit"title="Permalink to this definition">¶</a></dt>
<dd><p>Fits the calibration for the probabilistic classifier.</p>
<spanclass="sig-name descname"><spanclass="pre">fit_cv</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.fit_cv"title="Permalink to this definition">¶</a></dt>
<dd><p>Fits the calibration in a cross-validation manner, i.e., it generates posterior probabilities for all
training instances via cross-validation, and then retrains the classifier on all training instances.
The posterior probabilities thus generated are used for calibrating the outpus of the classifier.</p>
<spanclass="sig-name descname"><spanclass="pre">fit_tr_val</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.fit_tr_val"title="Permalink to this definition">¶</a></dt>
<dd><p>Fits the calibration in a train/val-split manner, i.e.t, it partitions the training instances into a
training and a validation set, and then uses the training samples to learn classifier which is then used
to generate posterior probabilities for the held-out validation data. These posteriors are used to calibrate
the classifier. The classifier is not retrained on the whole dataset.</p>
<spanclass="sig-name descname"><spanclass="pre">predict</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.predict"title="Permalink to this definition">¶</a></dt>
<dd><p>Predicts class labels for the data instances in <cite>X</cite></p>
<spanclass="sig-name descname"><spanclass="pre">predict_proba</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.RecalibratedProbabilisticClassifierBase.predict_proba"title="Permalink to this definition">¶</a></dt>
<dd><p>Generates posterior probabilities for the data instances in <cite>X</cite></p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">TSCalibration</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">classifier</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_jobs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.TSCalibration"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.calibration.</span></span><spanclass="sig-name descname"><spanclass="pre">VSCalibration</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">classifier</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_jobs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.calibration.VSCalibration"title="Permalink to this definition">¶</a></dt>
<spanid="quapy-classification-methods"></span><h2>quapy.classification.methods<aclass="headerlink"href="#module-quapy.classification.methods"title="Permalink to this heading">¶</a></h2>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.methods.</span></span><spanclass="sig-name descname"><spanclass="pre">LowRankLogisticRegression</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">n_components</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">100</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression"title="Permalink to this definition">¶</a></dt>
<p>An example of a classification method (i.e., an object that implements <cite>fit</cite>, <cite>predict</cite>, and <cite>predict_proba</cite>)
that also generates embedded inputs (i.e., that implements <cite>transform</cite>), as those required for
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">quapy.method.neural.QuaNet</span></code>. This is a mock method to allow for easily instantiating
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">quapy.method.neural.QuaNet</span></code> on array-like real-valued instances.
The transformation consists of applying <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">sklearn.decomposition.TruncatedSVD</span></code>
while classification is performed using <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">sklearn.linear_model.LogisticRegression</span></code> on the low-rank space.</p>
<spanclass="sig-name descname"><spanclass="pre">fit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.fit"title="Permalink to this definition">¶</a></dt>
<dd><p>Fit the model according to the given training data. The fit consists of
<spanclass="sig-name descname"><spanclass="pre">get_params</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.get_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.predict"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict_proba</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.predict_proba"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_params</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.set_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">transform</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.methods.LowRankLogisticRegression.transform"title="Permalink to this definition">¶</a></dt>
<spanid="quapy-classification-neural"></span><h2>quapy.classification.neural<aclass="headerlink"href="#module-quapy.classification.neural"title="Permalink to this heading">¶</a></h2>
<p>An implementation of <aclass="reference internal"href="#quapy.classification.neural.TextClassifierNet"title="quapy.classification.neural.TextClassifierNet"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">quapy.classification.neural.TextClassifierNet</span></code></a> based on
<spanclass="sig-name descname"><spanclass="pre">document_embedding</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">input</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.CNNnet.document_embedding"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_params</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.CNNnet.get_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">training</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="pre">bool</span></em><aclass="headerlink"href="#quapy.classification.neural.CNNnet.training"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">vocabulary_size</span></span><aclass="headerlink"href="#quapy.classification.neural.CNNnet.vocabulary_size"title="Permalink to this definition">¶</a></dt>
<p>An implementation of <aclass="reference internal"href="#quapy.classification.neural.TextClassifierNet"title="quapy.classification.neural.TextClassifierNet"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">quapy.classification.neural.TextClassifierNet</span></code></a> based on
<spanclass="sig-name descname"><spanclass="pre">document_embedding</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">x</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.LSTMnet.document_embedding"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_params</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.LSTMnet.get_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">training</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="pre">bool</span></em><aclass="headerlink"href="#quapy.classification.neural.LSTMnet.training"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">vocabulary_size</span></span><aclass="headerlink"href="#quapy.classification.neural.LSTMnet.vocabulary_size"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">device</span></span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.device"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">fit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instances</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">labels</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">val_split</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0.3</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.fit"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">get_params</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.get_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instances</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.predict"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict_proba</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instances</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.predict_proba"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">reset_net_params</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">vocab_size</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">n_classes</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.reset_net_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_params</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.set_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">transform</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instances</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.NeuralClassifierTrainer.transform"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.neural.</span></span><spanclass="sig-name descname"><spanclass="pre">TextClassifierNet</span></span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">dimensions</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.dimensions"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">abstract</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">document_embedding</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">x</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.document_embedding"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">forward</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">x</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.forward"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">abstract</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">get_params</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.get_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict_proba</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">x</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.predict_proba"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">training</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="pre">bool</span></em><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.training"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">property</span><spanclass="w"></span></em><spanclass="sig-name descname"><spanclass="pre">vocabulary_size</span></span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.vocabulary_size"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">xavier_uniform</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TextClassifierNet.xavier_uniform"title="Permalink to this definition">¶</a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.neural.</span></span><spanclass="sig-name descname"><spanclass="pre">TorchDataset</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">instances</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">labels</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TorchDataset"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">asDataloader</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">batch_size</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">shuffle</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pad_length</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.neural.TorchDataset.asDataloader"title="Permalink to this definition">¶</a></dt>
<spanid="quapy-classification-svmperf"></span><h2>quapy.classification.svmperf<aclass="headerlink"href="#module-quapy.classification.svmperf"title="Permalink to this heading">¶</a></h2>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">quapy.classification.svmperf.</span></span><spanclass="sig-name descname"><spanclass="pre">SVMperf</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">svmperf_base</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">C</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0.01</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">verbose</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">loss</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'01'</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf"title="Permalink to this definition">¶</a></dt>
<p>A wrapper for the <aclass="reference external"href="https://www.cs.cornell.edu/people/tj/svm_light/svm_perf.html">SVM-perf package</a> by Thorsten Joachims.
When using losses for quantification, the source code has to be patched. See
the <aclass="reference external"href="https://hlt-isti.github.io/QuaPy/build/html/Installation.html#svm-perf-with-quantification-oriented-losses">installation documentation</a>
for further details.</p>
<p>References:</p>
<blockquote>
<div><ulclass="simple">
<li><p><aclass="reference external"href="https://dl.acm.org/doi/abs/10.1145/2700406?casa_token=8D2fHsGCVn0AAAAA:ZfThYOvrzWxMGfZYlQW_y8Cagg-o_l6X_PcF09mdETQ4Tu7jK98mxFbGSXp9ZSO14JkUIYuDGFG0">Esuli et al.2015</a></p></li>
<li><p><aclass="reference external"href="https://www.sciencedirect.com/science/article/abs/pii/S003132031400291X">Barranquero et al.2015</a></p></li>
<li><p><strong>svmperf_base</strong>– path to directory containing the binary files <cite>svm_perf_learn</cite> and <cite>svm_perf_classify</cite></p></li>
<li><p><strong>C</strong>– trade-off between training error and margin (default 0.01)</p></li>
<li><p><strong>verbose</strong>– set to True to print svm-perf std outputs</p></li>
<li><p><strong>loss</strong>– the loss to optimize for. Available losses are “01”, “f1”, “kld”, “nkld”, “q”, “qacc”, “qf1”, “qgm”, “mae”, “mrae”.</p></li>
<spanclass="sig-name descname"><spanclass="pre">decision_function</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf.decision_function"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">fit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">y</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf.fit"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">predict</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">X</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf.predict"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">set_params</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">parameters</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf.set_params"title="Permalink to this definition">¶</a></dt>
<spanclass="sig-name descname"><spanclass="pre">valid_losses</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">{'01':</span><spanclass="pre">0,</span><spanclass="pre">'f1':</span><spanclass="pre">1,</span><spanclass="pre">'kld':</span><spanclass="pre">12,</span><spanclass="pre">'mae':</span><spanclass="pre">26,</span><spanclass="pre">'mrae':</span><spanclass="pre">27,</span><spanclass="pre">'nkld':</span><spanclass="pre">13,</span><spanclass="pre">'q':</span><spanclass="pre">22,</span><spanclass="pre">'qacc':</span><spanclass="pre">23,</span><spanclass="pre">'qf1':</span><spanclass="pre">24,</span><spanclass="pre">'qgm':</span><spanclass="pre">25}</span></em><aclass="headerlink"href="#quapy.classification.svmperf.SVMperf.valid_losses"title="Permalink to this definition">¶</a></dt>
<spanid="module-contents"></span><h2>Module contents<aclass="headerlink"href="#module-quapy.classification"title="Permalink to this heading">¶</a></h2>