Skip to content

document linearRegression #1390

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

Merged
merged 4 commits into from
Mar 31, 2023
Merged

document linearRegression #1390

merged 4 commits into from
Mar 31, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 25, 2023

for #1343

todo

  • I couldn't make sense of the reduce option, PTAL?

@Fil Fil requested a review from mbostock March 25, 2023 17:45
Comment on lines 27 to 29
/**
* 🌶 How is this used?
*/
reduce?: BinReducer;
Copy link
Member

@mbostock mbostock Mar 25, 2023

Choose a reason for hiding this comment

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

It’s from maybeDenseInterval. It’s the same idea as line and area. And it’s why LinearRegressionOptions extends BinOptions. For example for areaY you can specify an interval along x, and then reduce defaults to first to extract the first value in y for the current interval in x.

Edit: Though, perhaps our approach here could use some improvements. Like, perhaps this should be more of a select transform than a bin transform? Because I don’t think this is likely to work for channels that don’t end up getting binned by maybeDenseInterval. It might only appear to work today because we’ve only tested it on simple instantiations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've documented what works. Can you open an issue with what doesn't? (It's not clear to me what's missing here.)

Comment on lines 7 to 13
/**
* A channel for the dependent variable **x**.
*/
x?: ChannelValueSpec;
/**
* A channel for the dependent variable **y**.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these represent the dependent variable, and should probably go into their respective mark (x in linearRegressionX, and y in linearRegressionY)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mbostock mbostock force-pushed the fil/ts-linear-regression branch from 76af26c to 36fe65f Compare March 31, 2023 00:33
@mbostock mbostock enabled auto-merge (squash) March 31, 2023 00:56
@mbostock mbostock merged commit 814d2cd into main Mar 31, 2023
@mbostock mbostock deleted the fil/ts-linear-regression branch March 31, 2023 00:58
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* document linearRegression

* document reduce

* move dependent variable documentation to their respective marks; new lines
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.

2 participants