Attributes — miml documentation

Skip to main content
`Ctrl`+`K`

# Attributes

class miml.classifier.mi.apr_classifier.APRClassifier

  Bases: `object`

  Approach is to construct an APR by starting with a single positive instance and “growing” the APR by expanding it to cover additional positive instances. We call it the “iterated discrimination” algorithm, and it has three basic procedures: -Grow. An algorithm for growing an APR with “tight” bounds along a specified set of features. -Discriminate. An algorithm for choosing a set of discriminating features by analyzing an APR. -Expand. An algorithm for expanding the bounds of an APR to improve its generalization ability.

  # Attributes

  classifier

    Classifier used from mil library

  # References

  Thomas G. Dietterich, Richard H. Lathrop, Tomas Lozano-Perez “Solving the multiple instance problem with axis-parallel rectangles” 1997 Model implementation rosasalberto/mil Matlab implementation DMJTax/mil

  fit(x_train: ndarray, y_train: ndarray) → None

    Fit the classifier to the training data.

    ## Parameters

    x_trainndarray of shape (n_bags, n_instances, n_features)

      Features values of bags in the training set.

    y_trainndarray (n_bags, n_instances, n_labels)

      Labels of bags in the training set.

  predict(x: ndarray) → int

    Predict the label of the bag

    ## Parameters

    x: np.ndarray of shape(n_instances, n_features)

      features values of a bag

    ## Returns

    label: int

      Predicted label of the bag

  predict_proba(x: ndarray)

    Predict probabilities of given data

    ## Parameters

    xnp.ndarray of shape (n_instances, n_features)

      Probabilities of data of being a positive label.

    ## Returns

    results: np.ndarray of shape (n_instances, n_features)

      Predicted probabilities for given data