Learning from data

Choose regression, classification, clustering or strengthening and evaluate without data leakage.

Learning from data means finding a useful relationship and check that it works in new examples. A good result about the data already seen isn't good enough.

Objectives: identify features and labels; distinguish regression and classification; interpret clustering and reinforcement learning; and follow a notebook workflow with proper separation between training and evaluation.

Key concepts

One feature It's an entry feature, such as hours of use or temperature. One Label, target or target variable is the known response during supervised training, as duration of a repair or type of malfunction. A row with inputs and an answer forms an example.

The algorithm sets parameters using the examples. The model trained contains what's been learned. Inference applying that model to a new entry; doesn't mean re-training him.

In regression, the output is numerical: estimated repairing hours. In classification, the output is a class: electrical, mechanical or software malfunction. Two classes constitute binary classification. More than two, multiclase.

Monitoring and evaluation

A simple linear regression calculates predicción = w × x + b. The weight w changes the slope and bias b That's right. That's right. The loss function measures the error. The training looks for parameters that reduce them. A quadratic loss penalizes bigger mistakes.

The logistics regressionDespite his name, his name serves as a classification. In its binary version, a sigmoide transformed a score into a value between 0 and 1. A threshold turns that value into a decision. The appropriate threshold depends on the cost of false positive and false negative That's not a 0,5 law.

Reserve data to evaluate generalization. Train adjusts; validation helps select settings. Test considers the final result without continuing to sharpen against it. If you standardize, compute mean and deviation only about training and re-use that transformation. Adjust it using all data filters information from the test.

Accuracy That's a case-by-case ratio, but you can fool with an unbalanced class. If 98 100's equipment is healthy, always "healthy" responses reach 98% and detects zero faults. Precision responded how many warnings were right. recallhow many real mistakes you found. F1 Fold them both up. Overfitting That's too much to have been seen and bad generalizing.

Clustering and training by strengthening

Learning unsupervised discover structure without an target label. A clustering could group equipment by use patterns. The distance and climbing have an influence: to measure hours and volts without treating their scales can master the groups. A mathematical group needs an interpretation. doesn't bring a guaranteed business name.

In strengthening learningan agent looks at an state, select an action and interacts with an environment that returns consequences and rewards. One politics guide actions. The aim is to improve the accumulated reward, considering future results. Exploring allows us to learn. He's using what's already worked. A LLM agent that calls tools isn't necessarily training by strengthening during that conversation.

Step-by-step example

At Iris's demonstration, four measures of sepals and petals are the features and the species is the label. There are three species: multiclase classification, although the algorithm used is called logistic regression.

  1. Open a Jupitter notebook and recognize your code and Markdown cells. The kernel preserves variables; Restart and run in order check reproducibility.
  2. Inspects missing columns and values. Remove the row identifier and the species of inputs.
  3. Divide examples into training and testing A fixed seed makes the division reproducible, doesn't guarantee quality.
  4. Stretching and training grader. Transforms the test inputs without re-tuning the escalator.
  5. Compare predictions with reserved labels; transformed a new flower with the same escalator before inferring.

A 100% at a small partition doesn't prove universal perfection. Repeat the assessment with representative data and review difficult cases.

Common errors

Diagnostic exercise

From 200 equipment, 190 are healthy and 10 fail. A model predicts "healthy" for all. Another problem calls for an estimate of hours of repair. What do you conclude with the first model and what task is the second?

Solution

First one's up. 190 / 200 = 95% but his bug recall is 0 / 10 = 0%. Fails's task of detecting them. Stretching hours is regression. You have to choose metrics and evaluate each target separately. a high global figure does not replace the business result.

Sources and review

Redata Machine Learning Foundations and their demonstration at Oracle MyLearn. It explain why validating a fixed format does not require ML and why the name "logistics regression" does not describe a continuous output.

Search at CertiTips

12 available courses.