id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_59594653 | stackoverflow | DATA_SCIENCE | what does the gamma parameter in SVM.SVC() actually do | what does the gamma parameter in SVM.SVC() actually do
I am trying to tune my SVM model which I built with different values of gamma and C.
Also, I have used scaled input data for my model training.
After trying with multiple combinations I did find a combination of gamma and C which gave the best accuracy,though w/o... | https://stackoverflow.com/questions/59594653/what-does-the-gamma-parameter-in-svm-svc-actually-do | machine-learning, scikit-learn, svm, data-science, svc | 1,578,170,418 |
se_78705509 | stackoverflow | DATA_SCIENCE | How to combine 3 annotated datasets into one file for further processing? | How to combine 3 annotated datasets into one file for further processing?
I have a dataset annotated by three people, so now I have three files. This dataset is about tweets annotation. How can I combine this dataset into one file for further processing. The data set is an excel file and contains five columns:
name t... | https://stackoverflow.com/questions/78705509/how-to-combine-3-annotated-datasets-into-one-file-for-further-processing | python, sql, data-science, data-annotations, data-preprocessing | 1,720,076,701 |
se_50392783 | stackoverflow | DATA_SCIENCE | Training Linear Models with MAE using sklearn in Python | Training Linear Models with MAE using sklearn in Python
I'm currently trying to train a linear model using sklearn in python but not with mean squared error (MSE) as error measure - but with mean absolute error (MAE). I specificially need a linear model with MAE as requirement from my professor at university.
I've lo... | https://stackoverflow.com/questions/50392783/training-linear-models-with-mae-using-sklearn-in-python | python, scikit-learn, data-science | 1,526,563,902 |
se_78689186 | stackoverflow | DATA_SCIENCE | Selenium doesn't find the popup button | Selenium doesn't find the popup button
I have this webpage (https://goldapple.ru/) on which I want to parse some data about cosmetics. However, when I open the webpage, the popup button appears, and I want to click the left "Да, верно". Unfortunately, the TimeoutException(message, screen, stacktrace) error appears... | https://stackoverflow.com/questions/78689186/selenium-doesnt-find-the-popup-button | python, selenium-webdriver, data-science, html-parsing | 1,719,765,407 |
se_78685188 | stackoverflow | DATA_SCIENCE | How to resolve TypeError: 'numpy.float64' object is not callable when calculating r2_score? | How to resolve TypeError: 'numpy.float64' object is not callable when calculating r2_score?
I am encountering the following error:
TypeError: 'numpy.float64' object is not callable
when I try to calculate the R2 score using scikit-learn's r2_score function. Below is the relevant portion of my code:
from sklea... | https://stackoverflow.com/questions/78685188/how-to-resolve-typeerror-numpy-float64-object-is-not-callable-when-calculatin | python, scikit-learn, regression, data-science | 1,719,640,960 |
se_76536106 | stackoverflow | DATA_SCIENCE | How can I convert an onnx model to coreml? | How can I convert an onnx model to coreml?
I am trying to convert an onnx model to a .mlmodel for use in ios. My ultimate goal is to use an ml model from Huggingface on ios. So far, the only way to convert a ml model to a .mlmodel file is by using coremltools.converters. I made a script to convert the model from huggi... | https://stackoverflow.com/questions/76536106/how-can-i-convert-an-onnx-model-to-coreml | python, pytorch, data-science, onnx, coremltools | 1,687,473,970 |
se_78687183 | stackoverflow | DATA_SCIENCE | LLama3 model fine tunning issue | LLama3 model fine tunning issue
I trained the llama3 model with the following code for a question and answer dataset (around 50 Q&A), but the retrained model does not give exact answers as per the trained dataset; either it gives a mix answer (combining multiple trained questions answers into a single) or it only give... | https://stackoverflow.com/questions/78687183/llama3-model-fine-tunning-issue | python-3.x, data-science, llama | 1,719,699,087 |
se_40294844 | stackoverflow | DATA_SCIENCE | Calculate T-Student [Test] for different standard Statistical tables in python | Calculate T-Student [Test] for different standard Statistical tables in python
I need calculate t-value using (alpha)/2 and df (degrees of freedom) for the next table:
https://www.fisterra.com/mbe/investiga/t_student/images/t_stud4.gif
test : t(n-1,alpha/2) and (gl = df)
I want to compute the value for (alpha/2, df) =... | https://stackoverflow.com/questions/40294844/calculate-t-student-test-for-different-standard-statistical-tables-in-python | python, scipy, statistics, data-science | 1,477,605,435 |
se_47775220 | stackoverflow | DATA_SCIENCE | How to plot multiple pandas columns | How to plot multiple pandas columns
I have dataframe total_year, which contains three columns (year, action, comedy).
How can I plot two columns (action and comedy) on y-axis?
My code plots only one:
total_year[-15:].plot(x='year', y='action', figsize=(10,5), grid=True) | https://stackoverflow.com/questions/47775220/how-to-plot-multiple-pandas-columns | python, pandas, matplotlib, plot, data-science | 1,513,089,522 |
se_53619618 | stackoverflow | DATA_SCIENCE | Using networkx to create node labels from an array | Using networkx to create node labels from an array
I have some nodes that are being generated from a numpy adjacency matrix. I also have an array of labels for said nodes already where node 0 in the matrix corresponds to label 0 in the array. What is the easiest way to apply those labels to the nodes in the graph? | https://stackoverflow.com/questions/53619618/using-networkx-to-create-node-labels-from-an-array | python, graph, data-science, networkx | 1,543,949,535 |
se_72223744 | stackoverflow | DATA_SCIENCE | Extract YouTube Channel Community Feed Data | Extract YouTube Channel Community Feed Data
I am trying to collect the community feed data from a channel for analytics.
I couldn't find a way using the YouTube Data API v3. Is there a way to extract such data?
The data I would like to extract is in the community feed. For instance, it's a community feed from Dr. Bhar... | https://stackoverflow.com/questions/72223744/extract-youtube-channel-community-feed-data | youtube, youtube-api, data-science, youtube-data-api | 1,652,407,678 |
se_72855092 | stackoverflow | DATA_SCIENCE | Pytorch Runtime Error: efficientnet freeze layers by setting requires grad = false | Pytorch Runtime Error: efficientnet freeze layers by setting requires grad = false
I want to freeze the layers in pytorch efficentnet model. My usual way of dooing this doesn't work.
from torchvision.models import efficientnet_b0
from torch import nn
from torch import optim
efficientnet_b0_fine = efficientnet_b0(pret... | https://stackoverflow.com/questions/72855092/pytorch-runtime-error-efficientnet-freeze-layers-by-setting-requires-grad-fal | pytorch, data-science, torch, torchvision | 1,656,929,590 |
se_70690081 | stackoverflow | DATA_SCIENCE | Xarray combine datasets with different dimensions? | Xarray combine datasets with different dimensions?
I'm trying to merge two Xarray datasets. The resolutions of the datasets are different (one has more points than the other). Ultimately, I need to multiply the values together into one dataset.
I need it to be pretty fast, so nested "for" loops through x and y coordin... | https://stackoverflow.com/questions/70690081/xarray-combine-datasets-with-different-dimensions | pandas, numpy, data-science, python-xarray, grib | 1,642,033,807 |
se_72485095 | stackoverflow | DATA_SCIENCE | SQL - Expand column of arrays into column of elements | SQL - Expand column of arrays into column of elements
I have a SQL table, and one column of the table has type text[]. I want to create write a query that will create a new table, which consists of all arrays flattened and concatenated. Ex: If there are 3 items in the table, and the array entry for each of those items... | https://stackoverflow.com/questions/72485095/sql-expand-column-of-arrays-into-column-of-elements | sql, database, postgresql, data-science | 1,654,234,297 |
se_53940258 | stackoverflow | DATA_SCIENCE | SVC classifier taking too much time for training | SVC classifier taking too much time for training
I am using SVC classifier with Linear kernel to train my model.
Train data: 42000 records
model = SVC(probability=True)
model.fit(self.features_train, self.labels_train)
y_pred = model.predict(self.features_test)
train_accuracy = model.score(self.featur... | https://stackoverflow.com/questions/53940258/svc-classifier-taking-too-much-time-for-training | machine-learning, deep-learning, data-science | 1,545,889,410 |
se_74725071 | stackoverflow | DATA_SCIENCE | creating data frame from text file | creating data frame from text file
I have a dataset of over 1000 txt files which contains information of books
The Project Gutenberg EBook of Apocolocyntosis, by Lucius Seneca
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use i... | https://stackoverflow.com/questions/74725071/creating-data-frame-from-text-file | python, pandas, dataframe, csv, data-science | 1,670,468,716 |
se_76497300 | stackoverflow | DATA_SCIENCE | Why Remove Trend and Seasonality in Time Series Forecasting? | Why Remove Trend and Seasonality in Time Series Forecasting?
I am struggling to understand why we need to remove trend and seasonality components from non-stationary time series data when performing time series forecasting in Python. Won't removing these components affect the accuracy of the forecasted data, since we ... | https://stackoverflow.com/questions/76497300/why-remove-trend-and-seasonality-in-time-series-forecasting | python, time-series, data-science, forecasting | 1,687,021,900 |
se_66159923 | stackoverflow | DATA_SCIENCE | Pandas - take() does not accept boolean indexers | Pandas - take() does not accept boolean indexers
I need to create the new Dataframe from old df, that contains defined columns.
model_columns = ['dist', 'date_day', 'is_holiday', 'date_dayofweek', 'date_month',
'tech', 'cap', 'HEIGHT', 'AZIMUTH', 'x', 'y'] // and other columns
X_train = df_train[mode... | https://stackoverflow.com/questions/66159923/pandas-take-does-not-accept-boolean-indexers | python, pandas, data-science | 1,613,065,328 |
se_74063122 | stackoverflow | DATA_SCIENCE | is there any way to monitor resources used by my Jupyter notebook in visual studio code? | is there any way to monitor resources used by my Jupyter notebook in visual studio code?
recently, I fell in love with jupyter notebook in vs-code. but I got into trouble while I was trying to profile my code. I was looking for something similar as in google-colab or even the original browser base jupyter-nb. I'm actu... | https://stackoverflow.com/questions/74063122/is-there-any-way-to-monitor-resources-used-by-my-jupyter-notebook-in-visual-stud | python, jupyter-notebook, data-science, monitoring | 1,665,707,069 |
se_74843702 | stackoverflow | DATA_SCIENCE | ValueError: Expected 2D array, got 1D array instead | ValueError: Expected 2D array, got 1D array instead
I'm a beginner in Data Science and I'm currently working on building a model for the IBM Employee Attrition Dataset. How do I get around this error?
# LogisticRegression
from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn.mode... | https://stackoverflow.com/questions/74843702/valueerror-expected-2d-array-got-1d-array-instead | python, model, regression, data-science, logistic-regression | 1,671,390,406 |
se_44727981 | stackoverflow | DATA_SCIENCE | R's browser() equivalent in Python | R's browser() equivalent in Python
The title says it all. When you are working R and using RStudio, its really easy and simple to debug something by dropping a browser() call anywhere in your code and seeing what goes wrong. Is there a way to do that with Python? I'm slowly getting very sick of print statement d... | https://stackoverflow.com/questions/44727981/rs-browser-equivalent-in-python | python, r, debugging, data-science | 1,498,243,042 |
se_71363525 | stackoverflow | DATA_SCIENCE | Jupyter notebook interface different | Jupyter notebook interface different
I am following a video lecture series on YT to learn pandas. The jupyter notebook interface is different on my pc and in the tutorial.
This is the interface in the tutorial:
Original Interface
This is the interface that I see:
My interface:
As it is clearly seen, the interface in t... | https://stackoverflow.com/questions/71363525/jupyter-notebook-interface-different | python, pandas, jupyter-notebook, data-science, jupyter | 1,646,494,594 |
se_53275420 | stackoverflow | DATA_SCIENCE | how can I set Enviroment Variables for data science mode of vscode? | how can I set Enviroment Variables for data science mode of vscode?
I am using data science mode of vscode.
When vscode runs the jupyter kernel, can I add the desired path to PYTHONPATH of jupyter kernel?
In other cases, I used "env" of launch.json, but I can not find the way to set it up in data science mode. | https://stackoverflow.com/questions/53275420/how-can-i-set-enviroment-variables-for-data-science-mode-of-vscode | python, visual-studio-code, jupyter, data-science | 1,542,092,177 |
se_57281177 | stackoverflow | DATA_SCIENCE | Weighting a regression CNN for imbalanced data? | Weighting a regression CNN for imbalanced data?
I have a CNN for regression that takes an image and outputs a float 0-10. My model is doing okay, but I have a serious problem with imbalanced data, making my model predict between 6-8 for almost all images, but achieving a decent mean squared error. I know of people wei... | https://stackoverflow.com/questions/57281177/weighting-a-regression-cnn-for-imbalanced-data | tensorflow, deep-learning, regression, conv-neural-network, data-science | 1,564,528,237 |
se_75357936 | stackoverflow | DATA_SCIENCE | How to install Detectron2 | How to install Detectron2
I am installing layout-parser and following this link. Did not face any issues with the following packages.
pip install layoutparser
pip install "layoutparser[effdet]"
pip install layoutparser torchvision
pip install "layoutparser[paddledetection]"
pip install "layoutparser... | https://stackoverflow.com/questions/75357936/how-to-install-detectron2 | python, nlp, data-science, ocr, python-3.10 | 1,675,664,351 |
se_56896063 | stackoverflow | DATA_SCIENCE | How can I write some code that ask to user to load a file | How can I write some code that ask to user to load a file
I'm building a tool for the company where I work and I've built a program that returns different statistics from any csv file, of course with an specific data structure. Now, my issue is that I don't know how to do is to request the user to upload a file.
In o... | https://stackoverflow.com/questions/56896063/how-can-i-write-some-code-that-ask-to-user-to-load-a-file | python, pandas, data-science | 1,562,296,021 |
se_73892926 | stackoverflow | DATA_SCIENCE | What is the difference between Databricks and Spark? | What is the difference between Databricks and Spark?
I am trying to a clear picture of how they are interconnected and if the use of one always require the use of the other. If you could give a non-technical definition or explanation of each of them, I would appreciate it.
Please do not paste a technical definition of... | https://stackoverflow.com/questions/73892926/what-is-the-difference-between-databricks-and-spark | database, apache-spark, data-science, azure-databricks | 1,664,442,128 |
se_72141358 | stackoverflow | DATA_SCIENCE | Python cant find database if script is run from other file | Python cant find database if script is run from other file
Solved in comment
I have this struggle with a dataheavy project. I can run a file that uses a query file -- Al the query's and converters are in here -- without problems, but when I run a file that runs that file again, I get an error that the db cant be found... | https://stackoverflow.com/questions/72141358/python-cant-find-database-if-script-is-run-from-other-file | python, sqlite, data-science | 1,651,839,467 |
se_64706593 | stackoverflow | DATA_SCIENCE | How do I get the correct weights using Markowitz | How do I get the correct weights using Markowitz
I need some help. I´m trying to run a Markowitz Model for multiple portfolios (different weights) with the same assets. But I´d like a function that seeks for a given risk and/or returns on all possible portfolios and returns it´s weights.
My code:
returns_portfolio = [... | https://stackoverflow.com/questions/64706593/how-do-i-get-the-correct-weights-using-markowitz | python, data-science, quantitative-finance | 1,604,617,537 |
se_64039015 | stackoverflow | DATA_SCIENCE | Is there any way to work with NetCDF files in Nim? | Is there any way to work with NetCDF files in Nim?
I've discovered Nim some days ago and am really interested in it.
However, I need to know if I'd able to work with NetCDF files (or at least GRB files) to see if it is suitable for my every-day life.
I've searched the web for some library or code, but couldn't find an... | https://stackoverflow.com/questions/64039015/is-there-any-way-to-work-with-netcdf-files-in-nim | data-science, netcdf, nim-lang | 1,600,917,318 |
se_55161958 | stackoverflow | DATA_SCIENCE | Python file naming convention for data science projects | Python file naming convention for data science projects
What is the correct naming convention for files in a data science and machine learning project?
I believe the file name of the Python classes should be a noun. However, I want to make it clear that whether to name the class as a subject noun or object noun.
Whi... | https://stackoverflow.com/questions/55161958/python-file-naming-convention-for-data-science-projects | python, naming-conventions, data-science | 1,552,564,612 |
se_52889647 | stackoverflow | DATA_SCIENCE | How to read an ORC file stored locally in Python Pandas? | How to read an ORC file stored locally in Python Pandas?
Can I think of an ORC file as similar to a CSV file with column headings and row labels containing data? If so, can I somehow read it into a simple pandas dataframe? I am not that familiar with tools like Hadoop or Spark, but is it necessary to understand them j... | https://stackoverflow.com/questions/52889647/how-to-read-an-orc-file-stored-locally-in-python-pandas | python, pandas, pyspark, data-science, orc | 1,539,941,599 |
se_74207648 | stackoverflow | DATA_SCIENCE | how to convert the unstructured data to structured data using pandas | how to convert the unstructured data to structured data using pandas
I have a bunch of huge sensor data which is in excel file the data something looks like json format(not exactly)need to parse the data i dont have any idea the data something looks like this
FM4 [Priority=0] [GPS element=[X=776517049] [Y=128887449] [... | https://stackoverflow.com/questions/74207648/how-to-convert-the-unstructured-data-to-structured-data-using-pandas | json, pandas, numpy, data-science | 1,666,786,703 |
se_56493506 | stackoverflow | DATA_SCIENCE | Deciding on how to scale data and which scaler to use? | Deciding on how to scale data and which scaler to use?
I am trying to train an MLP model with two Dense layers in keras to do prediction for a small data set of around 100 uni-variate time series. This model should get values of 6 days and predict the 7th day value. As an input to the model, I first concatenate these ... | https://stackoverflow.com/questions/56493506/deciding-on-how-to-scale-data-and-which-scaler-to-use | python, statistics, time-series, data-science, scaling | 1,559,907,061 |
se_63384220 | stackoverflow | DATA_SCIENCE | Pyspark: Forward filling nulls with last value | Pyspark: Forward filling nulls with last value
I have a dataframe similar to this:
values = [
("2019-10-01", "004", 1.0),
("2019-10-02", "005", None),
("2019-10-03", "004", 2.0),
("2019-10-04", "004", 1.0),
("2019-10-05", "006", None)
]
df = spark.createDataFrame(values, ['time', 'mode', 'value'... | https://stackoverflow.com/questions/63384220/pyspark-forward-filling-nulls-with-last-value | python, pandas, apache-spark, pyspark, data-science | 1,597,263,795 |
se_60649486 | stackoverflow | DATA_SCIENCE | Line Chart with Custom Confidence Interval in Altair | Line Chart with Custom Confidence Interval in Altair
Suppose i have the data frame below:
I checked the documentation but it's only based on a single column.
Reproducible code:
x = np.random.normal(100,5,100)
data = pd.DataFrame(x)
epsilon = 10
data.columns = ['x']
data['lower'] = x - epsilon
data['upper'] = x +... | https://stackoverflow.com/questions/60649486/line-chart-with-custom-confidence-interval-in-altair | python-3.x, machine-learning, data-science, altair | 1,583,998,629 |
se_63610626 | stackoverflow | DATA_SCIENCE | Pytorch geometric: Having issues with tensor sizes | Pytorch geometric: Having issues with tensor sizes
This is the first time I'm using Pytorch and Pytorch geometric. I'm trying to create a simple Graph Neural Network with Pytorch Geometric. I'm creating a custom dataset by following the Pytorch Geometric documentations and extending the InMemoryDataset. After that I s... | https://stackoverflow.com/questions/63610626/pytorch-geometric-having-issues-with-tensor-sizes | python, machine-learning, pytorch, data-science | 1,598,511,143 |
se_64899361 | stackoverflow | DATA_SCIENCE | Kaggle Dataset - Letter and numbers meaning | Kaggle Dataset - Letter and numbers meaning
I have come across some data on Kaggle. https://www.itl.nist.gov/div898/strd/nls/data/LINKS/DATA/MGH09.dat
I am trying to insert this to excel by copy and pasting it. What do the letters and numbers mean? How would this data look once it was converted? | https://stackoverflow.com/questions/64899361/kaggle-dataset-letter-and-numbers-meaning | math, statistics, data-science, kaggle, mathsat | 1,605,725,038 |
se_51297423 | stackoverflow | DATA_SCIENCE | Plot scikit-learn (sklearn) SVM decision boundary / surface | Plot scikit-learn (sklearn) SVM decision boundary / surface
I am currently performing multi class SVM with linear kernel using python's scikit library.
The sample training data and testing data are as given below:
Model data:
x = [[20,32,45,33,32,44,0],[23,32,45,12,32,66,11],[16,32,45,12,32,44,23],[120,2,55,62,82,1... | https://stackoverflow.com/questions/51297423/plot-scikit-learn-sklearn-svm-decision-boundary-surface | python, machine-learning, scikit-learn, data-science, svm | 1,531,370,603 |
se_70587853 | stackoverflow | DATA_SCIENCE | Sagemaker studio does not load up | Sagemaker studio does not load up
Sagemaker Studio worked flawlessly for me for the first 6 months. Then I started observing this issue. Screenshot of the error message
The screen holds up at this stage forever. Here's what I have tried:
Clearing my cache, even using a different machine. So I don't think the issue li... | https://stackoverflow.com/questions/70587853/sagemaker-studio-does-not-load-up | amazon-web-services, machine-learning, artificial-intelligence, data-science, amazon-sagemaker | 1,641,357,429 |
se_75102134 | stackoverflow | DATA_SCIENCE | mat1 and mat2 must have the same dtype | mat1 and mat2 must have the same dtype
I'm trying to build a neural network to predict per-capita-income for counties in US based on the education level of their citizens.
X and y have the same dtype (I have checked this) but I'm getting an error.
Here is my data:
county_FIPS state county per_capita_perso... | https://stackoverflow.com/questions/75102134/mat1-and-mat2-must-have-the-same-dtype | python, machine-learning, pytorch, data-science | 1,673,556,351 |
se_63220629 | stackoverflow | DATA_SCIENCE | Inverse of numpy.gradient function | Inverse of numpy.gradient function
I need to create a function which would be the inverse of the np.gradient function.
Where the Vx,Vy arrays (Velocity component vectors) are the input and the output would be an array of anti-derivatives (Arrival Time) at the datapoints x,y.
I have data on a (x,y) grid with scalar val... | https://stackoverflow.com/questions/63220629/inverse-of-numpy-gradient-function | python, numpy, scipy, data-science, numerical-integration | 1,596,399,519 |
se_62216146 | stackoverflow | DATA_SCIENCE | Data scraping from Vivino.com | Data scraping from Vivino.com
I am trying to collect data from vivino.com and the DataFrame comes out empty, I can see that my soup is collecting the website info, but can't see where my error is.
My code:
def get_data():
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101... | https://stackoverflow.com/questions/62216146/data-scraping-from-vivino-com | python, pandas, web-scraping, beautifulsoup, data-science | 1,591,362,658 |
se_75316841 | stackoverflow | DATA_SCIENCE | How to find the median number of events per year? Pandas group by datascience question | How to find the median number of events per year? Pandas group by datascience question
I have a dataset where each row is an an event of terrorism and I want to find the median number of people killed per attack in each country-year unit. In df1, each row is an event of terrorism with columns iyear, country, nkill, an... | https://stackoverflow.com/questions/75316841/how-to-find-the-median-number-of-events-per-year-pandas-group-by-datascience-qu | python, pandas, group-by, data-science, median | 1,675,290,360 |
se_50860429 | stackoverflow | DATA_SCIENCE | Some questions about Valve's Steam Web API - Fetching Dota 2 Match History | Some questions about Valve's Steam Web API - Fetching Dota 2 Match History
I wanted to write a little program to analyse the Dota 2 matches in order to program a Hero Picking Tool. If there will be some machine learning, is still up to decide for me
I just checked out the Steam Web API documentation and wrote a li... | https://stackoverflow.com/questions/50860429/some-questions-about-valves-steam-web-api-fetching-dota-2-match-history | data-science, steam, steam-web-api | 1,528,988,209 |
se_72379755 | stackoverflow | DATA_SCIENCE | How to use a csv with header for sagemaker batch transform? | How to use a csv with header for sagemaker batch transform?
I am performing a sagemaker batch transform using a transformer created out of an xgboost estimator. The csv input for prediction/batch transform has both, an ID column and a header (with names of columns). For example, something like this:
Name
Age
Height... | https://stackoverflow.com/questions/72379755/how-to-use-a-csv-with-header-for-sagemaker-batch-transform | amazon-web-services, data-science, amazon-sagemaker, jsonpath, json-path-expression | 1,653,489,888 |
se_76620772 | stackoverflow | DATA_SCIENCE | How to fix a data fetching function in python using sql query? | How to fix a data fetching function in python using sql query?
I have developed a function which uses parametrized sql based on user input to fetch records. However, I am facing a type mismatch problem in the where clause of the query. please help me fix it.
Start_Date and End_Date are string stype whereas record_date... | https://stackoverflow.com/questions/76620772/how-to-fix-a-data-fetching-function-in-python-using-sql-query | python, sql, data-science, analytics, dremio | 1,688,563,202 |
se_76471584 | stackoverflow | DATA_SCIENCE | Difference between Word2Vec and contextual embedding | Difference between Word2Vec and contextual embedding
am trying to understand the difference between word embedding and contextual embedding.
below is my understanding, please add if you find any corrections.
word embedding algorithm has a global vocabulary (dictionary) of words. when we are performing word2vec then th... | https://stackoverflow.com/questions/76471584/difference-between-word2vec-and-contextual-embedding | machine-learning, deep-learning, nlp, data-science | 1,686,731,617 |
se_62712282 | stackoverflow | DATA_SCIENCE | My neural network only predicts one thing | My neural network only predicts one thing
I am trying to implement it on python from scratch. I tried a lot but couldn't find the bug in my implementation. Whenever I use my 'predict' function it always outputs, 0.
I have also tested each and every function that you'll see in my code below using random arrays of the s... | https://stackoverflow.com/questions/62712282/my-neural-network-only-predicts-one-thing | python, machine-learning, deep-learning, neural-network, data-science | 1,593,767,813 |
se_72948209 | stackoverflow | DATA_SCIENCE | clustering of a fasta file having DNA sequences to find the most unmatched clone | clustering of a fasta file having DNA sequences to find the most unmatched clone
I am trying to make a cluster to analyze DNA sequences and find the less matched patterns among them (for say <25% match).
Is it possible to perform cluster analysis (k-means or any other approach) for the DNA in a fasta file.
for example... | https://stackoverflow.com/questions/72948209/clustering-of-a-fasta-file-having-dna-sequences-to-find-the-most-unmatched-clone | python, data-science, cluster-analysis, biopython | 1,657,609,083 |
se_76313592 | stackoverflow | DATA_SCIENCE | import langchain => Error : TypeError: issubclass() arg 1 must be a class | import langchain => Error : TypeError: issubclass() arg 1 must be a class
I want to use langchain for my project.
so I installed it using following command : pip install langchain
but While importing "langchain" I am facing following Error:
File /usr/lib/python3.8/typing.py:774, in _GenericAlias.__subclasscheck__(s... | https://stackoverflow.com/questions/76313592/import-langchain-error-typeerror-issubclass-arg-1-must-be-a-class | python, nlp, data-science, chatbot, langchain | 1,684,836,587 |
se_76603178 | stackoverflow | DATA_SCIENCE | Self-querying retrieval in langchain returning only 4 results | Self-querying retrieval in langchain returning only 4 results
I want all the articles related to specific tag example sustainability from documents. But it is only returing me Four articles. There are total 7 articles related to sustainability in vectorstore out of 20 articles.
Here is my code:
import pinecone
from la... | https://stackoverflow.com/questions/76603178/self-querying-retrieval-in-langchain-returning-only-4-results | python, python-3.x, machine-learning, data-science, langchain | 1,688,373,941 |
se_58965317 | stackoverflow | DATA_SCIENCE | Implementing AIC score for multiple linear regression manually | Implementing AIC score for multiple linear regression manually
I have implemented a multiple linear regression class by hand and right now I am working on the metrics methods. I have tried to calculate the AIC and BIC scores manually, but the results weren't correct. The reason is that I didn't use the Log Likelihood ... | https://stackoverflow.com/questions/58965317/implementing-aic-score-for-multiple-linear-regression-manually | python, python-3.x, machine-learning, linear-regression, data-science | 1,574,295,119 |
se_51412473 | stackoverflow | DATA_SCIENCE | Is Seq2Seq the right model for my data? Any examples? | Is Seq2Seq the right model for my data? Any examples?
I'm trying to train a model to predict design patterns from web pages. I'm using coordinates of bounding rects given a bunch of element groupings. Patterns look like this:
[[elementId, width, height, x, y]]
so my target would be the [[x,y]] given [[elementId, wid... | https://stackoverflow.com/questions/51412473/is-seq2seq-the-right-model-for-my-data-any-examples | python, machine-learning, keras, data-science, pytorch | 1,531,958,130 |
se_76279419 | stackoverflow | DATA_SCIENCE | AttributeError: 'FloatProgress' object has no attribute 'style' | AttributeError: 'FloatProgress' object has no attribute 'style'
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
import stanza
stanza.download('en')
nlp = stanza.Pipeline(lang='en')
above code used for Creating a Pipeline
Stanza provides a plethora of pre-tr... | https://stackoverflow.com/questions/76279419/attributeerror-floatprogress-object-has-no-attribute-style | jupyter-notebook, data-science, tqdm, stanza | 1,684,401,799 |
se_64209196 | stackoverflow | DATA_SCIENCE | How to update a previous run into MLFlow? | How to update a previous run into MLFlow?
I would like to update previous runs done with MLFlow, ie. changing/updating a parameter value to accommodate a change in the implementation. Typical uses cases:
Log runs using a parameter A, and much later, log parameters A and B. It would be useful to update the value of pa... | https://stackoverflow.com/questions/64209196/how-to-update-a-previous-run-into-mlflow | logging, data-science, mlflow | 1,601,903,047 |
se_75103543 | stackoverflow | DATA_SCIENCE | Is it possible to write a single dbt test which applies to all tables in the whole project? | Is it possible to write a single dbt test which applies to all tables in the whole project?
To ensure that new data is constantly arriving in Snowflake without interruption, I want to add some tests to my dbt project. I want to use freshness_anomalies test in Elementary, which is a package supporting dbt.
I can't figu... | https://stackoverflow.com/questions/75103543/is-it-possible-to-write-a-single-dbt-test-which-applies-to-all-tables-in-the-who | snowflake-cloud-data-platform, data-science, dbt, anomaly-detection | 1,673,567,963 |
se_56343657 | stackoverflow | DATA_SCIENCE | How to pass different set of data to train and test without splitting a dataframe. (python)? | How to pass different set of data to train and test without splitting a dataframe. (python)?
I have gone through multiple questions that help divide your dataframe into train and test, with scikit, without etc.
But my question is I have 2 different csvs ( 2 different dataframes from different years). I want to use on... | https://stackoverflow.com/questions/56343657/how-to-pass-different-set-of-data-to-train-and-test-without-splitting-a-datafram | python, scikit-learn, linear-regression, data-science, training-data | 1,559,051,123 |
se_48542473 | stackoverflow | DATA_SCIENCE | Keras LSTM - Validation Loss Increasing From Epoch #1 | Keras LSTM - Validation Loss Increasing From Epoch #1
I'm currently undertaking my first 'real' DL project of (surprise) predicting stock movements. I know that I'm 1000:1 to make anything useful but I'm enjoying it and want to see it through, I've learnt more in my few weeks of attempting this than I have in the prio... | https://stackoverflow.com/questions/48542473/keras-lstm-validation-loss-increasing-from-epoch-1 | python, machine-learning, keras, deep-learning, data-science | 1,517,402,436 |
se_48197227 | stackoverflow | DATA_SCIENCE | Data Science Model and Training - Understanding | Data Science Model and Training - Understanding
Coming from a programming background where you write code, test, deploy, run.. I'm trying to wrap my head around the concept of "training a model" or a "trained model" in data science, and deploying that trained model.
I'm not really concerned about the deployment envi... | https://stackoverflow.com/questions/48197227/data-science-model-and-training-understanding | python, machine-learning, artificial-intelligence, jupyter-notebook, data-science | 1,515,623,787 |
se_70909861 | stackoverflow | DATA_SCIENCE | "AttributeError: 'Index' object has no attribute 'tz_localize'" while using the function history to extract stock information | "AttributeError: 'Index' object has no attribute 'tz_localize'" while using the function history to extract stock information
I'm trying to extract information of the Tesla stock but, I always get the error while coding it. Here's the code so far:
import plotly.graph_objects as go
import yfin... | https://stackoverflow.com/questions/70909861/attributeerror-index-object-has-no-attribute-tz-localize-while-using-the | python, data-science, ibm-cloud, watson-studio | 1,643,491,553 |
se_76161673 | stackoverflow | DATA_SCIENCE | Difference between Logistic Regression and Decision Trees | Difference between Logistic Regression and Decision Trees
I was Studying Decision Trees and understood that it generally is used in Classification Problems.
But the Logistic Regression is also used in Classification Problems only.
So I searched everywhere on the internet but didn't got any satisfying results. I am rea... | https://stackoverflow.com/questions/76161673/difference-between-logistic-regression-and-decision-trees | algorithm, machine-learning, data-science, logistic-regression, decision-tree | 1,683,101,070 |
se_58677241 | stackoverflow | DATA_SCIENCE | smallest float dtype for pandas/minimizing size of transform | smallest float dtype for pandas/minimizing size of transform
I have a data frame with 17000 columns and 50000 rows of integer values (~1 GB).
I'm dividing each column of the dataframe by the sum of the column (e.g. normalizing the data).
I need to specify the dtype, because otherwise I end up with an output file that... | https://stackoverflow.com/questions/58677241/smallest-float-dtype-for-pandas-minimizing-size-of-transform | pandas, dataframe, floating-point, data-science | 1,572,752,152 |
se_73443407 | stackoverflow | DATA_SCIENCE | SVM problem - name 'model_SVC' is not defined | SVM problem - name 'model_SVC' is not defined
I have a problem with this code:
from sklearn import svm
model_SVC = SVC()
model_SVC.fit(X_scaled_df_train, y_train)
svm_prediction = model_SVC.predict(X_scaled_df_test)
The error message is
NameError
Traceback (most recent call
last) ~\AppData\Lo... | https://stackoverflow.com/questions/73443407/svm-problem-name-model-svc-is-not-defined | python, machine-learning, scikit-learn, data-science, svm | 1,661,162,895 |
se_70277650 | stackoverflow | DATA_SCIENCE | Is there any other way (to combine values of one column into different groups), instead of using 'df.replace( )' several times in the below problem? | Is there any other way (to combine values of one column into different groups), instead of using 'df.replace( )' several times in the below problem?
In :
char_df['Loan_Title'].unique()
Out:
array(['debt consolidation', 'credit card refinancing',
'home improvement', 'credit consolidation', 'green loan',... | https://stackoverflow.com/questions/70277650/is-there-any-other-way-to-combine-values-of-one-column-into-different-groups | python, pandas, machine-learning, data-science, feature-engineering | 1,638,977,737 |
se_44240145 | stackoverflow | DATA_SCIENCE | csv stream for machine learning algorithms | csv stream for machine learning algorithms
I have a big CSV file (around 5GB).
I am trying to read line by line the whole file and try to apply the most typikal algorithms (SVM, Naive Bayes, Linear Regression, etc).
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
i_f = open('top2Mmm.... | https://stackoverflow.com/questions/44240145/csv-stream-for-machine-learning-algorithms | python, algorithm, csv, machine-learning, data-science | 1,496,053,396 |
se_62682342 | stackoverflow | DATA_SCIENCE | " ValueWarning: No supported index is available. Prediction results will be given with an integer index beginning at `start` " | " ValueWarning: No supported index is available. Prediction results will be given with an integer index beginning at `start` "
Why we are getting this error when we predict or forecast using Statsmodels " SARIMAX "?.
I am just passing the start and end of Index and steps that need to take into consideration.... | https://stackoverflow.com/questions/62682342/valuewarning-no-supported-index-is-available-prediction-results-will-be-give | machine-learning, time-series, data-science, statsmodels | 1,593,624,806 |
se_61717970 | stackoverflow | DATA_SCIENCE | Is there a way to forecast sales for multiple products across multiple stores? | Is there a way to forecast sales for multiple products across multiple stores?
My Data is in this format(Both Multiple and Multivariate Timeseries)
I need to predict number of units sold is gonna be for every product across different stores(Store 1,Store 2,Store 3) using time-series model.
I have scaled down the ... | https://stackoverflow.com/questions/61717970/is-there-a-way-to-forecast-sales-for-multiple-products-across-multiple-stores | python, time-series, data-science, arima, facebook-prophet | 1,589,140,683 |
se_69069384 | stackoverflow | DATA_SCIENCE | how write percentage symbol in math mode jupyter notebook | how write percentage symbol in math mode jupyter notebook
When I write % in between $$ $$ it looks like this. please help me in this | https://stackoverflow.com/questions/69069384/how-write-percentage-symbol-in-math-mode-jupyter-notebook | jupyter-notebook, data-science | 1,630,905,309 |
se_52401225 | stackoverflow | DATA_SCIENCE | How to run clustering with categorical variables | How to run clustering with categorical variables
I'm trying to run clustering only with categorical variables. Since Kmeans is applicable only for Numeric data, are there any clustering techniques available?
I have 30 variables like zipcode, age group, hobbies, preferred channel, marital status, credit risk (low, med... | https://stackoverflow.com/questions/52401225/how-to-run-clustering-with-categorical-variables | python, python-3.x, machine-learning, cluster-analysis, data-science | 1,537,344,964 |
se_65704573 | stackoverflow | DATA_SCIENCE | SHAP plots saving figures as blank/white, but Matplotlib saves figures fine | SHAP plots saving figures as blank/white, but Matplotlib saves figures fine
I am attempting to plot a SHAP summary plot after training a Random Forest. I using VSCode to ssh into a remote worker and run my code there. When I run my code to generate and save the image, it does not throw any error, but only generates a ... | https://stackoverflow.com/questions/65704573/shap-plots-saving-figures-as-blank-white-but-matplotlib-saves-figures-fine | python, matplotlib, visual-studio-code, data-science, shap | 1,610,550,386 |
se_44468172 | stackoverflow | DATA_SCIENCE | ValueError: continuous format is not supported | ValueError: continuous format is not supported
I have written a simple function where I am using the average_precision_score from scikit-learn to compute average precision.
My Code:
def compute_average_precision(predictions, gold):
gold_predictions = np.zeros(predictions.size, dtype=np.int)
for idx in range(go... | https://stackoverflow.com/questions/44468172/valueerror-continuous-format-is-not-supported | python, scikit-learn, data-science, classification, valueerror | 1,497,053,090 |
se_59930627 | stackoverflow | DATA_SCIENCE | Finding final regression equation in python | Finding final regression equation in python
How to find final regression model equation including coefficients with all variables? is there any method? | https://stackoverflow.com/questions/59930627/finding-final-regression-equation-in-python | python, machine-learning, regression, data-science, data-modeling | 1,580,125,928 |
se_56720783 | stackoverflow | DATA_SCIENCE | How to fix OverflowError: Overflow in int64 addition | How to fix OverflowError: Overflow in int64 addition
I'm trying to subtract column df['date_of_admission'] from the column df['DOB'] to find the difference between then and store the age value in df['age'] column, however, I'm getting this error:
OverflowError: Overflow in int64 addition
DOB date_of_ad... | https://stackoverflow.com/questions/56720783/how-to-fix-overflowerror-overflow-in-int64-addition | python, pandas, datetime, data-science, timedelta | 1,561,260,568 |
se_76028164 | stackoverflow | DATA_SCIENCE | TensorFlow object detection TF-TRT Warning: Could not find TensorRT | TensorFlow object detection TF-TRT Warning: Could not find TensorRT
I have been experimenting trying to solve it for weeks. I am using Google Colaboratory since I got a MacBook Pro with an Apple chip that is not supported by TensorFlow. Here is the Google Colaboratory link with commenting access. Click here.
I have t... | https://stackoverflow.com/questions/76028164/tensorflow-object-detection-tf-trt-warning-could-not-find-tensorrt | python, tensorflow, data-science, tensorflow2.0, object-detection | 1,681,653,145 |
se_75556588 | stackoverflow | DATA_SCIENCE | PySpark MLlib Cross Validation for hyperparameter tuning a XGBoost | PySpark MLlib Cross Validation for hyperparameter tuning a XGBoost
I'm trying to make a search for a xbgoost's parameters with the cross validation from PySpark's MLlib. I'm using the module from xgboost that is compatible with pyspark's dataframes SparkXGBRegressor.
My dataframe has 40 columns and 6 million rows.
Whe... | https://stackoverflow.com/questions/75556588/pyspark-mllib-cross-validation-for-hyperparameter-tuning-a-xgboost | python, machine-learning, pyspark, data-science, xgboost | 1,677,241,791 |
se_62640500 | stackoverflow | DATA_SCIENCE | I got syntax error by using jupyter notebook | I got syntax error by using jupyter notebook
[Here the image]
1I dont know why i get this error.
Here is the code:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv("files/ch04/ACCIDENTS_GU_BCN_2013.csv" , encoding= 'unicode_escape')
data['Date'] = data[u'Dia de mes']. apply(... | https://stackoverflow.com/questions/62640500/i-got-syntax-error-by-using-jupyter-notebook | python, python-3.x, jupyter-notebook, data-science | 1,593,441,441 |
se_60408901 | stackoverflow | DATA_SCIENCE | sklearn utils compute_class_weight function for large dataset | sklearn utils compute_class_weight function for large dataset
I am training a tensorflow keras sequential model on around 20+ GB text based categorical data in a postgres db and i need to give class weights to the model.
Here is what i am doing.
class_weights = sklearn.utils.class_weight.compute_class_weight('balance... | https://stackoverflow.com/questions/60408901/sklearn-utils-compute-class-weight-function-for-large-dataset | python, tensorflow, machine-learning, scikit-learn, data-science | 1,582,702,495 |
se_52934841 | stackoverflow | DATA_SCIENCE | How can I one-hot encode my dataset with several categorical variables in R? | How can I one-hot encode my dataset with several categorical variables in R?
Does anyone know how I can better clean up this data so I can run a logistic regression on it?
I am trying to one-hot encode the variables with multiple categories like race, workclass, etc (as shown in the sample dataset below), but not sur... | https://stackoverflow.com/questions/52934841/how-can-i-one-hot-encode-my-dataset-with-several-categorical-variables-in-r | r, analytics, data-science, one-hot-encoding | 1,540,229,889 |
se_67808264 | stackoverflow | DATA_SCIENCE | Summary Data - Stats models, Regularized fit | Summary Data - Stats models, Regularized fit
I have been using statsmodels to create a linear regression model. I am trying to print the summary data. For OLS the required function is .summary(), however, I have regularized the model:
model = sm.OLS(Y_train, X_train)
res=model.fit_regularized(alpha=0.04, L1_wt=0)
The... | https://stackoverflow.com/questions/67808264/summary-data-stats-models-regularized-fit | data-science, linear-regression, statsmodels | 1,622,648,260 |
se_55623084 | stackoverflow | DATA_SCIENCE | Gradient Descent is not converging for very large values in a small dataset | Gradient Descent is not converging for very large values in a small dataset
I am trying to write a program to calculate the slope and the intercept of a linear regression model but when I am running more than 10 iterations, the gradient descent function gives the np.nan value for both intercept as well as slope.
Belo... | https://stackoverflow.com/questions/55623084/gradient-descent-is-not-converging-for-very-large-values-in-a-small-dataset | python, machine-learning, linear-regression, data-science | 1,554,942,816 |
se_72887820 | stackoverflow | DATA_SCIENCE | Pandas index operations in Pyspark | Pandas index operations in Pyspark
In our Data Science project we are playing around pandas dataframe, numpy and scipy libraries and we want to change the code into Pyspark, We are facing issues like:
wst = cur_buck[:, [0]]
cur_buck[:, :-1] = cur_buck[:, 1:] - wst
cur_buck[:, -1] = cur_buck[:, -2]
number_of_particles=... | https://stackoverflow.com/questions/72887820/pandas-index-operations-in-pyspark | python, pandas, pyspark, data-science, pyspark-pandas | 1,657,129,236 |
se_53463316 | stackoverflow | DATA_SCIENCE | Why do quasi newton methods such as DFP and BFGS have poor performance on ill-conditionned problem, even if quadratic | Why do quasi newton methods such as DFP and BFGS have poor performance on ill-conditionned problem, even if quadratic
I've been reading in the litterature that quasi newton methods such as DFP and BFGS have poor performance on ill-conditionned problems, but I don't understand the reason of it. I have been trying to us... | https://stackoverflow.com/questions/53463316/why-do-quasi-newton-methods-such-as-dfp-and-bfgs-have-poor-performance-on-ill-co | optimization, data-science, quadratic, hessian | 1,543,102,231 |
se_51639970 | stackoverflow | DATA_SCIENCE | Python matplotlib - Color code positive and negative values in plot | Python matplotlib - Color code positive and negative values in plot
I have a bunch of samples with shape (1, 104). All samples are integers(positive, negative and 0) which are being used in the imshow function of matplotlib. Below is the function I've created to display them as images.
def show_as_image(sample):
b... | https://stackoverflow.com/questions/51639970/python-matplotlib-color-code-positive-and-negative-values-in-plot | python, matplotlib, data-science, imshow | 1,533,147,869 |
se_57425153 | stackoverflow | DATA_SCIENCE | Is there a way to read line by line from a ASC file and checking it after a specific substring? | Is there a way to read line by line from a ASC file and checking it after a specific substring?
I'm having a file with many lines, which I want to transform in a data frame to do some data science.
Reading line by line I founding a little code snippet, which not seems to be working well. But that is not the main pro... | https://stackoverflow.com/questions/57425153/is-there-a-way-to-read-line-by-line-from-a-asc-file-and-checking-it-after-a-spec | r, parsing, bigdata, ascii, data-science | 1,565,334,975 |
se_69157747 | stackoverflow | DATA_SCIENCE | Creating a dictionary from a dataframe | Creating a dictionary from a dataframe
dataframe img
I want to map the retail_store_id with the medicine name, by creating a dictionary where 53 i.e the retail_store_id is the key and the values will be the corresponding medicine name.
dict = { '53': ['PAN 40MG TAB', 'MOXIKIND CV 625MG TAB'.....]} | https://stackoverflow.com/questions/69157747/creating-a-dictionary-from-a-dataframe | python, dataframe, dictionary, data-science | 1,631,511,539 |
se_42258241 | stackoverflow | DATA_SCIENCE | VIF by coef in OLS Regression Results Python | VIF by coef in OLS Regression Results Python
I am attempting to print the VIF (variance inflation factor) by coef. However, I can't seem to find any documentation from statsmodels showing how? I have a model of n variables I need to process and a multicollinearity value for all the variables doesn't help remove the va... | https://stackoverflow.com/questions/42258241/vif-by-coef-in-ols-regression-results-python | python, linear-regression, data-science | 1,487,186,321 |
se_66188904 | stackoverflow | DATA_SCIENCE | Ways to resample non-standard CFTimeIndex calendars (360-day, no-leap-year) with xarray for pandas usage | Ways to resample non-standard CFTimeIndex calendars (360-day, no-leap-year) with xarray for pandas usage
#60198708 brought me to open this question as I've not found the nice solution yet.
The issue
I have downloaded several climate models from the EURO-CORDEX ensemble for daily precipitaion flux. While some models wo... | https://stackoverflow.com/questions/66188904/ways-to-resample-non-standard-cftimeindex-calendars-360-day-no-leap-year-with | python, pandas, datetime, data-science, python-xarray | 1,613,243,509 |
se_70029021 | stackoverflow | DATA_SCIENCE | STREAMLIT: How to print the output of a function | STREAMLIT: How to print the output of a function
I have this function:
def hello (name):
return ('Hello ', name)
first_variable = hello('Maya')
st.text(first_variable)
I want to see ‘Hello Maya’ in my web app, but I get: ‘None’
What should I do? | https://stackoverflow.com/questions/70029021/streamlit-how-to-print-the-output-of-a-function | function, data-science, streamlit | 1,637,288,020 |
se_53549330 | stackoverflow | DATA_SCIENCE | Caret/CaretEnsemble: Wrong model Type for Regression | Caret/CaretEnsemble: Wrong model Type for Regression
I am attempting to build an ensemble of machine learning algorithms, the first using boosting algorithms and the second using stacking algorithms. When I try to create my model, I get the following error:
Error: wrong model type for regression
Here is my Code:
l... | https://stackoverflow.com/questions/53549330/caret-caretensemble-wrong-model-type-for-regression | r, regression, data-science, r-caret | 1,543,535,887 |
se_75672158 | stackoverflow | DATA_SCIENCE | Need help in downloading PDFs from arxiv dataset which is in kaggle | Need help in downloading PDFs from arxiv dataset which is in kaggle
I am seeking assistance with downloading PDFs from the arxiv dataset, which is available on Kaggle, onto my local file system. Ideally, I am looking for a code that allows users to input the subject name and the number of PDFs to download. If anyone h... | https://stackoverflow.com/questions/75672158/need-help-in-downloading-pdfs-from-arxiv-dataset-which-is-in-kaggle | python, web-scraping, data-science, data-analysis | 1,678,273,219 |
se_53152754 | stackoverflow | DATA_SCIENCE | train['Gender'].fillna(train['Gender'].mode()[0], inplace=True) | train['Gender'].fillna(train['Gender'].mode()[0], inplace=True)
train['Gender'].fillna(train['Gender'].mode()[0], inplace=True)
I got this code in one of my basic data science course. I wanted to understand, what is the significance of "[0]" after mode() in this. I would really appreciate the answer.
... | https://stackoverflow.com/questions/53152754/traingender-fillnatraingender-mode0-inplace-true | python, data-science | 1,541,414,445 |
se_51895089 | stackoverflow | DATA_SCIENCE | Extract numeric characters from cells in a data frame in R | Extract numeric characters from cells in a data frame in R
I'm trying to extract the numeric values from a data frame like this:
ID Secc col1 col2 col3
1 Sección 0805601006 1400 1300 85*
2 Sección 0805601007 1475 1365 5.0
3 Sección 080... | https://stackoverflow.com/questions/51895089/extract-numeric-characters-from-cells-in-a-data-frame-in-r | r, extract, data-science, data-cleaning | 1,534,507,574 |
se_76521211 | stackoverflow | DATA_SCIENCE | have two dictionary columns with different lengths want to use series explode but it mismatch | have two dictionary columns with different lengths want to use series explode but it mismatch
I have tow columns in my data frame that have multiple dictionarise in it and I want to expand it into multiple columns but the problem when I use explode series it mismatch
example:
Column A
Column B
Columns C
Cell 1... | https://stackoverflow.com/questions/76521211/have-two-dictionary-columns-with-different-lengths-want-to-use-series-explode-bu | python, pandas, dataframe, data-science, data-analysis | 1,687,334,853 |
se_44105773 | stackoverflow | DATA_SCIENCE | How do I show a scatter plot in Python after doing PCA? | How do I show a scatter plot in Python after doing PCA?
I made a random data of my own, that comprises of a text file with 18 rows and 5 columns with all integer entries.
I successfully managed to do PCA but now stuck. I am unable to do a scatter plot. Here is my code:
f=open(r'<path>mydata.txt')
print(f.read()) #re... | https://stackoverflow.com/questions/44105773/how-do-i-show-a-scatter-plot-in-python-after-doing-pca | python, matplotlib, statistics, anaconda, data-science | 1,495,433,569 |
se_74493144 | stackoverflow | DATA_SCIENCE | TypeError: 'module' object is not callable - while using UMAP | TypeError: 'module' object is not callable - while using UMAP
import umap as UMAP
import umap
retarget = {df_train['target'].value_counts().reset_index()['index'][i]: i for i in range(len(df_train['target'].value_counts()))}
retarget2 = {i: k for k, i in retarget.items()}
df_train['target'] = df_train['targ... | https://stackoverflow.com/questions/74493144/typeerror-module-object-is-not-callable-while-using-umap | python, data-science, runumap | 1,668,791,331 |
se_67268786 | stackoverflow | DATA_SCIENCE | An error when I run the following code in data science with python in coursera | An error when I run the following code in data science with python in coursera
I have an error when I run the following codes for the question.
Question:
Let's explore the relationship between being fed breastmilk as a child and getting a seasonal influenza vaccine from a healthcare provider. Return a tuple of the ave... | https://stackoverflow.com/questions/67268786/an-error-when-i-run-the-following-code-in-data-science-with-python-in-coursera | python, pandas, data-science | 1,619,448,303 |
se_62777945 | stackoverflow | DATA_SCIENCE | Approximating the sine function with polynomials using gaussian elimination | Approximating the sine function with polynomials using gaussian elimination
I'm trying to approximate the sine function over an interval with gaussian elimination using python. Using this code.
from copy import deepcopy
def convert_to_row_eschelon(A_, B_):
A = deepcopy(A_)
B = deepcopy(B_)
dim = len(A)
... | https://stackoverflow.com/questions/62777945/approximating-the-sine-function-with-polynomials-using-gaussian-elimination | python, data-science, polynomials, approximation, polynomial-approximations | 1,594,133,300 |
se_75272415 | stackoverflow | DATA_SCIENCE | nltk.download('punkt') giving output as false | nltk.download('punkt') giving output as false
Here is my code:
df['num_words'] = df['text'].apply(lambda x:len(nltk.word_tokenize(x)))
which gives me the following error:
Resource punkt not found.
Please use the NLTK Downloader to obtain the resource:
>>> import nltk
>>> nltk.download('punkt')
For more... | https://stackoverflow.com/questions/75272415/nltk-downloadpunkt-giving-output-as-false | python, machine-learning, nlp, data-science, nltk | 1,674,962,304 |
se_74213176 | stackoverflow | DATA_SCIENCE | Issues with loading and visualising .mat data with use of mne python | Issues with loading and visualising .mat data with use of mne python
I am working on an EEG dataset and I have been trying to use mne python but I haven't been able to load my .mat data or visualise it.
I would be very grateful if anyone could helpe with it.
Thank you!
For loading the .mat data when I use mne.read_evo... | https://stackoverflow.com/questions/74213176/issues-with-loading-and-visualising-mat-data-with-use-of-mne-python | python, data-science, visualization, loaddata, mne-python | 1,666,811,972 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.