Rules, regression, and k-nearest neighbors (KNN) make predictions in different ways: rules map conditions to outcomes, regression estimates numeric values, and KNN uses nearby examples to predict a new case. The label “DM9” is not enough to identify a specific course with confidence, so this guide explains the methods rather than treating any one syllabus as definitive.
What does “DM9” refer to?
The exact course or institution behind the title “DM9” is not established. The University of Pisa’s Data Mining 2019/20 course page uses “DM9 CFU” in an optional-project description and includes KNN, regression, and rule-based classifiers among its topics. That makes it a possible connection, not proof that it is the source of this title.
A separate, useful teaching reference is Cornell University’s archived Fall 2019 CS4780/5780 syllabus. It covers supervised learning, KNN, linear rules, regression, and model assessment, but it is not confirmed as the DM9 course. Cornell describes machine learning as “the question of how to make computers learn from experience.”
First distinguish the prediction target
The target determines whether a task is classification or regression. Classification predicts a class or category, such as whether a transaction is fraudulent. Regression predicts a numeric value, such as a delivery time or home price. “Regression” does not mean every kind of predictive modeling; it refers to predicting a numeric outcome.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors#1 Best Overall
- Use scikit-learn to track an example ML project end to end
- Explore several models, including support vector machines, decision trees, random forests, and ensemble methods
- Exploit unsupervised learning techniques such as dimensionality reduction, clustering, and anomaly detection
- Dive into neural net architectures, including convolutional nets, recurrent nets, generative adversarial networks, autoencoders, diffusion models, and transformers
- Use TensorFlow and Keras to build and train neural nets for computer vision, natural language processing, generative models, and deep reinforcement learning
How rule-based methods predict
A rule-based model represents decisions as conditions paired with outcomes. For example, a model might say: if a message contains certain features, label it “spam.” The rules can be read as explicit decision logic, which can make the model easier to inspect than one whose decision is represented only by a complex calculation.
Rules can support classification, and rule-based classifiers appear in the University of Pisa course material. The specific rules, training procedure, and performance of any particular DM9 model are not established by that course-page reference.
Rank #2
How linear methods and regression predict
Linear methods combine input features using weights. A linear classifier uses a score or boundary to assign a class; linear regression combines features to estimate a numeric outcome. They can share mathematical ingredients while answering different prediction questions.
Cornell’s Fall 2019 course lists perceptrons and linear classification rules as well as linear, logistic, and ridge regression. The names can be confusing: logistic regression is commonly used for classification despite “regression” in its name, while linear regression predicts numeric values. Ridge regression is a regularized linear-regression method; regularization constrains model complexity to help manage fitting. The syllabus establishes these topics, not a guarantee that one variant performs best for a given dataset.
How KNN uses nearby examples
K-nearest neighbors is an instance-based method: rather than expressing its prediction solely as a compact set of learned rules or weights, it uses stored examples similar to the case being predicted. The model’s k setting specifies how many nearby examples influence the prediction.
KNN for classification
For a class prediction, the nearby examples’ labels inform the new case’s label. Unweighted KNN treats the selected neighbors equally; weighted KNN gives closer examples greater influence. The choice of k changes how local or broad the evidence is, so there is no universally best value.
Rank #4
KNN for regression
KNN can also predict numeric outcomes by using the outcomes of nearby examples. Cornell’s KNN lecture includes both regression and collaborative filtering, illustrating that the same neighbor-based idea can be used for more than class labels.
How to compare the methods
These approaches are not interchangeable by default. Compare them against the task and data rather than choosing by name alone.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Best Value
| Approach | Typical prediction target | How the prediction is represented | Important choice | Interpretation and prediction cost |
|---|---|---|---|---|
| Rule-based method | Often a class label; exact target depends on the model | Conditions paired with outcomes | Which rules are used and how they are formed; the DM9-specific settings are not stated | Explicit conditions can be inspected; runtime cost depends on the rule set and implementation |
| Linear method | Class label for linear classification; numeric value for linear regression | Feature weights and, for classification, a scoring rule or boundary | Model form and settings such as regularization; the DM9-specific settings are not stated | Weights and scores can be examined; prediction generally applies the learned calculation to the input |
| KNN | Class label or numeric value | Stored examples and a neighborhood of size k | k and whether neighbors are weighted | Predictions depend on the examples considered; finding neighbors can require comparing a new case with stored data |
The table summarizes the methods conceptually; it is not a benchmark. A useful comparison also checks validation performance, sensitivity to settings, interpretability for the people who must use the model, and the cost of making predictions. KNN’s dependence on the selected k is a specific model-selection issue, while runtime and interpretability depend on the implementation and dataset.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How to assess a model without overclaiming
A model’s performance on the examples used to fit it does not by itself show how well it will predict new cases. Reserve data for assessment or use cross-validation, which repeatedly evaluates models on held-out portions of the available data. Cornell’s syllabus covers train/validation/test splits, k-fold cross-validation, and model selection and assessment.
- Set the target and metric. Decide whether the outcome is a class or a number, then choose an evaluation measure suited to that task.
- Separate fitting from evaluation. Use training data to fit the model and held-out data, or cross-validation, to estimate performance on unseen examples.
- Select settings using validation. For KNN, compare candidate values of k; for other methods, compare relevant model settings. Do not choose based on the final test set.
- Report the result in context. State the evaluation setup and avoid treating one score as proof that a method is universally superior.
Where to study the concepts further
Cornell’s archived course page names Shai Shalev-Shwartz and Shai Ben-David’s Understanding Machine Learning: From Theory to Algorithms as its main textbook. It is a possible route to theoretical depth on supervised learning, not an established required purchase for a DM9 course.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →

