Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ notifications:
slack:
secure: d+NSaR+cfRkcJfX/uEVwdyQDlayZO6c8QV96grl1stmWxG3XOXvXg1tM6v7EBeb9VRw5T4VglnnJGNJA62j1ReEJ0XyWr5XtaNWiF6Lc4UOty/TTG36IQdkWS1vQA8v2Hre73YbvOhtBb6biNneVAk+rrfRSgomEa+ec22cjgUo=
env:
- TESTFILES="tests/test_featureset.py tests/test_utilities.py"
- TESTFILES="tests/test_featureset.py tests/test_commandline_utils.py"
- TESTFILES="tests/test_output.py"
- TESTFILES="tests/test_regression.py"
- TESTFILES="tests/test_input.py tests/test_preprocessing.py tests/test_metrics.py tests/test_custom_learner.py tests/test_logutils.py tests/test_examples.py"
- TESTFILES="tests/test_input.py tests/test_preprocessing.py tests/test_metrics.py tests/test_custom_learner.py tests/test_logging_utils.py tests/test_examples.py"
- TESTFILES="tests/test_classification.py tests/test_cv.py tests/test_ablation.py"

# run on the new Travis infrastructure
Expand Down
4 changes: 2 additions & 2 deletions DistributeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $testsToRun= @()

