I am trying to fit spline on my data having 5700 data samples (with duplicate x values ie. x: horizontal axis) using 'interp1d' function from package 'scipy' in python. I tried with lower order spline (k=1) and with the quadratic spline(k=2), cubic spline (k=3). And I am shocked to witness the weird response of 'spline' on my data.Although spline at 'k=1' made some sense but is ridiculously overfitting it(quadratic and cubic spline performed too bad).In my first trial, I used Polynomial fitting to fit the data and results were encouraging. I was expecting spline fitting will give results better than what I got with polynomial fitting.This is the result with splines. Please suggest me, where am I wrong?
Fitting spline to data with duplicate x using scipy (Python)
3.8k views Asked by B Singh At
1
There are 1 answers
Related Questions in MACHINE-LEARNING
- Trained ML model with the camera module is not giving predictions
- Keras similarity calculation. Enumerating distance between two tensors, which indicates as lists
- How to get content of BLOCK types LAYOUT_TITLE, LAYOUT_SECTION_HEADER and LAYOUT_xx in Textract
- How to predict input parameters from target parameter in a machine learning model?
- The training accuracy and the validation accuracy curves are almost parallel to each other. Is the model overfitting?
- ImportError: cannot import name 'HuggingFaceInferenceAPI' from 'llama_index.llms' (unknown location)
- Which library can replace causal_conv1d in machine learning programming?
- Fine-Tuning Large Language Model on PDFs containing Text and Images
- Sketch Guided Text to Image Generation
- My ICNN doesn't seem to work for any n_hidden
- Optuna Hyperband Algorithm Not Following Expected Model Training Scheme
- How can I resolve this error and work smoothly in deep learning?
- ModuleNotFoundError: No module named 'llama_index.node_parser'
- Difference between model.evaluate and metrics.accuracy_score
- Give Bert an input and ask him to predict. In this input, can Bert apply the first word prediction result to all subsequent predictions?
Related Questions in REGRESSION
- My MSE and MAE are low, but my R2 is not good, how to improve it?
- The regression problem of predicting multiple outputs from two-dimensional inputs
- "wrong model type for regression" when attempting multinomial model with caret
- Regression equation of a stacked difference-in-difference analysis in R
- Plotting multiple grouped scatter graphs with regression lines on the same axes
- Calculate RMSE for RF regression hyperparameter tuning in GEE encountering issue with error "(...)List<FeatureCollection>."
- Error in eval(predvars, data, env) : object 'Juice_practice' not found when running binary logistic regression in r
- GMMAT model fit and AIC
- Fitting a curve using Linear regression - CLS and NMF
- Specific Dataset causes the glm.nb fucntion to crash for no apparent reason when attempting to perform regression
- names of data do not match with tip labels Error in R phylolm with Missing Data
- Fixed effect panel regression gives coefficients for each year
- Time series model specification
- Inlier subset is incoherent with is_data_valid in RANSAC
- ANN Loss not reducing for Boston house price Data Set
Related Questions in INTERPOLATION
- How can I apply scipy.interpolate.RBFInterpolator on an image / ndarray?
- Is there a way to affect the interpolation between translucent colours in WPF?
- Interpolating 3D volumetric data with scipy's RegularGridInterpolator
- Getting interpolation out of nested for loops in python
- Coefficient for pandas.series.interpolate
- Scipy 2D interpolation not accomodating every point
- `pandas` datetime - correct way to do linear interpolation
- Terra::interpolate problem with quantiles prediction (R)
- Is there any c++ function similar to smoothbivariatespline from scipy.interpolate
- Interpolation from reanimated doesn't work on scroll indicator from inside flatlist
- Interpolation raster to a given point in R but controlling the interpolation area of influence
- The interpolate method in pandas.DataFrame.interpolate() doesn't interpolate or extrapolate time-series data correctly
- Interpolate array along first axis with scipy
- Using SciPy ndimage.zoom on an array with nan values
- How to interpolate missing values given a SpatRaster object in R Terra package?
Related Questions in CURVE-FITTING
- Mismatch between fitting curve and origin data
- Why does SciPy minimize return different solutions when minimizing sum of squared error versus root mean squared error?
- How can I fit my data better or shift my data? My fit is way below my data
- How to exclude abnormal data points and smooth the data before linear fitting
- Pyton curve fit returns completely wrong values for cosine wave
- Best fit of an increasing function that becomes constant
- Finding outlier points of a curve
- How is Maxfunevals used in the fit function of MATLAB
- How can I fit data to a Lennard-Jones potential in Gnuplot?
- Power law fit doesn't work in python: it's either way off or returns only the starting parameters
- Scipy's Curve Fit Can't Find Optimal Parameters
- Is there a function/approach to compare discrete with continuous data to calculate the x-shift needed to overlay them?
- Fitting Variable Number of Lorentzian Peaks to a glob of data in text files
- Fit for a parameter when the function is obtained by numerical integration in Python
- How to fit a logistic distribution use a fixed location parameter?
Related Questions in SPLINE
- Function for two-dimensional smooth spline in R?
- Formula to inverse a function of integral-splines
- Bidimensional splines, strictly increasing in one argument
- Spline in R terms and wording - degree of the polynom - degree of freedom - degree of continuity - basisspline
- Cubic spline coefficients from Scipy Interpolate
- Scipy 2D interpolation not accomodating every point
- How can I get the local curvature of a scipy.CubicSpline?
- Generating Bezier curves/splines that have consistent variable distance from generating function
- Plot Spline in R
- Vaadin chart XAxis setMax does not work in combined chart
- Is there any c++ function similar to smoothbivariatespline from scipy.interpolate
- How do I change background and zoom settings in Spline Scene
- How to know the exact Knot on spline the game object is on in Unity?
- Infinite [.WebGL-00003D440AA60E00] GL_INVALID_FRAMEBUFFER_OPERATION Warning When Using Spline Design in Next 14
- Plotting a BSpline in Python and in Mathematica
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If a data set has separate uniquely valued points for each X value, the effective weighting for each data point is 1.0. If however a single data point in that data set is doubled, or copied, once that single data point has an effective weight of 2.0.
If all data points in a data set are copied once, each point then has the same effective weight of 2.0 - that is, all data points will have the same weight.
If some data points in this data set have unique X values and some appear more than once, one approach is to average the Y values for the "duplicate" data points so that each point again has an effective weight of 1.0. This can sometimes work in the specific case I describe.