Orange: Predictions

From OnnoWiki
Jump to navigation Jump to search

Sumber: https://docs.biolab.si//3/visual-programming/widgets/evaluate/predictions.html


Memperlihatkan prediksi model terhadap data.

Input

Data: input dataset
Predictors: predictors to be used on the data

Output

Predictions: data with added predictions
Evaluation Results: results of testing classification algorithms

Widget Predictions menerima dataset dan satu atau lebih prediktor (model prediktif, bukan algoritma learner - lihat contoh di bawah). Ini menghasilkan data dan prediksi.

Predictions-stamped.png
  • Information on the input, namely the number of instances to predict, the number of predictors and the task (classification or regression). If you have sorted the data table by attribute and you wish to see the original view, press Restore Original Order.
  • You can select the options for classification. If Predicted class is ticked, the view provides information on predicted class. If Predicted probabilities for is ticked, the view provides information on probabilities predicted by the classifier(s). You can also select the predicted class displayed in the view. The option Draw distribution bars provides a visualization of probabilities.
  • By ticking the Show full dataset, you can view the entire data table (otherwise only class variable will be shown).
  • Select the desired output.
  • Predictions.

Widget Preditions menunjukkan probabilitas dan keputusan akhir dari model prediksi. Output dari Widget Predictions adalah dataset lain, di mana prediksi ditambahkan sebagai atribut meta baru. Kita dapat memilih fitur mana yang ingin kita keluarkan (original data, predictions, probabilities). Hasilnya dapat diamati dalam Data Table. Jika data yang diprediksi mencakup nilai class yang sebenarnya, hasil prediksi juga dapat diamati dalam Widget Confusion Matrix.

Contoh

Pada contoh pertama, kita akan menggunakan Attrition - Train data dari widget Datasets. Ini adalah data tentang pengurangan karyawan. Dengan kata lain, kami ingin tahu apakah karyawan tertentu akan mengundurkan diri dari pekerjaan atau tidak. Kita akan membuat model prediksi dengan widget Tree dan mengamati probabilitas dalam Prediksi.

Untuk prediksi kita membutuhkan data training, yang telah kita muat di widget Datasets pertama dan data untuk diprediksi, yang akan kita muat di widget Datasets lain. Kita akan menggunakan Attrition - Predict data sekarang. Hubungkan set data kedua ke Predictions. Sekarang kita bisa melihat prediksi untuk tiga instance data dari set data kedua.

Model Tree memprediksi tidak ada karyawan yang akan meninggalkan perusahaan. Kita dapat mencoba model lain dan melihat apakah prediksi berubah. Atau test skor prediktif terlebih dahulu di widget Test & Score.

Predictions-Example1.png

In the second example, we will see how to properly use Preprocess with Predictions or Test & Score.

This time we are using the heart disease.tab data from the File widget. You can access the data through the dropdown menu. This is a dataset with 303 patients that came to the doctor suffering from a chest pain. After the tests were done, some patients were found to have diameter narrowing and others did not (this is our class variable).

The heart disease data have some missing values and we wish to account for that. First, we will split the data set into train and test data with Data Sampler.

Then we will send the Data Sample into Preprocess. We will use Impute Missing Values, but you can try any combination of preprocessors on your data. We will send preprocessed data to Logistic Regression and the constructed model to Predictions.

Finally, Predictions also needs the data to predict on. We will use the output of Data Sampler for prediction, but this time not the Data Sample, but the Remaining Data, this is the data that wasn’t used for training the model.

Notice how we send the remaining data directly to Predictions without applying any preprocessing. This is because Orange handles preprocessing on new data internally to prevent any errors in the model construction. The exact same preprocessor that was used on the training data will be used for predictions. The same process applies to Test & Score.

Predictions-Example2.png

Referensi

Pranala Menarik