Code Monkey home page Code Monkey logo

constrained-linear-regression's Introduction

Hi! I am David Dale, research engineer in natural language processing. ๐Ÿ‘‹

You can read more about me in Russian or English.

I am open to collaboration, especially on creating NLP tools (such as machine translation models) for lower-resourced languages.

Some of my best repos are:

  • dialogic - for developing multiplatform chatbots and voice skills in Python
  • compress-fasttext - for bringing lightweight, fast and accurate word embeddings to your project
  • python-ruwordnet - for those who want to understand language beyound embeddings and need a Russian thesaurus
  • dependency-paraphraser - a simple tool for paraphrasing that respect sentence structure
  • word-mover-grammar - a constituency grammar parser that supports word embeddings
  • weirdMath - a collection of small Python etudes, mostly about data science

You can also take a look at my HugginFace contributions, including:

My Telegram channels:

Contacts:

constrained-linear-regression's People

Contributors

avidale avatar ccomkhj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

constrained-linear-regression's Issues

python 3.11 is not supported [Can't install]

File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 328, in <module>
          setup_package()
        File "setup.py", line 324, in setup_package
          setup(**metadata)
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/numpy/distutils/core.py", line 135, in setup
          config = configuration()
                   ^^^^^^^^^^^^^^^
        File "setup.py", line 187, in configuration
          config.add_subpackage("sklearn")
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1050, in add_subpackage
          config_list = self.get_subpackage(subpackage_name, subpackage_path,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1016, in get_subpackage
          config = self._get_configuration_from_setup_py(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 958, in _get_configuration_from_setup_py
          config = setup_module.configuration(*args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-n4e8s_md/scikit-learn_e9c4447c74cd4675bd9944e28f6c91f5/sklearn/setup.py", line 85, in configuration
          cythonize_extensions(top_path, config)
        File "/tmp/pip-install-n4e8s_md/scikit-learn_e9c4447c74cd4675bd9944e28f6c91f5/sklearn/_build_utils/__init__.py", line 74, in cythonize_extensions
          config.ext_modules = cythonize(
                               ^^^^^^^^^^
        File "/tmp/pip-build-env-8njze5jl/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1145, in cythonize
          result.get(99999)  # seconds
          ^^^^^^^^^^^^^^^^^
        File "/home/huijo/miniconda3/envs/ts/lib/python3.11/multiprocessing/pool.py", line 774, in get
          raise self._value
      Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

ร— Encountered error while generating package metadata.
โ•ฐโ”€> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

It works well with python 3.9.18 and 3.10.13

Installation error

I tried to install the module, but failed. Here is the error message.

๎œผ test ~ โฎ pip install constrained-linear-regression
Collecting constrained-linear-regression
  Using cached constrained_linear_regression-0.0.4.tar.gz (3.8 kB)
  Preparing metadata (setup.py) ... done
Collecting scikit-learn<=1.1 (from constrained-linear-regression)
  Using cached scikit-learn-1.1.0.tar.gz (6.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  ร— Getting requirements to build wheel did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [33 lines of output]
      Traceback (most recent call last):
        File "/Users/xxxxx/opt/anaconda3/envs/test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/xxxxx/opt/anaconda3/envs/test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/xxxxx/opt/anaconda3/envs/test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "/Users/xxxxx/opt/anaconda3/envs/test/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/xxxxx/opt/anaconda3/envs/test/lib/python3.12/importlib/__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 995, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/private/var/folders/40/v0v2h0rj7p75rngjf0bh9r040000gn/T/pip-build-env-teb638kn/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/private/var/folders/40/v0v2h0rj7p75rngjf0bh9r040000gn/T/pip-build-env-teb638kn/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/private/var/folders/40/v0v2h0rj7p75rngjf0bh9r040000gn/T/pip-build-env-teb638kn/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

ร— Getting requirements to build wheel did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Python 3.12.2

AttributeError: 'ConstrainedLinearRegression' object has no attribute '_preprocess_data'

Thank you for the nice project.
I just installed constrained-linear-regression on my computer through "pip install constrained-linear-regression".
However, I failed to run the example codes. It always shows 'ConstrainedLinearRegression' object has no attribute '_preprocess_data'.
I installed python through Anaconda, and I used pycharm to run the code.

sklearn/Python version information:
1.1.1/ 3.9.12

AttributeError: 'MatrixConstrainedLinearRegression' object has no attribute '_preprocess_data'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'MatrixConstrainedLinearRegression' object has no attribute '_preprocess_data'

Reproduce

from constrained_linear_regression import MatrixConstrainedLinearRegression
import numpy as np
from sklearn.datasets import make_regression

# Create a toy regression dataset
X, y = make_regression(n_samples=100, n_features=4)

# Create a constraint matrix and vector
# Here as an example, we give A as an identity matrix and B as ones,
# meaning we want all coefficients to be less than or equal to 1.
A = np.eye(X.shape[1])
B = np.ones(X.shape[1])

# Create and fit the model
model = MatrixConstrainedLinearRegression(A=A, B=B)
model.fit(X, y)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.