|
|
@ -204,13 +204,13 @@ more aggressive, this precision may be lowered.</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 id="evaluating-component-performance">Evaluating component performance</h2>
|
|
|
|
<h2 id="evaluating-component-performance">Evaluating component performance</h2>
|
|
|
|
<p>MIPLearn allows solver components to be modified, trained and evaluated in isolation. In the following example, we build and
|
|
|
|
<p>MIPLearn allows solver components to be modified, trained and evaluated in isolation. In the following example, we build and
|
|
|
|
fit <code>PrimalSolutionComponent</code> outside a solver, then evaluate its performance.</p>
|
|
|
|
fit <code>PrimalSolutionComponent</code> outside the solver, then evaluate its performance.</p>
|
|
|
|
<pre><code class="python">from miplearn import PrimalSolutionComponent
|
|
|
|
<pre><code class="python">from miplearn import PrimalSolutionComponent
|
|
|
|
|
|
|
|
|
|
|
|
# User-provided set os solved training instances
|
|
|
|
# User-provided set of previously-solved instances
|
|
|
|
train_instances = [...]
|
|
|
|
train_instances = [...]
|
|
|
|
|
|
|
|
|
|
|
|
# Construct and fit component on a subset of the training set
|
|
|
|
# Construct and fit component on a subset of training instances
|
|
|
|
comp = PrimalSolutionComponent()
|
|
|
|
comp = PrimalSolutionComponent()
|
|
|
|
comp.fit(train_instances[:100])
|
|
|
|
comp.fit(train_instances[:100])
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +247,8 @@ False negative (%) 29.720000
|
|
|
|
dtype: float64
|
|
|
|
dtype: float64
|
|
|
|
</code></pre>
|
|
|
|
</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Regression components (such as <code>ObjectiveValueComponent</code>) can also be used similarly, as shown in the next example:</p>
|
|
|
|
<p>Regression components (such as <code>ObjectiveValueComponent</code>) can also be trained and evaluated similarly,
|
|
|
|
|
|
|
|
as the next example shows:</p>
|
|
|
|
<pre><code class="python">from miplearn import ObjectiveValueComponent
|
|
|
|
<pre><code class="python">from miplearn import ObjectiveValueComponent
|
|
|
|
comp = ObjectiveValueComponent()
|
|
|
|
comp = ObjectiveValueComponent()
|
|
|
|
comp.fit(train_instances[:100])
|
|
|
|
comp.fit(train_instances[:100])
|
|
|
|