Questions tagged [python]

Use for data science questions related to the programming language Python. Not intended for general coding questions (-> stackoverflow).

Filter by
Sorted by
Tagged with
-1
votes
0answers
14 views

Understanding the modified version of weighted_categorical_crossentropy() function for keras model?

I had found this piece of code as a solution to solve class imbalance. I am trying to understand it but I still have some ambiguity. Here is the found code: ...
2
votes
1answer
1k views
0
votes
0answers
7 views

Apyori module installation

I am currently trying to import the apyori module in PyCharm. However, I am getting the ModuleNotFound Error. i have installed the module by typing pip install apyori on my terminal but I am still ...
0
votes
0answers
11 views

create and use weights in Python to perform weighted correlation and PCA

I need help with the principal components’ analysis code below in 3 ways: Write Code to create RIM (RAKE) weighting. I’m trying to ensure that using the code below, I get exactly the same results than ...
2
votes
2answers
735 views

How can I find anomalies in each row of data?

I have some reported data I want to spot anomalies on. The columns are a facility name then monthly reports of that given facility. ...
0
votes
1answer
257 views
0
votes
2answers
41 views

Drawing validation set from test set

I am building a 3 neural network models on dataset that is already separated to train and test sets. From my analysis, I found that this dataset has values on test set which don't exist in the train ...
0
votes
1answer
11 views

Collinearity between continuous and categorical variable

I have a medical dataset with features age, bmi, sex, gender, # of children, region, charges, smoker. Here smoker, gender, sex and region are categorical variables and others are numerical features. ...
-2
votes
0answers
24 views

How can I improve my regression problem?

I'm trying to forecast new covid-19 cases in Chile, but I feel that my model is not doing so well. My approach was to use a neural network and the model is as follows: ...
0
votes
0answers
18 views

Why do all DTW-packages use different step-patterns and distance-methods?

I already posted it on StackOverflow. I was not sure if this was the right place. I have several questions about the algorithm DTW. I tried different Python-Packages DTAI-Distance DTW-Python First ...
0
votes
1answer
100 views

No gradients provided for any variable: ['Variable:0', 'Variable:0']

I am using Python 3.6 and Tensorflow 2.0 for the following code for linear regression: ...
0
votes
0answers
75 views

Non-OK-status: GpuLaunchKernel(…) status: Internal: no kernel image is available for execution on the device [closed]

I run my code on tensorflow 2.3.0 with CUDA Toolkit 10.1 CUDNN 7.6.0 (Windows 10) and it returns a issue: ...
26
votes
4answers
12k views

Word2Vec for Named Entity Recognition

I'm looking to use google's word2vec implementation to build a named entity recognition system. I've heard that recursive neural nets with back propagation through structure are well suited for named ...
1
vote
1answer
29 views

Is there a python version of Mitchell's face pose recognition code?

The original code for chapter 4 in Tom Mitchell's book for recognizing face pose from images is here: http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mitchell/ftp/faces.html But it's in C, not that there ...
1
vote
0answers
29 views

Is it possible to do attribute, value extraction prediction model in Machine Learning?

Previously I asked a question at here, but it doesn't seems to be at the correct place. So, I moved it here with more details of what I've done. Here is the sample data image to be process. Start with ...
2
votes
2answers
995 views

Piece-wise regression by clustering

I was wondering about the possibilities of clustering numerical data (more than 3 dimensions) into different clusters and doing curve fitting on each cluster to get much higher accuracy than using a ...
0
votes
1answer
53 views

How to use historic data (granularity at day level) for ML modeling?

There is a scenario where I have to use historic data which is at the day level for the past 5 years.Actually it is water flow data, what quantity of water was flown on that particular day. I have to ...
0
votes
1answer
44 views

Pandas - Avoid boolean result when using groupby()

I have this script: sectors = df.groupby(['company_sector']).mean()['investment_in_millions'] Output: I wanted to keep the same groupy() but having a result ...
13
votes
4answers
5k views

How do I make an interactive PCA scatterplot in Python?

The matplotlib library is very capable but lacks interactiveness, especially inside Jupyter Notebook. I would like a good offline plotting tool like plot.ly.
1
vote
1answer
49 views

Why is the difference of datetime = zero in the following dataframe?

This issue that I am facing is very simple yet weird and has troubled me to no end. I have a dataframe as follows : ...
3
votes
3answers
8k views

Open-source interactive dashboard in Python

I am trying to find a package to construct a dashboard with interactive graphs (including widgets such as sliders) in python (mainly IPython notebook). I know there is plotly but I would like a fully ...
1
vote
0answers
688 views

Training Word2Vec with names instead of sentences

I have scientific database with articles and coauthors. using this database I am training word2vec model on co-authors. Use use case here is to disambiguate authors. I was wondering my approach here ...
1
vote
1answer
82 views

Python sklearn PCA transform function output does not match

I am computing PCA on some data using 10 components and using 3 out of 10 as: ...
4
votes
1answer
696 views

Parking Prediction based on Mobile application

I am quite new to predictive modelling but have knowledge of GIS, R, python, SQL, etc. I am currently doing a project in work trying to predict when parking spaces will be available based on data ...
-2
votes
2answers
147 views

R + Model + web service

