コード例 #1
0
    def __init__(self,
                 obj,
                 X=None,
                 X_train=None,
                 y_pred=None,
                 y_true=None,
                 y_train=None,
                 y_true_train=None,
                 store_X=False,
                 prob_return=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.n_estimators = obj.n_estimators
        self.base_estimator = obj.base_estimator_
        self.criterion = obj.base_estimator_.criterion
        self.max_depth = obj.base_estimator_.max_depth
        self.max_leaf_nodes = obj.base_estimator_.max_leaf_nodes
        self.ccp_alpha = obj.base_estimator_.ccp_alpha
        self.min_samples_leaf = obj.base_estimator_.min_samples_leaf
        self.min_samples_split = obj.base_estimator_.min_samples_split
        self.max_features = obj.max_features
        self.bootstrap = obj.bootstrap
        self.bootstrap_features = obj.bootstrap_features
コード例 #2
0
    def __init__(self,
                 obj,
                 X=None,
                 X_train=None,
                 y_pred=None,
                 y_true=None,
                 y_train=None,
                 y_true_train=None,
                 store_X=False,
                 prob_return=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.n_estimators = obj.n_estimators
        self.algorithm = obj.algorithm
        self.base_estimator_ = obj.base_estimator_
        self.learning_rate = obj.learning_rate
        self.estimator_weights_ = obj.estimator_weights_
        self.estimator_errors_ = obj.estimator_errors_
        self.feature_importances = _features_important(
            obj.feature_importances_, X)
コード例 #3
0
    def __init__(self,
                 obj,
                 X=None,
                 X_train=None,
                 y_pred=None,
                 y_true=None,
                 y_train=None,
                 y_true_train=None,
                 store_X=False,
                 prob_return=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.n_estimators = obj.n_estimators
        self.objective = obj.objective
        self.learning_rate = obj.learning_rate
        self.reg_alpha = obj.reg_alpha
        self.reg_lambda = obj.reg_lambda
        self.feature_importances = _features_important(
            obj.feature_importances_, X)
        self.min_child_weight = obj.min_child_weight
        self.gamma = obj.gamma
        self.booster = obj.booster
        self.max_delta_step = obj.max_delta_step
コード例 #4
0
    def __init__(self,
                 obj,
                 X=None,
                 X_train=None,
                 y_pred=None,
                 y_true=None,
                 y_train=None,
                 y_true_train=None,
                 store_X=False,
                 prob_return=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = np.shape(obj.means_)[1]
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.class_prior = pd.Series(obj.priors_)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        #self.means = _class_centers(obj.means_)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.intercept = obj.intercept_
        self.coef = obj.coef_
        self.solver = obj.solver
        self.shrinkage = obj.shrinkage
コード例 #5
0
    def __init__(self,
                 obj,
                 X=None,
                 X_train=None,
                 y_pred=None,
                 y_true=None,
                 y_train=None,
                 y_true_train=None,
                 store_X=False,
                 prob_return=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.n_neighbors = obj.n_neighbors
        self.radius = obj.radius
        self.metric = obj.effective_metric_
        self.p = obj.p
        self.metric_params = obj.metric_params
        self.weights = obj.weights
コード例 #6
0
    def __init__(self,
                 obj,
                 X=None,
                 y_pred=None,
                 y_true=None,
                 store_X=False,
                 digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.labels_pred = y_pred
        self.labels_true = y_true
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.y_pred, self.y_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.ce = _class_pred(obj, X, y_pred, y_true, digits)
        self.X = _store_X(X, store_X)
        self.n_neighbors = obj.n_neighbors
        self.radius = obj.radius
        self.metric = self.effective_metric_
        self.p = obj.p
        self.fit_method = obj._fit_method
        self.leaf_size = obj.leaf_size
        self.p = obj.p
        self.contamination = obj.offset_
        self.novelty = obj.novelty
        self.negative_outlier_factor_ = pd.DataFrame(
            obj.negative_outlier_factor_)
コード例 #7
0
    def __init__(self, obj, X=None, X_train = None, y_pred=None, y_true=None,
                 y_train = None, y_true_train = None, store_X=False, prob_return=False, digits = 3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.centroids = obj.centroids_
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.shrink_threshold = obj.shrink_threshold
        self.metric = obj.metric
コード例 #8
0
    def __init__(self, obj, X=None, X_train = None, y_pred=None, y_true=None,
                 y_train = None, y_true_train = None, store_X=False, prob_return=False, digits = 3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = np.shape(obj.theta_)[1]
        self.priors_weight = pd.Series(obj.class_prior_)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.means = _clust_centers(obj.theta_)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.sigma = pd.DataFrame(obj.sigma_)
        self.epsilon = obj.epsilon_
        self.var_smoothing = obj.var_smoothing
コード例 #9
0
    def __init__(self, obj, X=None, X_train = None, y_pred=None, y_true=None,
                 y_train = None, y_true_train = None, store_X=False, prob_return=False, digits = 3):

        self.model = obj
        self.n_class = obj.n_classes
        #self.labels = obj.classes_
        self.variables = obj._n_features
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
            self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
            self.class_weight_train, self.class_size_train, self.acc_train, \
            self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
                obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.b = obj.b_
        self.w = obj.w_
        self.regularization = obj.l2
        self.learning_rate = obj.eta
        self.epochs = obj.epochs
        self.cross_entropy = obj.cost_
        self.minibatches = obj.minibatches
コード例 #10
0
    def __init__(self, obj, X=None, X_train=None, y_pred=None, y_true=None,
                 y_train=None, y_true_train=None, store_X=False, prob_return=False, digits=3):

        self.model = obj
        self.n_class = np.shape(obj.classes_)[0]
        self.labels = obj.classes_
        self.variables = obj.n_features_in_
        self.priors_weight, self.prior_size = _prior(y_true, digits)
        self.labels_pred, self.labels_true, self.y_pred_prob, self.class_weight, self.class_size, self.acc, \
        self.prc, self.rcl, self.f1, self.conf, self.y_train, self.y_pred_prob_train, \
        self.class_weight_train, self.class_size_train, self.acc_train, \
        self.prc_train, self.rcl_train, self.f1_train, self.conf_train, self.ce, self.ce_train, self.y_true_train = _class_pred(
            obj, X, X_train, y_pred, y_train, y_true, y_true_train, prob_return, digits)
        self.X = _store_X(X, store_X)
        self.X_train = _store_X(X_train, store_X)
        self.C = obj.C
        self.kernel = obj.kernel
        self.degree = obj.degree
        self.gamma = obj.gamma
        self.shrinking = obj.shrinking
        self.support_vectors_ = pd.DataFrame(obj.support_vectors_)
        self.n_support = pd.DataFrame(obj.n_support_)
        self.decision_function = obj.decision_function_shape