Difference between revisions of "Orange: Predictions"

From OnnoWiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
Shows models’ predictions on the data.
+
Memperlihatkan prediksi model terhadap data.
  
Inputs
+
==Input==
  
    Data: input dataset
+
Data: input dataset
    Predictors: predictors to be used on the data
+
Predictors: predictors to be used on the data
  
Outputs
+
==Output==
  
    Predictions: data with added predictions
+
Predictions: data with added predictions
    Evaluation Results: results of testing classification algorithms
+
Evaluation Results: results of testing classification algorithms
  
The widget receives a dataset and one or more predictors (predictive models, not learning algorithms - see the example below). It outputs the data and the predictions.
+
Widget Predictions menerima dataset dan satu atau lebih prediktor (model prediktif, bukan algoritma learner - lihat contoh di bawah). Ini menghasilkan data dan prediksi.
  
../../_images/Predictions-stamped.png
+
[[File:Predictions-stamped.png|center|200px|thumb]]
  
    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.
+
* 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.
+
* 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).
+
* By ticking the Show full dataset, you can view the entire data table (otherwise only class variable will be shown).
    Select the desired output.
+
* Select the desired output.
    Predictions.
+
* Predictions.
  
The widget show the probabilities and final decisions of predictive models. The output of the widget is another dataset, where predictions are appended as new meta attributes. You can select which features you wish to output (original data, predictions, probabilities). The result can be observed in a Data Table. If the predicted data includes true class values, the result of prediction can also be observed in a Confusion Matrix.
+
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==
 
==Contoh==
  
In the first example, we will use Attrition - Train data from the Datasets widget. This is a data on attrition of employees. In other words, we wish to know whether a certain employee will resign from the job or not. We will construct a predictive model with the Tree widget and observe probabilities in Predictions.
+
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.
  
For predictions we need both the training data, which we have loaded in the first Datasets widget and the data to predict, which we will load in another Datasets widget. We will use Attrition - Predict data this time. Connect the second data set to Predictions. Now we can see predictions for the three data instances from the second data set.
+
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.
  
The Tree model predicts none of the employees will leave the company. You can try other model and see if predictions change. Or test the predictive scores first in the Test & Score widget.
+
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.
  
../../_images/Predictions-Example1.png
+
[[File:Predictions-Example1.png|center|200px|thumb]]
  
In the second example, we will see how to properly use Preprocess with Predictions or Test & Score.
+
Pada contoh kedua, kita akan melihat cara menggunakan Preprocess dengan benar dengan Widget Predictions atau Widget 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).
+
Kali ini kami menggunakan data heart disease.tab dari widget File. Kita dapat mengakses data melalui menu dropdown. Ini adalah dataset dengan 303 pasien yang datang ke dokter yang menderita nyeri dada. Setelah tes dilakukan, beberapa pasien ditemukan memiliki penyempitan diameter dan yang lainnya tidak (ini adalah variabel class kita).
  
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.
+
Data heart disease memiliki beberapa nilai yang hilang dan kita ingin menanganinya. Pertama, kita akan membagi set data menjadi data train dan test dengan 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.
+
Kemudian kita akan mengirimkan Sampel Data ke dalam Preprocess. Kita akan menggunakan Widget Impute untuk  mengatasi nilai yang hilang (missing value), tetapi kita dapat mencoba kombinasi preprosesor pada data kita. Kami akan mengirimkan data yang telah diproses ke Widget Logistic Regression dan model yang dibangun ke Widget 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.
+
Akhirnya, Widget Predictions juga membutuhkan data untuk diprediksi. Kita akan menggunakan output Widget Data Sampler untuk prediksi, tetapi kali ini bukan Sampel Data, tetapi Remaining Data (sisa data), ini adalah data yang tidak digunakan untuk me-train 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.
 
 
 
../../_images/Predictions-Example21.png
 
  
 +
Perhatikan bagaimana kita mengirim remaining data (data sisa) secara langsung ke Widget Predictions tanpa menerapkan preprocessing apa pun. Ini karena Orange menangani preprocessing pada data baru secara internal untuk mencegah kesalahan dalam konstruksi model. Preprosesor yang sama persis yang digunakan pada training data akan digunakan untuk prediksi. Proses yang sama berlaku untuk Widget Test & Score.
  
 +
[[File:Predictions-Example2.png|center|200px|thumb]]
  
 
==Referensi==
 
==Referensi==

Latest revision as of 08:02, 5 March 2020

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

Pada contoh kedua, kita akan melihat cara menggunakan Preprocess dengan benar dengan Widget Predictions atau Widget Test & Score.

Kali ini kami menggunakan data heart disease.tab dari widget File. Kita dapat mengakses data melalui menu dropdown. Ini adalah dataset dengan 303 pasien yang datang ke dokter yang menderita nyeri dada. Setelah tes dilakukan, beberapa pasien ditemukan memiliki penyempitan diameter dan yang lainnya tidak (ini adalah variabel class kita).

Data heart disease memiliki beberapa nilai yang hilang dan kita ingin menanganinya. Pertama, kita akan membagi set data menjadi data train dan test dengan Data Sampler.

Kemudian kita akan mengirimkan Sampel Data ke dalam Preprocess. Kita akan menggunakan Widget Impute untuk mengatasi nilai yang hilang (missing value), tetapi kita dapat mencoba kombinasi preprosesor pada data kita. Kami akan mengirimkan data yang telah diproses ke Widget Logistic Regression dan model yang dibangun ke Widget Predictions.

Akhirnya, Widget Predictions juga membutuhkan data untuk diprediksi. Kita akan menggunakan output Widget Data Sampler untuk prediksi, tetapi kali ini bukan Sampel Data, tetapi Remaining Data (sisa data), ini adalah data yang tidak digunakan untuk me-train model.

Perhatikan bagaimana kita mengirim remaining data (data sisa) secara langsung ke Widget Predictions tanpa menerapkan preprocessing apa pun. Ini karena Orange menangani preprocessing pada data baru secara internal untuk mencegah kesalahan dalam konstruksi model. Preprosesor yang sama persis yang digunakan pada training data akan digunakan untuk prediksi. Proses yang sama berlaku untuk Widget Test & Score.

Predictions-Example2.png

Referensi

Pranala Menarik