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

Fill out a few function docstrings #196

Merged
merged 4 commits into from
Oct 13, 2016
Merged

Conversation

acrellin
Copy link
Member

@acrellin acrellin commented Oct 7, 2016

No description provided.


Returns
-------
Pandas.Dataframe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataFrame

Copy link
Contributor

@stefanv stefanv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some minor comments.

String indicating model to be used, e.g. "RandomForestClassifier".
If None, `model` must not be. Defaults to None.
model_options : dict, optional
Dictionary with hyperparameter values to be used in model building.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe the structure of this dictionary.

model_options : dict, optional
Dictionary with hyperparameter values to be used in model building.
params_to_optimize : list of str, optional
List of parameters to be optimized (whose corresponding entries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this is None?

cv : int, cross-validation generator or an iterable, optional
Number of folds (defaults to 3) or an iterable yielding train/test
splits. See documentation for `GridSearchCV` for details. Defaults to
None.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when this is None?

@acrellin
Copy link
Member Author

acrellin commented Oct 7, 2016

@stefanv addressed your comments - want to take another look?

@bnaul
Copy link
Contributor

bnaul commented Oct 7, 2016

👍 here

@acrellin
Copy link
Member Author

acrellin commented Oct 7, 2016

@bnaul took me a minute to see my typo... thanks


We gratefully accept contributions of new time-series features, be they
domain-specific or general. Please follow the below guidelines in order that
your features may be successfully incorporated into the Cesium feature base.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the below guidelines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanv bnaul offered to fill this out - he's going to contribute to my branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, great!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnaul still up for adding this? If not, I'd like to sit down for a few minutes together to get a better sense of what this needs to be.

If None, `model` must not be. Defaults to None.
model_options : dict, optional
Dictionary with hyperparameter values to be used in model building.
Keys are parameter names, values are the associated values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about saying what the keys are + what the associated values are and the type of structures they should be?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanv don't think I follow... "Keys are parameter names" seems pretty straightforward to me - what are you picturing beyond that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the context of model hyperparameters, it seems self-explanatory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is called model_options, so how about something along the lines of (please adjust as necessary):

model_parameters : dict, optional
    During hyper-parameter optimization, various model parameters are adjusted to give an 
    optimal fit.  This dictionary gives the different values that should be explored for each
    parameter.  E.g., `{'alpha': [1, 2], 'beta': [4, 5, 6]}` would fit models on all
    6 combinations of alpha and beta and compare the resulting models'
    goodness-of-fit.

params_to_optimize : list of str, optional
List of parameters to be optimized (whose corresponding entries
in `model_options` would be a list of values to try). If None,
parameters specified in `model_options` will be passed to model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what should be describe above.

model_type : str, optional
String indicating model to be used, e.g. "RandomForestClassifier".
If None, `model` must not be. Defaults to None.
model_parameters : dict, optional
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanv whatcha think of this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, this makes me wonder why we have a params_to_optimize dictionary. Why not just check each model_parameters entry, if it is a list, and the number of entries > 1, then hyper optimize, otherwise just use as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanv params_to_optimize is a list of strings (param names). The latter is because some parameter values are lists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't matter if you just put the list inside of a list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by that... Put the list inside of a list?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so you always have a list of parameters. If those parameters themselves are lists, then so be it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction - params_to_optimize is a dict. We need to split them at some point, so why not keep it as-is? I'll update these docs to reflect that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Ari, this look good.

@acrellin
Copy link
Member Author

@stefanv I've updated the docstrings - please take a look when you have a moment.

@bnaul
Copy link
Contributor

bnaul commented Oct 11, 2016

👍 from me

@bnaul
Copy link
Contributor

bnaul commented Oct 11, 2016

oh right still waiting on feature guidelines...do those live here or will it just say "see the same file in cesium-ml/cesium"?

@acrellin
Copy link
Member Author

It'll live here in CONTRIBUTING.md, which I've created.

@acrellin
Copy link
Member Author

I think the cesium_web docs can just refer here for those guidelines.

@acrellin
Copy link
Member Author

@stefanv I'd love to move on this and update CONTRIBUTING.md in a separate PR

@acrellin acrellin merged commit 3e36983 into cesium-ml:master Oct 13, 2016
@acrellin acrellin deleted the docs branch October 14, 2016 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants