The goal of a machine learning binary classification problem is to predict the value of a variable that can have just two possible values. For example, you might want to predict the sex of a person (male or female) based on age, State of residence, income, and political leaning.
There are approximately a dozen binary classification techniques. One of the most basic of these techniques is logistic regression.
Note that in machine learning, the term “regression” almost always means predicting a single numeric value. For example, a linear regression problem might predict the age of a person based on their sex, income and so on. However, in spite of its name, logistic regression is a binary classification technique, not a regression technique. Logistic regression is named as it is because it does predict a single numeric value, but that value is a pseudo-probability and it is immediately used to predict the target binary value.
I implemented a demo using the C# language. The goal is to predict the sex of a person (M = 0, F = 1) from age, State, income, politics. The output of the demo is:
Begin C# logistic regression with Newton-Raphson training Predict sex (male=0) from age, State, income, politics Loading people train (200) and test (40) data Done First three train X: 0.2400 1.00 0.00 0.00 0.2950 0.00 0.00 1.00 0.3900 0.00 0.00 1.00 0.5120 0.00 1.00 0.00 0.6300 0.00 1.00 0.00 0.7580 1.00 0.00 0.00 First three train y: 1.0000 0.0000 1.0000 Creating Logistic Regression model Done Start Newton-Raphson train epoch = 0 MSE = 0.1274 maxChange = 38.79083383 epoch = 2 MSE = 0.1144 maxChange = 14.82042518 epoch = 4 MSE = 0.1145 maxChange = 0.40245176 epoch = 6 MSE = 0.1145 maxChange = 0.00000177 Converged at epoch 8 with maxChange = 0.00000000 Done Weights/coefficients: 81.471 1.859 1.890 0.269 -80.778 3.927 1.161 -1.070 Bias/intercept: 4.0187 Evaluating model Accuracy train = 0.8450 Accuracy test = 0.7250 MSE train = 0.1145 MSE test = 0.1305 Confusion matrix: actual 0 | 17 9 | 0.6538 actual 1 | 2 12 | 0.8571 ---------- predicted: 0 1 | 0.7250 Predicting 39 Oklahoma $52,000 moderate Predicted pseudo-prob = 0.00831523 Predicted sex = M End demo
The first line of training data is a person who is 24 years old, lives in Michigan, has an income of $29,500.00, and is a political liberal. Numeric predictor variables (age and income) are normalized so that they are between 0 and 1. Categorical predictor variables (State and political leaning) are converted into numeric vectors using a technique called one-hot encoding.
There are three main techniques to train a logistic regression model: stochastic gradient descent (SGD), L-BFGS, and Newton-Raphson. The demo uses Newton-Raphson. All three of the main training techniques are iterative. The demo monitors the model mean squared error (MSE) and the largest change in model weights, and terminates training when the largest change is less than 1.0e-6, which for the demo data is after 8 iterations.
The form of a logistic regression prediction model is:
z = (w0 * x0) + (w1 * x1) + . . + b
p = 1 / (1 + exp(-z))
The xi are are values of the predictors (often called “features” in machine learning terminology). The wi are weights, or coefficients, which are just constants like 3.19 or -0.52. The b is an additional standalone constant called the bias, or intercept. The intermediate z value is used to compute a pseudo-probability p-value. The exp() function is Euler’s number (approximately 2.71828) raised to a power.
The p-value will always be between 0.0 and 1.0. If p is less than 0.5 then the predicted value is the label that has been encoded as 0. If p is greater than or equal to 0.5 then the predicted value is the label that has been encoded as 1. Put another way, the p-value is the probability of class = 0. It is possible to use a different threshold value than 0.5 but this is rare.
The demo Train() method computes an m-by-m square matrix called the Hessian, where m is the number of predictor values plus one (for the model bias). For the demo data, there are 8 predictor values after normalization and encoding so the Hessian is 9-by-9. There is a different Hessian matrix for each epoch (a complete pass through all training items).
It is possible to explicitly compute the inverse of the conditioned Hessian matrix. But a more computationally efficient approach is to compute the inverse implicitly using a technique called Cholesky decomposition with back-substitution and forward-substitution solve. This is the approach used by the demo program.

