MODELCATALOG

Dots are folders. Case tells you what the thing is.

How to read an import

Dots are folders. Case tells you what the thing is.

An import path is a route through folders on disk.

    from sklearn.feature_extraction.text import TfidfVectorizer
         package  subpackage        module       class

`sklearn` is a directory; `feature_extraction` is a directory inside it; `text.py` is a file inside that; `TfidfVectorizer` is a class defined in the file. The filing system is by what the thing does, so once you know the scheme you can guess an import instead of searching for it.

Two conventions carry real information. **CamelCase** means a class you instantiate and then call methods on, like `StandardScaler()`. It will have `.fit()`. **snake_case** means a plain function that does one thing and returns, like `train_test_split(...)`.

Files beginning with an underscore are internal. You will see `_logistic.py` inside `sklearn/linear_model/`, but you import from the subpackage, never from the private file: `from sklearn.linear_model import LogisticRegression`. The `__init__.py` in each folder decides what the subpackage exposes.