Skip to content

Commit

Permalink
Merge pull request #1428 from chinmayapancholi13/skl_ipynb_changes
Browse files Browse the repository at this point in the history
[MRG] Updated IPython notebook for scikit-learn wrappers
  • Loading branch information
menshikh-iv authored Jun 21, 2017
2 parents 2ea1af0 + 4547c1e commit b4da23c
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 68 deletions.
316 changes: 256 additions & 60 deletions docs/notebooks/sklearn_wrapper.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions gensim/sklearn_integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@
See [1] for complete set of conventions.
[1] http://scikit-learn.org/stable/developers/
"""


from .base_sklearn_wrapper import BaseSklearnWrapper # noqa: F401
from .sklearn_wrapper_gensim_ldamodel import SklLdaModel # noqa: F401
from .sklearn_wrapper_gensim_lsimodel import SklLsiModel # noqa: F401
from .sklearn_wrapper_gensim_rpmodel import SklRpModel # noqa: F401
from .sklearn_wrapper_gensim_ldaseqmodel import SklLdaSeqModel # noqa: F401
5 changes: 3 additions & 2 deletions gensim/sklearn_integration/sklearn_wrapper_gensim_ldamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

from gensim import models
from gensim import matutils
from gensim.sklearn_integration import base_sklearn_wrapper
from gensim.sklearn_integration import BaseSklearnWrapper


class SklLdaModel(base_sklearn_wrapper.BaseSklearnWrapper, TransformerMixin, BaseEstimator):
class SklLdaModel(BaseSklearnWrapper, TransformerMixin, BaseEstimator):
"""
Base LDA module
"""
Expand Down Expand Up @@ -64,6 +64,7 @@ def set_params(self, **parameters):
Set all parameters.
"""
super(SklLdaModel, self).set_params(**parameters)
return self

def fit(self, X, y=None):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
from sklearn.exceptions import NotFittedError

from gensim import models
from gensim.sklearn_integration import base_sklearn_wrapper
from gensim.sklearn_integration import BaseSklearnWrapper


class SklLdaSeqModel(base_sklearn_wrapper.BaseSklearnWrapper, TransformerMixin, BaseEstimator):
class SklLdaSeqModel(BaseSklearnWrapper, TransformerMixin, BaseEstimator):
"""
Base LdaSeq module
"""
Expand Down Expand Up @@ -61,6 +61,7 @@ def set_params(self, **parameters):
Set all parameters.
"""
super(SklLdaSeqModel, self).set_params(**parameters)
return self

def fit(self, X, y=None):
"""
Expand Down
5 changes: 3 additions & 2 deletions gensim/sklearn_integration/sklearn_wrapper_gensim_lsimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

from gensim import models
from gensim import matutils
from gensim.sklearn_integration import base_sklearn_wrapper
from gensim.sklearn_integration import BaseSklearnWrapper


class SklLsiModel(base_sklearn_wrapper.BaseSklearnWrapper, TransformerMixin, BaseEstimator):
class SklLsiModel(BaseSklearnWrapper, TransformerMixin, BaseEstimator):
"""
Base LSI module
"""
Expand Down Expand Up @@ -51,6 +51,7 @@ def set_params(self, **parameters):
Set all parameters.
"""
super(SklLsiModel, self).set_params(**parameters)
return self

def fit(self, X, y=None):
"""
Expand Down
5 changes: 3 additions & 2 deletions gensim/sklearn_integration/sklearn_wrapper_gensim_rpmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
from sklearn.exceptions import NotFittedError

from gensim import models
from gensim.sklearn_integration import base_sklearn_wrapper
from gensim.sklearn_integration import BaseSklearnWrapper


class SklRpModel(base_sklearn_wrapper.BaseSklearnWrapper, TransformerMixin, BaseEstimator):
class SklRpModel(BaseSklearnWrapper, TransformerMixin, BaseEstimator):
"""
Base RP module
"""
Expand All @@ -41,6 +41,7 @@ def set_params(self, **parameters):
Set all parameters.
"""
super(SklRpModel, self).set_params(**parameters)
return self

def fit(self, X, y=None):
"""
Expand Down

0 comments on commit b4da23c

Please sign in to comment.