<p dir="auto">Here is an issue that I came across with Count Vectorizer and its use with Column Transformer and Pipelines</p>
<p dir="auto"><a href="https://stackoverflow.com/questions/54541490/sklearn-text-and-numeric-features-with-columntransformer-has-value-error/57970935#57970935" rel="nofollow">https://stackoverflow.com/questions/54541490/sklearn-text-and-numeric-features-with-columntransformer-has-value-error/57970935#57970935</a></p>
<p dir="auto">I found a work around using by removing the column name to be processed directly instead of just a list.</p>
<p dir="auto">This may be the way that it is intended to function, but if not, a simple bug fix would be just to add a simple line of code to change the list of column names to the content of the list if the length  of the list is one.</p>


<h4 dir="auto">Description</h4>

<h4 dir="auto">Steps/Code to Reproduce</h4>

<h4 dir="auto">Expected Results</h4>

<h4 dir="auto">Actual Results</h4>

<h4 dir="auto">Versions</h4>
<h2 dir="auto">Describe the workflow you want to enable</h2>
<p dir="auto">Let's take a probability-based regression model like <a href="https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html" rel="nofollow"><code class="notranslate">sklearn.linear_model.LogisticRegression</code></a>.<br>
We have two methods to get the predictions:</p>
<ul dir="auto">
<li>predict_proba() outputs a probability for each class</li>
<li>predict() outputs a class (the one with the most important probability)</li>
</ul>
<p dir="auto">I would like to activate the threshold specification scenario so the user can decide the threshold. This scenario is of course not the default one when using LogisticRegression, but may be useful for anomaly/opportunity detection.</p>
<p dir="auto"><strong>Real life example:</strong></p>
<p dir="auto">A user created a LogisticRegression model in order to detect trading opportunities that highly lead to benefits.<br>
There are two possible class: 1 for "opportunity", 0 for "no opportunity".<br>
The user would like to get only best probabilities predictions (&gt; 90%) to create a position on the market.</p>
<h2 dir="auto">Describe your proposed solution</h2>
<p dir="auto">My proposed solution is to add an optionnal parameter <em>threshold</em> (default: 1/NB_CLASSES) to the predict() method.<br>
We could also edit other probability regression models if needed.</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">I would like to work on this feature if possible.</p>
<p dir="auto">I know this is possible to do this kind of things as a post-processing step on the user side.<br>
However, if we provide a predict() method that choose a class, I think we should provide a way to define the threshold to the user.</p>