clips / clips/pattern

Creating an LSA from Infogain-weighted model raises "can't create more dimensions than there are documents" error

Open
#100 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.9k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Creating an LSA with Information Gain weighted model raises "can't create more dimensions than there are documents".
All other weighting methods work.
Tested with Python 2.7.6
Tryed both Pattern 2.6 from PyPI and the latest version from Git.

Example:

from pattern.vector import Model, Document, LSA

docs = [
    {'attr A': 2, 'attr B': 1},
    {'attr A': 1, 'Attr B': 3},
    {'Attr C': 1, 'Attr D': 1},
]
m = Model(weight='ig')

for d in docs:
    m.append(Document(d))

m.lsa = LSA(m)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python example with Model(weight='ig'), Document, and LSA to reproduce the error. Inspect the pattern.vector weighting and LSA entry points; done means the Infogain-weighted model creates its LSA without the dimensions error while other weighting methods continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.