Compute Predictions
Compute output values on provided data with Machine Learning model. Predictions are allocated to variable, so they can be later used to compute performance metrics. Additionally, class probabilities are computed for classifiers.
Required packages
You need below packages to use the code generated by recipe. All packages are automatically installed in MLJAR Studio.
scikit-learn>=1.5.0
Interactive recipe
You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.
In the below recipe, we assume that you have following variables available in your notebook:
- my_classifier (type DecisionTreeClassifier)
- my_regressor (type DecisionTreeRegressor)
- test_data (type DataFrame)
Python code
# Python code will be here
Code explanation
- Compute predictions on provided data.
- Compute class probabilities on provided data only for classifier model.
Predictions are allocated to variables, so can be later used to compute performance metrics.
Example Python notebooks
Please find inspiration in example notebooks
- Train Random Forest regressor
The `scikit-learn` provides implementation of [Random Forest](/glossary/random-forest/) ...
- Train Decision Tree classifier
Classification is a task of predicting discrete target labels. The Python `scikit-learn` ...
- Train Decision Tree on Iris data set
Python is a great choice for Machine Learning projects, because of rich ML packages ...
- Train Decision Tree regressor
Train a Decision Tree Regressor using scikit-learn. This machine learning algorithm ...
- Save and load Decision Tree
`Scikit-learn` provides Decision Tree algorithms for classification (`DecisionTreeClassifier`) ...
Scikit-learn cookbook
Code recipes from Scikit-learn cookbook.
- « Previous
- Train Model
- Next »
- Visualize Decision Tree