openprotein.predictor.PredictorModel#

class openprotein.predictor.PredictorModel(session, job=None, metadata=None)[source]#

Class providing predict endpoint for fitted predictor models.

Also implements a Future that waits for train job.

Parameters:
  • session (APISession)

  • job (PredictorTrainJob | None)

  • metadata (PredictorMetadata | None)

__init__(session, job=None, metadata=None)[source]#

Construct a predictor model.

Takes in either a train job, or the predictor metadata.

Parameters:
  • session (APISession)

  • job (PredictorTrainJob | PredictorEnsembleJob | None)

  • metadata (PredictorMetadata | None)

Methods

__init__(session[, job, metadata])

Construct a predictor model.

cancelled()

Check if the job has been cancelled.

create(session[, job_id, job, response])

Create an instance of the appropriate Future class based on the job type.

crossvalidate([n_splits])

Run a crossvalidation on the trained predictor.

delete()

Delete this predictor model.

done()

Check if the job has completed.

get([verbose])

Returns the train loss curves.

get_assay()

Get assay used for train job.

get_model()

Retrieve the embeddings or SVD model used to create embeddings to train on.

predict(sequences)

Make predictions about the trained properties for a list of sequences.

refresh()

Refresh the job status and internal job object.

single_site(sequence)

Compute the single-site mutated predictions of a base sequence.

wait([interval, timeout, verbose])

Wait for the job to complete, then fetch results.

wait_until_done([interval, timeout, verbose])

Wait for the job to complete.

Attributes

created_date

The creation timestamp of the job.

end_date

The end timestamp of the job.

id

ID of predictor.

job_id

The unique identifier of the job.

job_type

The type of the job.

metadata

The predictor metadata.

model

The embeddings or SVD model used to create embeddings to train on.

progress_counter

The progress counter of the job.

reduction

The reduction of th embeddings used to train the predictor, if any.

sequence_length

The sequence length constraint on the predictor, if any.

start_date

The start timestamp of the job.

status

The current status of the job.

training_assay

The assay the predictor was trained on.

training_properties

The list of properties the predictor was trained on.

job

session