I would like to interface R with some other language (C#/Python/anything easy to use) to provide it with a web service (or other technology) to an other application developed in C#. R => black box ...
7
votes
4answers
3k views

Determinate K in K-Means Clustering

I have salary data of several user (Python list). Now I am using KMeans to cluster them. Given this data, Is there a way to figure out the best value for 'K' automatically through program? I tried ...
15
votes
6answers
15k views

Good “frequent sequence mining” packages in Python?

Has anyone used (and liked) any good "frequent sequence mining" packages in Python other than the FPM in MLLib? I am looking for a stable package, preferable stilled maintained by people. Thank you!
8
votes
4answers
12k views

How do we standardize arrays with NaN?

I used StandardScaler() to standardize data so far, but this doesn't work with NaNs. None of the other methods I know of (MinMaxScaler, RobustScaler, MaxAbsScaler) work with NaNs either. Are there ...
1
vote
1answer
33 views

How to interpret skimage orientation to straighten images?

I have a bunch of images that I am trying to straighten so the images are horizontal (major axis is horizontal) but I don't understand the orientation output from ...
-1
votes
1answer
20 views

specs for professional-grade local machine [closed]

What are the expected specs for the local machine that a mid-tier data science professional would expect to find on their desk at work? I'm looking for very solid, but nothing extraordinary. To say a ...
1
vote
1answer
59 views

What is the best way Reinforcement learning, RNN or others to predict the best action we have to take to maximize sales?

I have a dataset composed of few features : customerId, actionDay1, SalesDay1, actionDay20, SalesDay20, actionDay30, SalesDay30 action can be : call email face ...
5
votes
3answers
3k views

k-means clustering data with large number of meaningless values

I am looking to perform k-means on my dataset which contains a large number of 0 values. The last value you see is different to the others, that is simply the sum of transactions, not related to the ...
1
vote
1answer
77 views

Generating a set of different scenarios based on some initial observations

I have a in my hands 3 different time series which model 3 different scenarios (base, downside, upside). Every of this time-series depends on a set of 11 different attributes, which take values for ...
0
votes
1answer
166 views

Efficiently Sending Two Series to a Function For Strings with an application to String Matching (Dice Coefficient)

I am using a Dice Coefficient based function to calculate the similarity of two strings: ...
-2
votes
3answers
2k views

Pandas: how to read certain file type in pandas

I am currently working on the data set from this link. But I am unable to read these files from Pandas? Has anyone tried to play with such files? I am trying the following: ...
4
votes
1answer
5k views

Use TSFRESH-library to forecast values

Have some issue with understanding how to use TSFERSH-library (version 0.4.0) to forecast next N-values of particular series. Below my code: ...
1
vote
2answers
931 views

Binary classification: best ways to pre-procees the data

About the dataset I have a training dataset of 129 columns(last column being the classes, i.e., y values) 6068 rows I have to train some algo to do binary classification. The data set has 701 ...
0
votes
1answer
19 views

How to create a classification model for multi output dataset?

I have a dataset where there are two target variables target-1 and target-2. Both target variables are ordinal and thus I want ...
0
votes
2answers
680 views

Visualizing a large number of variables in python

I have a large number of variables (2000) and want to visualize them using Python. Also, I would like to see the summary statistics of these variables. It seems that drawing box plots for all of these ...
0
votes
1answer
17 views

Tensorflow take ages for tf.cond and eval() - python code (sorry but i asked on Stackoverflow but none answer me) [closed]

I got a problem with TensorFlow and need your help. My need is calculating tensordot between a vector: 1x512 named face in my ...
0
votes
2answers
4k views

Plotting k-means output - python

Can anyone help with plotting k-means results from GraphLab k-means tool. ...
1
vote
2answers
364 views

Learning Python for Data Science

Is it necessary to learn Python from square one if your ultimate goal is to use it for data science? I have used R a lot for data science. But could I learn Python sufficiently well just by looking at ...
1
vote
0answers
18 views

Semantic networks and conceptual graphs

I would like to use semantic networks to understand changes in texts. For example when I add/remove some words within a text. ...
3
votes
2answers
88 views

How to automatically find the sentiment?

I have written a program that scrapes data from the web and I have in possession about 5k sentences which I want to analyze. Part 1: I am just starting out in data science and wanted to know if ...
2
votes
1answer
2k views

Pandas Data Frame: Calculating custom moving average

I have a time series containing stock price data. I would like to calculate the Money Flow Index (MFI) for each row. Given that the MFI, uses the previous approx. 14 rows to calculate the current MFI, ...
3
votes
2answers
1k views

Word analysis in Python

I have a list of documents which look like this: ...
1
vote
1answer
1k views

Python Seaborn: How can one obtain a box plot (box and whisker plot) for the non-diagonal variable pairs in a pairplot()?

I tried using kind="box" but am not sure if that works. For the example I tried, I got blank subfigures in the non-diagonal parts of the PairGrid. Edit: Details. The function I am trying to use is <...
2
votes
1answer
2k views

How to construct the document-topic matrix using the word-topic and topic-word matrix calculated using Latent Dirichlet Allocation?

How to construct the document-topic matrix using the word-topic and topic-word matrix calculated using Latent Dirichlet Allocation? I can not seem to find it anywhere, even not from the author of LDA, ...
2
votes
1answer
118 views

Python: forecast unevenly spaced time-series?

My data has timestamps corresponding to the failure occurrences of a specific component in machinery. The timestamps are not uniformly distributed. My question is: 1) what methods can I use to (almost)...
1
vote
0answers
17 views

Why is the behaviour of groupby command different in R and in python with pandas? [closed]

if I execute the following lines of codes in R as well as python for groupby command, the order of the resulting ...

1 2 3
4
5
95