I love fantasy movies that feature stop-motion special effects. For example, “Jason and the Argonauts” (1963) thrilled me when I first saw it as a young teenager at the Fox Fullerton theater. And “The 7th Voyage of Sinbad” (1958) is another film that made a huge impression on me. Both movies had brilliant special effects by Ray Harryhausen.
There are a surpriing number of little-known fantasy movies with stop-motion effects.
Left: In “Magic Island” (1995), a 13-year old boy is magically transported to an island with pirates, mermaids, and treasure guarded by a huge stone statue that is reminiscent of Talos in “Jason”. This film has very low ratings, but I enjoyed its sincerity. My grade = B-.
Right: “The Legend of Hillbilly John” (1972) is one strange, strange fantasy. There are several sequences that are only loosely tied together via narration. In one sequence, Hillbilly John battles the “Ugly Bird”. I usually like strange movies but this one didn’t work too well for me. My grade = C-.
Demo program. Replace “lt” (less than), “gt”, “lte”, “gte” with Boolean operator symbols. (My blog editor chokes on symbols).
using System;
using System.IO;
using System.Collections.Generic;
namespace LogisticRegressionPeopleNR
{
internal class LogisticRegressionNRProgram
{
static void Main(string[] args)
{
Console.WriteLine("\nBegin C# logistic regression" +
" with Newton-Raphson training ");
// sex age State income politics
// 1, 0.24, 1,0,0, 0.2950, 0,0,1
// 0, 0.39, 0,0,1, 0.5120, 0,1,0
// 0 1 2 3 4 5 6 7 8
//
// predict sex from age State income politics
Console.WriteLine("Predict sex (male=0) from age," +
" State, income, politics ");
// 1. load data
Console.WriteLine("\nLoading people train" +
" (200) and test (40) data");
string trainFile =
"..\\..\\..\\Data\\people_train_200.txt";
int[] colsX = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
double[][] trainX =
MatLoad(trainFile, colsX, ',', "#");
double[] trainY =
MatToVec(MatLoad(trainFile,
new int[] { 0 }, ',', "#"));
string testFile =
"..\\..\\..\\Data\\people_test_40.txt";
double[][] testX =
MatLoad(testFile, colsX, ',', "#");
double[] testY =
MatToVec(MatLoad(testFile,
new int[] { 0 }, ',', "#"));
Console.WriteLine("Done ");
Console.WriteLine("\nFirst three train X: ");
for (int i = 0; i "lt" 3; ++i)
VecShow(trainX[i], 4, 8);
Console.WriteLine("\nFirst three train y: ");
for (int i = 0; i "lt" 3; ++i)
Console.WriteLine(trainY[i].ToString("F4").
PadLeft(8));
// 2. create and train model
Console.WriteLine("\nCreating Logistic " +
"Regression model ");
LogisticRegression model =
new LogisticRegression();
Console.WriteLine("Done ");
Console.WriteLine("\nStart Newton-Raphson train ");
model.Train(trainX, trainY); // Cholesky + solve
Console.WriteLine("Done ");
// 3.show model parameters
Console.WriteLine("\nWeights/coefficients: ");
for (int i = 0; i "lt" model.weights.Length; ++i)
Console.Write(model.weights[i].ToString("F4") + " ");
Console.WriteLine("\nBias/intercept: " +
model.bias.ToString("F4"));
// 4. evaluate model
Console.WriteLine("\nEvaluating model ");
double accTrain = model.Accuracy(trainX, trainY);
Console.WriteLine("\nAccuracy train = " +
accTrain.ToString("F4"));
double accTest = model.Accuracy(testX, testY);
Console.WriteLine("Accuracy test = " +
accTest.ToString("F4"));
double mseTrain = model.MSE(trainX, trainY);
Console.WriteLine("\nMSE train = " +
mseTrain.ToString("F4"));
double mseTest = model.MSE(testX, testY);
Console.WriteLine("MSE test = " +
mseTest.ToString("F4"));
// 5. confusion matrix
Console.WriteLine("\nConfusion matrix: ");
int[][] cm = model.ConfusionMatrix(testX, testY);
model.ShowConfusion(cm);
// 6. use model
Console.WriteLine("\nPredicting 39 Oklahoma" +
" $52,000 moderate ");
double[] x =
new double[] { 0.39, 0, 0, 1, 0.52000, 0, 1, 0 };
double pp = model.ComputeP(x);
Console.WriteLine("Predicted pseudo-prob = " +
pp.ToString("F8"));
int py = model.Predict(x);
Console.WriteLine("Predicted sex = " +
((py == 0) ? "M" : "F"));
// another way:
// string[] labels = new string[] { "M", "F" };
// int py = model.Predict(x);
// Console.WriteLine("Predicted sex = " + labels[py]);
// TODO: save model weights to text file
// TODO: precision, recall, F1 score
// see:
// jamesmccaffreyblog.com/2026/11/16/computing-
// precision-recall-and-f1-score-for-a-binary-
// classification-model-using-csharp/
Console.WriteLine("\nEnd demo ");
Console.ReadLine();
} // Main
// ------------------------------------------------------
// helpers for Main()
// ------------------------------------------------------
static double[][] MatLoad(string fn, int[] usecols,
char sep, string comment)
{
List"lt"double[]"gt" result =
new List"lt"double[]"gt"();
string line = "";
FileStream ifs = new FileStream(fn, FileMode.Open);
StreamReader sr = new StreamReader(ifs);
while ((line = sr.ReadLine()) != null)
{
if (line.StartsWith(comment) == true)
continue;
string[] tokens = line.Split(sep);
List"lt"double"gt" lst = new List"lt"double"gt"();
for (int j = 0; j "lt" usecols.Length; ++j)
lst.Add(double.Parse(tokens[usecols[j]]));
double[] row = lst.ToArray();
result.Add(row);
}
sr.Close(); ifs.Close();
return result.ToArray();
}
static double[] MatToVec(double[][] M)
{
int nRows = M.Length;
int nCols = M[0].Length;
double[] result = new double[nRows * nCols];
int k = 0;
for (int i = 0; i "lt" nRows; ++i)
for (int j = 0; j "lt" nCols; ++j)
result[k++] = M[i][j];
return result;
}
static void VecShow(double[] vec, int dec, int wid)
{
for (int i = 0; i "lt" vec.Length; ++i)
Console.Write(vec[i].ToString("F" + dec).
PadLeft(wid));
Console.WriteLine("");
}
// ------------------------------------------------------
static void PrecisionRecall(dynamic model,
double[][] dataX, double[] dataY)
{
// compute and display precision, recall, F1
// for a binary classifer
// assumes a Predict() method for model
// A false positive occurs when the model predicts
// the positive class (1), but the true actual label
// is the negative class (0) -- Wikipedia
int TP = 0; // correctly predicted as positive (1)
int TN = 0;
int FP = 0; // falsely predicted as positive (1)
int FN = 0;
int n = dataX.Length;
for (int i = 0; i "lt" n; ++i)
{
double[] x = dataX[i];
double actY = (int)(dataY[i]);
int predY = model.Predict(x);
if (actY == 0 && predY == 0)
++TN;
else if (actY == 1 && predY == 1)
++TP;
else if (actY == 0 && predY == 1)
++FP;
else if (actY == 1 && predY == 0)
++FN;
}
double precision = (TP * 1.0) / (TP + FP);
double recall = (TP * 1.0) / (TP + FN);
double F1 = 2.0 * (precision * recall) /
(precision + recall);
// double F1 = (2.0 * TP) /
// ((2 * TP) + FP + FN);
// double F1 = 1.0 /
// (((1.0 / precision) + (1.0 / recall)) / 2.0);
Console.WriteLine("precision = " +
precision.ToString("F4"));
Console.WriteLine("recall = " +
recall.ToString("F4"));
Console.WriteLine("F1 score = " +
F1.ToString("F4"));
}
// ------------------------------------------------------
} // class Program
// ========================================================
public class LogisticRegression
{
public double[] weights;
public double bias;
private Random rnd; // not used with Newton-Raphson
public LogisticRegression(int seed = 0)
{
this.weights = new double[0]; // compiler happy
this.bias = 0.0;
this.rnd = new Random(seed);
}
// ------------------------------------------------------
public int Predict(double[] x)
{
double p = ComputeP(x);
if (p "lt" 0.5)
return 0;
else
return 1;
}
// ------------------------------------------------------
public double ComputeP(double[] x)
{
double z = 0.0;
for (int i = 0; i "lt" x.Length; ++i)
z += this.weights[i] * x[i];
z += this.bias;
double p = this.Sigmoid(z);
return p;
}
// ------------------------------------------------------
public double Sigmoid(double z)
{
if (z "lt" -6.0)
return 0.0;
else if (z "gt" 6.0)
return 1.0;
else
return 1.0 / (1.0 + Math.Exp(-z));
}
// ------------------------------------------------------
public void Train(double[][] trainX, double[] trainY)
{
// Newton-Raphson technique, with early exit
// Cholesky decomp and solve via back-substitution
// and forward-substitution.
// initialize weights and bias
int dim = trainX[0].Length;
int n = trainX.Length;
int m = dim + 1; // include bias as final parameter
this.weights = new double[dim];
this.bias = 0.0;
int maxEpochs = trainX.Length; // heuristic
double tolerance = 1.0e-6; // assume normalized data
// Newton-Raphson iterations
for (int epoch = 0; epoch "lt" maxEpochs; ++epoch)
{
// gradient and Hessian
double[] grad = new double[m];
double[][] H = new double[m][]; // mxm usually small
for (int i = 0; i "lt" m; ++i)
H[i] = new double[m];
// accumulate gradient and Hessian
for (int i = 0; i "lt" n; ++i)
{
double[] x = trainX[i];
double y = trainY[i];
double p = this.ComputeP(x);
double error = p - y;
double v = p * (1.0 - p);
// include bias as a final feature
double[] xBias = new double[m];
for (int j = 0; j "lt" dim; ++j)
xBias[j] = x[j];
xBias[dim] = 1.0;
// gradient
for (int j = 0; j "lt" m; ++j)
grad[j] += error * xBias[j];
// Hessian
for (int j = 0; j "lt" m; ++j)
for (int k = 0; k "lt" m; ++k)
H[j][k] += v * xBias[j] * xBias[k];
}
// average gradient and Hessian
for (int j = 0; j "lt" m; ++j)
{
grad[j] /= n;
for (int k = 0; k "lt" m; ++k)
H[j][k] /= n;
}
// small diagonal for numerical stability
// similar to, but not regularization
for (int j = 0; j "lt" m; ++j)
H[j][j] += 1.0e-8;
// Cholesky decomposition: H = L * L^T
double[][] L = new double[m][];
for (int i = 0; i "lt" m; ++i)
L[i] = new double[m];
for (int i = 0; i "lt" m; ++i)
{
for (int j = 0; j "lte" i; ++j)
{
double sum = H[i][j];
for (int k = 0; k "lt" j; ++k)
sum -= L[i][k] * L[j][k];
if (i == j)
L[i][j] = Math.Sqrt(sum);
else
L[i][j] = sum / L[j][j];
}
}
// solve L * z = -gradient
// forward substitution
double[] z = new double[m];
for (int i = 0; i "lt" m; ++i)
{
double sum = -grad[i];
for (int j = 0; j "lt" i; ++j)
sum -= L[i][j] * z[j];
z[i] = sum / L[i][i];
}
// solve L^T * delta = z
// back substitution
double[] delta = new double[m];
for (int i = m - 1; i "gte" 0; --i)
{
double sum = z[i];
for (int j = i + 1; j "lt" m; ++j)
sum -= L[j][i] * delta[j];
delta[i] = sum / L[i][i];
}
// update weights and bias
// calculate largest change
double maxChange = 0.0;
for (int j = 0; j "lt" dim; ++j)
{
double change = Math.Abs(delta[j]);
if (change "gt" maxChange)
maxChange = change;
this.weights[j] += delta[j];
}
// update bias -- and its change
double biasChange = Math.Abs(delta[dim]);
if (biasChange "gt" maxChange)
maxChange = biasChange;
this.bias += delta[dim];
// show progress
if (epoch % 2 == 0)
{
double mse = this.MSE(trainX, trainY);
Console.WriteLine("epoch = " +
epoch.ToString().PadLeft(5) +
" MSE = " + mse.ToString("F4").PadLeft(8) +
" maxChange = " + maxChange.ToString("F8"));
}
// early exit
if (maxChange "lt" tolerance)
{
Console.WriteLine("Converged at epoch " +
(epoch + 1) + " with maxChange = " +
maxChange.ToString("F8"));
break;
}
} // each epoch
} // Train()
// ------------------------------------------------------
public double MSE(double[][] dataX, double[] dataY)
{
int n = dataX.Length;
double sum = 0.0;
for (int i = 0; i "lt" n; ++i)
{
double[] x = dataX[i];
double y = dataY[i];
double p = this.ComputeP(x);
sum += (p - y) * (p - y);
}
return sum / n;
}
// ------------------------------------------------------
public double Accuracy(double[][] dataX, double[] dataY)
{
int n = dataX.Length;
int numCorrect = 0; int numWrong = 0;
for (int i = 0; i "lt" n; ++i)
{
double[] x = dataX[i];
double y = (int)(dataY[i]); // 0 or 1
int predY = this.Predict(x); // 0 or 1
if (predY == y)
++numCorrect;
else
++numWrong;
}
return (numCorrect * 1.0) / (numCorrect + numWrong);
}
// ------------------------------------------------------
public int[][] ConfusionMatrix(double[][] dataX,
double[] dataY)
{
// assumes binary classification
int[][] result = new int[2][]; // 2x2
result[0] = new int[2];
result[1] = new int[2];
int n = dataX.Length;
for (int i = 0; i "lt" n; ++i) // each data item
{
int predY = this.Predict(dataX[i]); // 0 or 1
int actualY = (int)(dataY[i]); // 0 or 1
++result[actualY][predY];
// equivalent:
//if (actualY == 0 && predY == 0)
// ++result[0][0];
//else if (actualY == 0 && predY == 1)
// ++result[0][1];
//else if (actualY == 1 && predY == 0)
// ++result[1][0];
//else if (actualY == 1 && predY == 1)
// ++result[1][1];
}
return result;
}
public void ShowConfusionX(int[][] cm)
{
// simple display version
Console.Write("actual = 0: ");
Console.Write(cm[0][0].ToString().PadLeft(4) + " ");
Console.WriteLine(cm[0][1].ToString().PadLeft(4));
Console.Write("actual = 1: ");
Console.Write(cm[1][0].ToString().PadLeft(4) + " ");
Console.WriteLine(cm[1][1].ToString().PadLeft(4));
}
public void ShowConfusion(int[][] cm)
{
int n = cm.Length; // number classes
double[] accuracies = new double[n];
for (int i = 0; i "lt" n; ++i)
{
int rowSum = 0;
for (int j = 0; j "lt" n; ++j)
rowSum += cm[i][j];
accuracies[i] = (cm[i][i] * 1.0) / rowSum;
}
// assume binary classification
int numCorrect = cm[0][0] + cm[1][1];
int numItems =
cm[0][0] + cm[0][1] + cm[1][0] + cm[1][1];
double overallAcc = (numCorrect * 1.0) / numItems;
for (int i = 0; i "lt" n; ++i)
{
Console.Write(" actual " +
i.ToString().PadLeft(3) + " | ");
for (int j = 0; j "lt" n; ++j)
Console.Write(cm[i][j].ToString().PadLeft(6));
Console.WriteLine(" | " +
accuracies[i].ToString("F4"));
}
Console.WriteLine("----------");
Console.Write("predicted: ");
for (int j = 0; j "lt" cm[0].Length; ++j)
Console.Write(j.ToString().PadLeft(6));
Console.Write(" | " + overallAcc.ToString("F4"));
Console.WriteLine("");
}
} // class LogisticRegression
// ========================================================
} // ns
Training data:
# people_train.txt # sex (0 = male, 1 = female) # age, state (michigan, nebraska, oklahoma), income, # politics type (conservative, moderate, liberal) # 1, 0.24, 1, 0, 0, 0.2950, 0, 0, 1 0, 0.39, 0, 0, 1, 0.5120, 0, 1, 0 1, 0.63, 0, 1, 0, 0.7580, 1, 0, 0 0, 0.36, 1, 0, 0, 0.4450, 0, 1, 0 1, 0.27, 0, 1, 0, 0.2860, 0, 0, 1 1, 0.50, 0, 1, 0, 0.5650, 0, 1, 0 1, 0.50, 0, 0, 1, 0.5500, 0, 1, 0 0, 0.19, 0, 0, 1, 0.3270, 1, 0, 0 1, 0.22, 0, 1, 0, 0.2770, 0, 1, 0 0, 0.39, 0, 0, 1, 0.4710, 0, 0, 1 1, 0.34, 1, 0, 0, 0.3940, 0, 1, 0 0, 0.22, 1, 0, 0, 0.3350, 1, 0, 0 1, 0.35, 0, 0, 1, 0.3520, 0, 0, 1 0, 0.33, 0, 1, 0, 0.4640, 0, 1, 0 1, 0.45, 0, 1, 0, 0.5410, 0, 1, 0 1, 0.42, 0, 1, 0, 0.5070, 0, 1, 0 0, 0.33, 0, 1, 0, 0.4680, 0, 1, 0 1, 0.25, 0, 0, 1, 0.3000, 0, 1, 0 0, 0.31, 0, 1, 0, 0.4640, 1, 0, 0 1, 0.27, 1, 0, 0, 0.3250, 0, 0, 1 1, 0.48, 1, 0, 0, 0.5400, 0, 1, 0 0, 0.64, 0, 1, 0, 0.7130, 0, 0, 1 1, 0.61, 0, 1, 0, 0.7240, 1, 0, 0 1, 0.54, 0, 0, 1, 0.6100, 1, 0, 0 1, 0.29, 1, 0, 0, 0.3630, 1, 0, 0 1, 0.50, 0, 0, 1, 0.5500, 0, 1, 0 1, 0.55, 0, 0, 1, 0.6250, 1, 0, 0 1, 0.40, 1, 0, 0, 0.5240, 1, 0, 0 1, 0.22, 1, 0, 0, 0.2360, 0, 0, 1 1, 0.68, 0, 1, 0, 0.7840, 1, 0, 0 0, 0.60, 1, 0, 0, 0.7170, 0, 0, 1 0, 0.34, 0, 0, 1, 0.4650, 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 1 1, 0.44, 1, 0, 0, 0.5230, 0, 1, 0 1, 0.28, 1, 0, 0, 0.3130, 0, 0, 1 1, 0.54, 0, 0, 1, 0.6260, 1, 0, 0
Test data:
# people_test_40.txt # 0, 0.51, 1, 0, 0, 0.6120, 0, 1, 0 0, 0.32, 0, 1, 0, 0.4610, 0, 1, 0 1, 0.55, 1, 0, 0, 0.6270, 1, 0, 0 1, 0.25, 0, 0, 1, 0.2620, 0, 0, 1 1, 0.33, 0, 0, 1, 0.3730, 0, 0, 1 0, 0.29, 0, 1, 0, 0.4620, 1, 0, 0 1, 0.65, 1, 0, 0, 0.7270, 1, 0, 0 0, 0.43, 0, 1, 0, 0.5140, 0, 1, 0 0, 0.54, 0, 1, 0, 0.6480, 0, 0, 1 1, 0.61, 0, 1, 0, 0.7270, 1, 0, 0 1, 0.52, 0, 1, 0, 0.6360, 1, 0, 0 1, 0.30, 0, 1, 0, 0.3350, 0, 0, 1 1, 0.29, 1, 0, 0, 0.3140, 0, 0, 1 0, 0.47, 0, 0, 1, 0.5940, 0, 1, 0 1, 0.39, 0, 1, 0, 0.4780, 0, 1, 0 1, 0.47, 0, 0, 1, 0.5200, 0, 1, 0 0, 0.49, 1, 0, 0, 0.5860, 0, 1, 0 0, 0.63, 0, 0, 1, 0.6740, 0, 0, 1 0, 0.30, 1, 0, 0, 0.3920, 1, 0, 0 0, 0.61, 0, 0, 1, 0.6960, 0, 0, 1 0, 0.47, 0, 0, 1, 0.5870, 0, 1, 0 1, 0.30, 0, 0, 1, 0.3450, 0, 0, 1 0, 0.51, 0, 0, 1, 0.5800, 0, 1, 0 0, 0.24, 1, 0, 0, 0.3880, 0, 1, 0 0, 0.49, 1, 0, 0, 0.6450, 0, 1, 0 1, 0.66, 0, 0, 1, 0.7450, 1, 0, 0 0, 0.65, 1, 0, 0, 0.7690, 1, 0, 0 0, 0.46, 0, 1, 0, 0.5800, 1, 0, 0 0, 0.45, 0, 0, 1, 0.5180, 0, 1, 0 0, 0.47, 1, 0, 0, 0.6360, 1, 0, 0 0, 0.29, 1, 0, 0, 0.4480, 1, 0, 0 0, 0.57, 0, 0, 1, 0.6930, 0, 0, 1 0, 0.20, 1, 0, 0, 0.2870, 0, 0, 1 0, 0.35, 1, 0, 0, 0.4340, 0, 1, 0 0, 0.61, 0, 0, 1, 0.6700, 0, 0, 1 0, 0.31, 0, 0, 1, 0.3730, 0, 1, 0 1, 0.18, 1, 0, 0, 0.2080, 0, 0, 1 1, 0.26, 0, 0, 1, 0.2920, 0, 0, 1 0, 0.28, 1, 0, 0, 0.3640, 0, 0, 1 0, 0.59, 0, 0, 1, 0.6940, 0, 0, 1





















.NET Test Automation Recipes
Software Testing
SciPy Programming Succinctly
Keras Succinctly
R Programming
Visual Studio Live
Microsoft MLADS Conference
DevIntersection Conference
Machine Learning Week
Ai4 Conference
G2E Conference
iSC West Conference
You must be logged in to post a comment.