PREDICT Module

The PREDICT module enables making predictions on new data using a model previously built with the sklearn package and saved as a pickle file.

Here is an example of how to save a model as a pickle file:

from sklearn import svm
from sklearn import datasets
import joblib

iris = datasets.load_iris()
X, y = iris.data, iris.target

clf = svm.SVC()
clf.fit(X, y)

joblib.dump(clf, "model.pkl")

The PREDICT module can be used with the following options:

  • verbose: Enable or disable verbose mode.

  • timer: Enable or disable the timer to record execution time.

  • log: Specify the path to a file for saving logs.

  • new_log_file: Create a new log file: if a log file with the same name already exists, it will be overwritten.

  • inputFolder: Specify the path to the input folder.

  • outputFolder: Specify the path to the output folder.

  • modelFolder: Specify the path with data from a previously built model (optional, to use with mode: External)

  • radiomics_filename: Specify the name of the Excel file with the radiomics results.

  • model_filename: Specify the name of the pickle file with the model.

  • predict_filename: Specify the name of the Excel file where predictions will be saved.

Here is an example of how to use the PREDICT module:

PREDICT
{
    inputFolder: /path/to/radiomics_results
    # No output folder specified: save output in the input folder
    modelFolder: /path/to/radiomics_model
    radiomics_filename: radiomics.xlsx
    model_filename: model.pkl
    predict_filename: predict.xlsx
    log: /path/to/logs/predict.log
}

In this example:

  • inputFolder: Specifies the folder containing radiomics results for prediction.

  • modelFolder: Specifies the folder containing the pre-trained model.

  • radiomics_filename: Specifies the Excel file containing the radiomics features for prediction.

  • model_filename: Specifies the pickle file containing the saved model.

  • predict_filename: Specifies the Excel file where predictions will be saved.

  • log: Specifies a path for the log file.

predict.main(argv)[source]