Skip to content

Commit

Permalink
add base for sklearn frontend with methods to override
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishticode committed Aug 26, 2023
1 parent b31ebff commit 2141273
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ivy/functional/frontends/sklearn/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ivy
from ivy.functional.frontends.numpy import array

_int8 = ivy.IntDtype("int8")
_int16 = ivy.IntDtype("int16")
_int32 = ivy.IntDtype("int32")
_int64 = ivy.IntDtype("int64")
_uint8 = ivy.UintDtype("uint8")
_uint16 = ivy.UintDtype("uint16")
_uint32 = ivy.UintDtype("uint32")
_uint64 = ivy.UintDtype("uint64")
_bfloat16 = ivy.FloatDtype("bfloat16")
_float16 = ivy.FloatDtype("float16")
_float32 = ivy.FloatDtype("float32")
_float64 = ivy.FloatDtype("float64")
_complex64 = ivy.ComplexDtype("complex64")
_complex128 = ivy.ComplexDtype("complex128")
_bool = ivy.Dtype("bool")

_frontend_array = array
30 changes: 30 additions & 0 deletions ivy/functional/frontends/sklearn/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class BaseEstimator:
def get_params(self, deep=True):
return {}

def set_params(self, **params):
return self


class ClassifierMixin:

def score(self, X, y, sample_weight=None):
raise NotImplementedError

def fit(self, X, y, **kwargs):
raise NotImplementedError

def predict(self, X):
raise NotImplementedError


class RegressorMixin:

def score(self, X, y, sample_weight=None):
raise NotImplementedError

def fit(self, X, y, **kwargs):
raise NotImplementedError

def predict(self, X):
raise NotImplementedError
Empty file.

0 comments on commit 2141273

Please sign in to comment.