Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sklearn wrapper integration #916

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gensim/sklearn_integration/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""scikit learn wrapper for gensim
Contains various gensim based implementations
which match with scikit-learn standards .
See [1] for complete set of conventions.
[1] http://scikit-learn.org/stable/developers/
"""
9 changes: 9 additions & 0 deletions gensim/sklearn_integration/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""
scikit learn interface for gensim for easy use of gensim with scikit-learn
"""
import numpy as np
class BaseClass(object):
def __init__(self):
"""init"""
def run(self):
return np.array([0,0,0])
32 changes: 32 additions & 0 deletions gensim/test/test_sklearn_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <[email protected]>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html

"""
Tests for sklearn_integration interface
"""


import logging
import unittest
import os
import os.path
import numpy as np

from gensim.sklearn_integration import base


class TestSklearn(unittest.TestCase):
"""
write test script
"""
#for now
def testRun(self):
model=base.BaseClass()
self.assertTrue(np.array_equal(model.run(),np.array([0,0,0])))

if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG)
unittest.main()