Skip to content

[SPARK-2550][MLLIB][APACHE SPARK] Support regularization and intercept in pyspark's linear methods - #1613

Closed
miccagiann wants to merge 11 commits into
apache:masterfrom
miccagiann:master
Closed

miccagiann wants to merge 11 commits into
apache:masterfrom
miccagiann:master

Conversation

@miccagiann

Copy link
Copy Markdown
Contributor

SPARK-2550
Python API doesn't provide options to set regularization parameter and intercept in linear methods, which should be fixed in v1.1.

@miccagiann miccagiann closed this Jul 28, 2014
@miccagiann miccagiann reopened this Jul 28, 2014
@miccagiann miccagiann changed the title [SPARK-2550](https://issues.apache.org/jira/browse/SPARK-2550?jql=project%20%3D%20SPARK%20AND%20resolution%20%3D%20Unresolved%20AND%20priority%20%3D%20Major%20ORDER%20BY%20key%20DESC) [MLLIB] [APACHE SPARK] Support regularization and intercept in pyspark's linear methods [SPARK-2550][MLLIB][APACHE SPARK] Support regularization and intercept in pyspark's linear methods Jul 28, 2014
@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@miccagiann

Copy link
Copy Markdown
Contributor Author

Hi AmplabJenkins,

I would like to ask you something technical. How is it possible to hide all my previous commits related to a previously closed pull request and only include to this pull request my last commit? Any suggestions?

@miccagiann miccagiann closed this Jul 28, 2014
@miccagiann miccagiann reopened this Jul 28, 2014
@JoshRosen

Copy link
Copy Markdown
Contributor

Hi @miccagiann,

Until it's merged, this pull request will be automatically updated to contain any commits added to the branch that you opened it from. It looks like you've opened this PR from the master branch of your repository and accidentally included some unwanted commits. I'd recommend closing this pull request, creating a new topic branch in your repository that contains only the commits that you want to be included in the pull request, and opening a new pull request based off that branch (you might find GitHub's "Using pull requests" guide to be helpful).

I like to keep my master branch in sync with the apache/spark repository and do my work in topic branches based off of it. To migrate from your current repository state to this workflow, I'd try doing something like this:

git fetch apache  # Fetch the latest commits from the upstream Spark repo
                  # (might be named something other than 'apache')
git checkout master
git checkout -b old-master  # Create a new branch pointing to the current master, so we don't lose those commits.
git checkout master  # Switch back to your master branch
git reset --hard apache/master  # Force-reset your master branch to match the apache master branch
git checkout -b my-feature-branch  # Create a new branch to develop your pull request in

Now you should be on my-feature-branch. Normally, you'd make commits against this feature branch, but in this case we want to grab some of the commits from your old master branch and apply them here. You can do that with cherry-pick:

git log old-master  # List the commits in your old branch
git cherry-pick sha-of-commit-you-want

Now, my-feature-branch should be in a good state, containing only the commits you want, and you should be able to push it to GitHub and open a new PR.

@srowen

srowen commented Jul 28, 2014

Copy link
Copy Markdown
Member

(PS AmplabJenkins is not a person, it's the Jenkins bot. It would blow my mind if he answered!)

Josh gives everything you need to know there to fix your setup. By the way, the command to update your miccagiann/master to match apache/master is git pull --rebase apache master (replace apache with what you've called the upstream remote) and git push origin master. That's all that should happen in your master. You would always begin working on a new change in a new branch from a freshly-synced master: it's the git checkout -b my-new-branch part.

@miccagiann

Copy link
Copy Markdown
Contributor Author

Thank you guys, I am going to resolve this issue.

@miccagiann

Copy link
Copy Markdown
Contributor Author

I am closing this pull request and I am going to create a new one that is going to include the new commit only. Thank you so much for your help!

@miccagiann miccagiann closed this Jul 28, 2014
github-actions Bot pushed a commit to MaxGekk/spark that referenced this pull request Nov 22, 2026
…ts (apache#1613)

<!-- title: [VARKA-631] Add rows 631 and 632 on sharing work between the math ports -->
### What changes were proposed in this pull request?

Adds two task rows to milestone 8's plan, both filed from the owner's question whether Spark's optimizer folds trigonometric expressions and whether Varka should.

Spark's optimizer has no rule that simplifies a trigonometric, exponential or logarithmic expression algebraically. Its generic `ConstantFolding` replaces a call whose arguments are all literals by one literal before planning, so Varka already receives the folded literal and has nothing to fold. An algebraic rewrite such as `exp(log(x))` to `x` would change the last bit, the NaN case and overflow, against the milestone's exact default, so Varka should not make one. What a kernel can add beyond Spark is sharing work between calls of one input without changing a result.

- Row 631: the fdlibm ports share the work they have in common when a projection calls several functions of one input: the argument reduction of `exp` and `expm1`, the hyperbolics over `expm1` and `exp`, and the exponent split of the logarithms. `sin`, `cos` and `tan` are per-lane `Math` calls with no port (`VARKA-345.md` 8, point 11), so they have no reduction to share. Each function stays bit-identical to its oracle (`StrictMath` for the thirteen fdlibm functions, `Math` where Spark calls it), and the saving is measured on the EPYC 7763 against the same projection with the sharing off.
- Row 632: what two calls of one port cost. `VARKA-559.md` 2.2 records that every map and set over IR nodes in `Analysis` and `Slots` is keyed by record equality with a cached hash, so two equal port trees already collapse; the open risk is 2.3's, that `equals` over two disjoint equal copies recurses once per path, and whether the grouping keeps the overlapping ports of one projection in one kernel. The row measures `exp(x)` and `exp(x) * 2` as two outputs (distinct ops, method bytes, compile time) and, if they do not cost once, builds a keyed intern of equal trees. With `cse` off the `exp` port's 68 distinct ops expand into loop methods of about 14,600 bytes (the unmerged 345b2, apache#1609), which is why its suite now runs with `cse` on.

Only `sql/varka/plans/m8/PLAN.md` changes.

### Why are the changes needed?

The rows record two open questions and the work they lead to, so that they are scheduled and read by the census and by row 354 at the close, instead of staying in a conversation. The issue tracker's task issues are created from the plan's rows.

### Review

`/code-review high` found that the first version of the two rows assumed `sin`, `cos` and `tan` ports the plan rules out and framed the question of sharing as identity against equality, which `VARKA-559.md` 2.2 already answers. Both rows were rewritten on that basis, and the other findings were fixed: the oracle per function, the dependencies and size of row 631, the unmerged source of the 14,600-byte reading, a checkable Done-when for row 632, and the provenance wording.

### Does this PR introduce _any_ user-facing change?

No. A plan change only.

### How was this patch tested?

`python3 dev/varka_plan_lint.py --check --offline` and `python3 dev/varka_quote_check.py` pass, and `python3 dev/varka_msg_check.py pr` accepts this description. No code runs.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Sonnet 5.5)
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.

4 participants