concept initial model in category machine learning

appears as: n initial model, initial model, initial models
Real-World Machine Learning

This is an excerpt from Manning's book Real-World Machine Learning.

As always, you’ll start by investigating and analyzing the dataset at hand to understand the feature and target columns so you can make the best decisions about which feature-extraction and ML algorithms to use. You’ll then build the initial model from the simplest feature-extraction algorithms to see how you can quickly get a useful model with only a few lines of code. Next, you’ll dig a little deeper into the library of feature-extraction and ML modeling algorithms to improve the accuracy of the model even further. You’ll conclude by exploring various deployment and scalability aspects of putting the model into production.

Listing 8.3. Evaluating the initial model
from sklearn.metrics import accuracy_score, roc_auc_score, roc_curve def performance(y_true, pred, color="g", ann=True): acc = accuracy_score(y_true, pred[:,1] > 0.5) auc = roc_auc_score(y_true, pred[:,1]) fpr, tpr, thr = roc_curve(y_true, pred[:,1]) plot(fpr, tpr, color, linewidth="3") xlabel("False positive rate") ylabel("True positive rate") if ann: annotate("Acc: %0.2f" % acc, (0.2,0.7), size=14) annotate("AUC: %0.2f" % auc, (0.2,0.6), size=14) performance(d_test.sentiment, pred1)
  • Building an initial model using the naïve Bayes ML algorithm