if ($agentNumber -eq 1) {
$testsToRun = $testsToRun + "tests/test_featureset.py"
$testsToRun = $testsToRun + "tests/test_utilities.py"
$testsToRun = $testsToRun + "tests/test_commandline_utils.py"
}
elseif ($agentNumber -eq 2) {
$testsToRun = $testsToRun + "tests/test_output.py"
Expand All @@ -43,7 +43,7 @@ elseif ($agentNumber -eq 4) {
$testsToRun = $testsToRun + "tests/test_preprocessing.py"
$testsToRun = $testsToRun + "tests/test_metrics.py"
$testsToRun = $testsToRun + "tests/test_custom_learner.py"
$testsToRun = $testsToRun + "tests/test_logutils.py"
$testsToRun = $testsToRun + "tests/test_logging_utils.py"
$testsToRun = $testsToRun + "tests/test_examples.py"
}
elseif ($agentNumber -eq 5) {
Expand Down
2 changes: 2 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ API Documentation

api/quickstart
api/skll
api/config
api/data
api/experiments
api/learner
api/metrics
api/utils
6 changes: 6 additions & 0 deletions doc/api/config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:mod:`config` Package
=====================

.. autofunction:: skll.config.fix_json
.. autofunction:: skll.config.load_cv_folds
.. autofunction:: skll.config.locate_file
4 changes: 2 additions & 2 deletions doc/api/experiments.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:mod:`experiments` Module
=========================
:mod:`experiments` Package
==========================

.. automodule:: skll.experiments
:members:
Expand Down
4 changes: 2 additions & 2 deletions doc/api/learner.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:mod:`learner` Module
=====================
:mod:`learner` Package
======================

.. automodule:: skll.learner
:members:
Expand Down
2 changes: 1 addition & 1 deletion doc/api/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here is a quick run-down of how you accomplish common tasks.

Load a ``FeatureSet`` from a file::

from skll import Reader
from skll.data import Reader

example_reader = Reader.for_path('myexamples.megam')
train_examples = example_reader.read()
Expand Down
25 changes: 7 additions & 18 deletions doc/api/skll.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
:mod:`skll` Package
===================

The most useful parts of our API are available at the package level in addition
to the module level. They are documented in both places for convenience.
We have made the most useful parts of our API available in the top-level
``skll`` namespace even though some of them actually live in subpackages.
They are documented in both places for convenience.

From :py:mod:`~skll.data` Package
---------------------------------
.. autoclass:: skll.FeatureSet
:members:
:show-inheritance:
.. autoclass:: skll.Reader
:members:
:show-inheritance:
.. autoclass:: skll.Writer
:members:
:show-inheritance:

From :py:mod:`~skll.experiments` Module
---------------------------------------
From :py:mod:`~skll.experiments` Package
----------------------------------------
.. autofunction:: skll.run_configuration

From :py:mod:`~skll.learner` Module
-----------------------------------
From :py:mod:`~skll.learner` Package
------------------------------------
.. autoclass:: skll.Learner
:members:
:show-inheritance:

From :py:mod:`~skll.metrics` Module
-----------------------------------
.. autofunction:: skll.f1_score_least_frequent
.. autofunction:: skll.kappa
.. autofunction:: skll.correlation
15 changes: 15 additions & 0 deletions doc/api/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:mod:`utils` Package
====================

Various useful constants defining groups of evaluation metrics.

.. autodata:: skll.utils.constants.CLASSIFICATION_ONLY_METRICS
.. autodata:: skll.utils.constants.CORRELATION_METRICS
.. autodata:: skll.utils.constants.PROBABILISTIC_METRICS
.. autodata:: skll.utils.constants.REGRESSION_ONLY_METRICS
.. autodata:: skll.utils.constants.UNWEIGHTED_KAPPA_METRICS
.. autodata:: skll.utils.constants.WEIGHTED_KAPPA_METRICS

A useful logging function for SKLL developers

.. autofunction:: skll.utils.logging.get_skll_logger
3 changes: 1 addition & 2 deletions examples/make_titanic_example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@

import logging
import os
import sys
from itertools import chain

from skll import Writer, Reader
from skll.data import Reader, Writer


def main():
Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ def requirements():
license='BSD 3 clause',
packages=find_packages(exclude=['tests', 'examples']),
entry_points={'console_scripts':
['filter_features = skll.utilities.filter_features:main',
'generate_predictions = skll.utilities.generate_predictions:main',
'join_features = skll.utilities.join_features:main',
'print_model_weights = skll.utilities.print_model_weights:main',
'run_experiment = skll.utilities.run_experiment:main',
'skll_convert = skll.utilities.skll_convert:main',
'summarize_results = skll.utilities.summarize_results:main',
'compute_eval_from_predictions = skll.utilities.compute_eval_from_predictions:main',
'plot_learning_curves = skll.utilities.plot_learning_curves:main']},
['filter_features = skll.utils.commandline.filter_features:main',
'generate_predictions = skll.utils.commandline.generate_predictions:main',
'join_features = skll.utils.commandline.join_features:main',
'print_model_weights = skll.utils.commandline.print_model_weights:main',
'run_experiment = skll.utils.commandline.run_experiment:main',
'skll_convert = skll.utils.commandline.skll_convert:main',
'summarize_results = skll.utils.commandline.summarize_results:main',
'compute_eval_from_predictions = skll.utils.commandline.compute_eval_from_predictions:main',
'plot_learning_curves = skll.utils.commandline.plot_learning_curves:main']},
install_requires=requirements(),
classifiers=['Intended Audience :: Science/Research',
'Intended Audience :: Developers',
Expand Down
28 changes: 11 additions & 17 deletions skll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,37 @@
This package provides a number of utilities to make it simpler to run
common scikit-learn experiments with pre-generated features.

:author: Nitin Madnani (nmadnani@ets.org)
:author: Dan Blanchard (dblanchard@ets.org)
:author: Michael Heilman (mheilman@ets.org)
:author: Nitin Madnani (nmadnani@ets.org)
:organization: ETS
"""

from sklearn.metrics import f1_score, make_scorer, SCORERS
from .logutils import (close_and_remove_logger_handlers,
get_skll_logger, orig_showwarning)
from .data import FeatureSet, Reader, Writer
from .data import FeatureSet
from .experiments import run_configuration
from .learner import Learner
from .metrics import correlation, f1_score_least_frequent, kappa

__all__ = ['FeatureSet', 'Learner', 'Reader', 'get_skll_logger',
'orig_showwarning', 'close_and_remove_logger_handlers',
'run_configuration', 'Writer']
__all__ = ['FeatureSet', 'Learner', 'run_configuration']

# Add our scorers to the sklearn dictionary here so that they will always be
# available if you import anything from skll
_scorers = {'f1_score_micro': make_scorer(f1_score,
average='micro'),
'f1_score_macro': make_scorer(f1_score,
average='macro'),
'f1_score_weighted': make_scorer(f1_score,
average='weighted'),
_scorers = {'f1_score_micro': make_scorer(f1_score, average='micro'),
'f1_score_macro': make_scorer(f1_score, average='macro'),
'f1_score_weighted': make_scorer(f1_score, average='weighted'),
'f1_score_least_frequent': make_scorer(f1_score_least_frequent),
'pearson': make_scorer(correlation, corr_type='pearson'),
'spearman': make_scorer(correlation, corr_type='spearman'),
'kendall_tau': make_scorer(correlation, corr_type='kendall_tau'),
'unweighted_kappa': make_scorer(kappa),
'quadratic_weighted_kappa': make_scorer(kappa,
weights='quadratic'),
'quadratic_weighted_kappa': make_scorer(kappa, weights='quadratic'),
'linear_weighted_kappa': make_scorer(kappa, weights='linear'),
'qwk_off_by_one': make_scorer(kappa, weights='quadratic',
'qwk_off_by_one': make_scorer(kappa,
weights='quadratic',
allow_off_by_one=True),
'lwk_off_by_one': make_scorer(kappa, weights='linear',
'lwk_off_by_one': make_scorer(kappa,
weights='linear',
allow_off_by_one=True),
'uwk_off_by_one': make_scorer(kappa, allow_off_by_one=True)}

Expand Down
Loading