All Questions
464 questions
1
vote
2
answers
71
views
ElasticNetCV in Python: Get full grid of hyperparameters with corresponding MSE?
I have fitted a ElasticNetCV in Python with three splits:
import numpy as np
from sklearn.linear_model import LinearRegression
#Sample data:
num_samples = 100 # Number of samples
num_features = 1000 ...
0
votes
1
answer
189
views
Mlflow log_figure deletes artifact
I am running mlflow with autologging to track an xgboost model. By default, under artifacts it saves the model, requirements, and feature importances. Cool stuff I want to keep.
But, if I try to add ...
1
vote
1
answer
191
views
How to get immediate neighbors using a kd-tree irrespective of the spacing?
I want to find the immediate neighbours around a given point in a multidimensional space (up to 7 dimensions).
Important facts about the space:
non-linear spacing among points within a single ...
0
votes
1
answer
109
views
DataFrameMapper with sklearn2pmml Domains
I have a PMMLPipeline with the following DataFrameMapper inside (Domains are coming from sklearn2pmml, while the Mapper is from sklearn-pandas):
{'features': [(['A'],
[ContinuousDomain(dtype=<...
0
votes
1
answer
61
views
Custom classifier won't accept data from test_train_split in sklearn
I am attempting to write a custom classifier for use in a sklearn gridsearchCV pipeline.
I've stripped everything back to the bare minimum in the class which currently looks like this:
from sklearn....
1
vote
0
answers
231
views
Why is InterClusterDistance from yellowbrick failing with "AttributeError: 'NoneType' object has no attribute '_get_renderer'"
I am trying to initialize a InterClusterDistance visualizer from the yellowbrick library. When I execute the following:
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from ...
1
vote
0
answers
182
views
Using faster pandas groupby class on multiple columns
Short version:
I need help applying someone else's groupby class on multiple pandas columns and with more complicated functions.
Long version:
Someone else (Elizabeth Santorella) wrote a python class ...
0
votes
1
answer
76
views
Why are the kmeans centroids far from the data? Python
I'm making a kmeans model with the data from Twitter, but when I apply the polarity and subjectivity analysis on the scatterplot, the centroids (red x) appear far from the data:
from sklearn....
-1
votes
1
answer
237
views
Error when trying to fit a dataset. (python)
I am trying to fit a sklearn linear regression model with many points from a pandas dataframe. this is the program:
features =["floors", "waterfront", "lat", "...
0
votes
1
answer
292
views
How to get predict from string data in sklearn
When I convert data from a pandas dataframe to sklearn so I can make predictions. String data becomes problematic. So I used labelencoder but it seems to limit me to using the encoded data instead of ...
0
votes
1
answer
141
views
Count fruits on tree using ML sklearn
This my python code where I am try to predict the fruit count on tree using sklearn
but ran into issue code is given below:
import cv2
from sklearn.ensemble import RandomForestClassifier
def ...
0
votes
1
answer
315
views
How to use FunctionTransformer with a custom function?
I want to use FunctionTransformer to perform calculations between columns. For instance, I want to substract two columns and add the the new column to the dataset. So I have the function:
def diff(x, ...
-1
votes
1
answer
464
views
Polynomial Features Error: X has 10 features, but PolynomialFeatures is expecting 9 features as input
Today i'm modeling a dataframe using PolinomialFeatures from sklearn but I keep encountering this error: ValueError: X has 10 features, but PolynomialFeatures is expecting 9 features as input.
Coming ...
0
votes
2
answers
853
views
GridSearchCV instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator
I am doing a course in coursera and need to submit this last assignment in order to pass. However, I am unable to complete it. I encounter NotFittedError in line 16 of the code. Can someone help me to ...
1
vote
1
answer
285
views
Problems applying a Sklearn ML model to a datraframe pandas with multiple columns and data types
I need to predict the data from several columns of the pandas dataframe (ml_train_inputs), where there could be columns with several data types, for example: str, float, int, timestamp, etc. In this ...