This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Optional | |
from sklearn.base import BaseEstimator, TransformerMixin | |
class OrthogonalPolynomialTransformer(BaseEstimator, TransformerMixin): | |
"""Transforms input data using orthogonal polynomials.""" | |
def __init__(self, degree: int = 1) -> None: | |
self.degree = degree + 1 # Account for constant term | |
self.norm2 = None | |
self.alpha = None |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For pybaseball (https://github.com/jldbc/pybaseball) | |
using DataFrames, PyCall, CSV | |
pybaseball = pyimport("pybaseball") | |
python_df = pybaseball.statcast("2021-04-06") | |
julia_df = CSV.read(IOBuffer(python_df.to_csv()), DataFrame) | |
# For baseballr (https://billpetti.github.io/baseballr/) | |
using RCall | |
@rlibarary baseballr | |
julia_df = rcopy(R"baseballr::scrape_statcast_savant(start_date = '2021-04-06', end_date = '2021-04-06')" |