A SMILES string encodes a molecular graph as a sequence of atom and bond symbols, with parentheses for branches, matching digits for ring closures and additional symbols for charges and stereochemistry. For example,
CCO
specifies ethanol. A molecule may have several valid SMILES traversals, so the raw character sequence is not itself a unique physical descriptor.
Two numerical encodings are:
These are chemical-structure representations. No biological mechanism is needed to encode the molecules or treat the supplied target as a binary label.
Include an intercept and let be the chosen numerical feature vector. Logistic regression uses
The logistic function maps every real score into , allowing a Bernoulli distribution model for the label. Equivalently, the log odds are linear in the features:
This gives a smooth differentiable probability model with a linear decision boundary at any fixed probability threshold. The sigmoid output is a fitted conditional probability, not a categorical prediction until a threshold is chosen.
For conditionally independent binary labels, the likelihood is
Maximizing it is equivalent to minimizing its negative log-likelihood, the mean binary cross-entropy:
It is the loss implied by a Bernoulli distribution for each target, penalizes confident errors strongly and is convex in the linear-logistic parameters. For numerical stability, each contribution can be evaluated as using a stable softplus implementation.
The 10:90 class imbalance does not invalidate this likelihood. Class weighting or resampling may be useful if errors have unequal costs, but changes the training objective and potentially the interpretation of fitted probabilities. Optional ridge regression adds , usually excluding the intercept, to control overly large weights or complete separation.
Initialize the weights, evaluate the feature matrix and repeat gradient descent updates until the loss or gradient stabilizes. If includes the intercept, then
A positive step size chosen by a convergence rule or line search gives a practical optimization algorithm. Mini-batch updates or a Newton-type method are alternatives. Fit feature scaling, choose regularization and choose any nonstandard threshold using training or validation data, then freeze the procedure before using the held-out test set.
For held-out examples, set , with unless selected otherwise. The requested classification accuracy is
Always predicting the majority class already gives about 90% accuracy. Report a confusion matrix, classification recall and classification precision as well, especially for the minority class. A precision-recall curve shows the threshold tradeoff without confusing high majority-class accuracy with successful minority-class detection. No numerical test accuracy can be calculated without the held-out predictions and labels.

Articles by others on the same topic (0)

There are currently no matching articles.