Ejemplo n.º 1
0
def sklearn_evaluator(
    X_test: np.ndarray,
    y_test: np.ndarray,
    model: ClassifierMixin,
) -> float:
    """Calculate accuracy score with classifier."""

    test_acc = model.score(X_test.reshape((X_test.shape[0], -1)), y_test)
    return test_acc
Ejemplo n.º 2
0
Archivo: main.py Proyecto: matbur/um
def get_score(
    model: ClassifierMixin,
    X_train: pd.DataFrame,
    y_train: pd.Series,
    X_test: pd.DataFrame,
    y_test: pd.Series,
) -> int:
    model.fit(X_train, y_train)
    score = model.score(X_test, y_test)
    return score
 def score(self,
           X: np.ndarray,
           y: np.ndarray,
           sample_weight: Optional[np.ndarray] = None) -> float:
     X, y = self._validate_input(X, y)
     return ClassifierMixin.score(self, X, y, sample_weight)
Ejemplo n.º 4
0
 def score(self, X, y, sample_weight=None):
     return ClassifierMixin.score(self, X, y, sample_weight)