Questions tagged [sklearn-pandas]

Python module providing a bridge between Scikit-Learn’s Machine Learning methods and pandas-style DataFrames

Resources

1336 questions
0
votes
1 answer

Classifcation of wave form data Keras neural network

I've 10 CSV files[critical_001.csv,critical_002.CSV .. non_critical_001.csv,non_critical_002.csv....]. each csv file having 336 rows and 3 columns [features]. I'd like to feed these data sets to the neural network (keras) to classify the given csv…
Sridhar C
  • 631
  • 5
  • 11
0
votes
1 answer

Sci-kit learn imputing values incorrectly

I am using Scikit-learn to impute missing values for my data set, but looking at the largest values for one of my features in the data set it is clear that these missing values are being imputed incorrectly. First I use a pandas function to see the…
0
votes
1 answer

ValueError in creating submission csv

I am learning data science and reading other people's scripts. There is this one titanic algorithm (kaggle) has this code to apply the Logistic Regression then supposedly export to a .csv file as suggested in the code. However, it always generates…
anicehat
  • 45
  • 1
  • 1
  • 8
0
votes
1 answer

How can pass for loop results into sklearns t test method

I have a for loop that iterates over a list of machine learning algorithms, and I want to perform a T Test on the results of the machine learning models. import pandas import numpy from pandas.tools.plotting import scatter_matrix import…
Scott
  • 3
  • 1
0
votes
3 answers

converting json to dataframe in python

I want to convert multiple JSON files into one dataframe. Below is the JSON object: {'alerts': [{'affected_services': {'elevators': [], 'services': [{'mode_name': 'Subway', …
Palak
  • 55
  • 1
  • 10
0
votes
2 answers

Added a not desired column in csv

I have this code from sklearn import tree train_url = "http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/train.csv" train = pd.read_csv(train_url) train["Sex"][train["Sex"] == "male"] = 0 train["Sex"][train["Sex"] == "female"] =…
Ulises 2010
  • 478
  • 1
  • 6
  • 16
0
votes
1 answer

MLP classification fitting

I'm new to Machine Learning and I'm working on a python application that classifies poker hands using a dataset which I will post snippets. It does not seem to work well. And I am getting the following error: Traceback (most recent call last): …
0
votes
1 answer

Assign custom categories to json data - pandas

Assigning labels to raw data instead of getting new indicator columns from get_dummies. I want something like this : json_input: [{id:100,vehicle_type:"Car", time:"2017-04-06 01:39:43", zone="A", type:"Checked"}, {id:101,vehicle_type:"Truck",…
Milee
  • 1,191
  • 1
  • 11
  • 29
0
votes
0 answers

multi-label supervised classification of text data

I am solving machine learning problem using python. My knowledge in machine learning is not much. The problem has given training dataset. Training dataset includes text samples and labels for those text samples. All possible values of labels are…
Rohanil
  • 1,717
  • 5
  • 22
  • 47
0
votes
2 answers

Pandas how to reshape a dataframe containing duplicated values for columns

This is the dataframe I have: chr value region chr22 1 21-77 chr6 3 12-65 chr3 5 73-81 chr3 8 91-96 And this is what I need: 21-77 12-65 73-81 91-96 …
anilbey
  • 1,817
  • 4
  • 22
  • 38
0
votes
1 answer

No module named 'sklearn.leanear_model' error occurred in anaconda 3, spyder

I am using anaconda with python 3. In spyder I run following code import pandas as pd import quandl import math import numpy as np from sklearn import preprocessing, cross_validation, svm from sklearn.leanear_model import LearnRegression df =…
ram om
  • 23
  • 1
  • 5
0
votes
2 answers

why argument random_state in cross_validation.train_test_split is integer not boolean

i need to know why argument random_state in cross_validation.train_test_split is integer not Boolean, since it's role is to flag random allocation or not?
0
votes
0 answers

got multiple arguments for keyword

i cannot seem to debug this error from sklearn.pipeline import Pipeline, FeatureUnion a = TextTransformer('description', max_features=50) b = TextTransformer('features', max_features=10) pipeline = Pipeline([ ('feats', FeatureUnion([ …
aceminer
  • 4,089
  • 9
  • 56
  • 104
0
votes
1 answer

Error when installing scipy in PyCharm?

I get the following error when attempting to install scipy to PyCharm 3.2: Collecting scipy Using cached scipy-0.19.0.zip Installing collected packages: scipy Running setup.py install for scipy: started Running setup.py install for scipy:…
Leigh
  • 49
  • 1
  • 1
  • 9
0
votes
1 answer

How to fix errors in scikit machine learning?

I am trying to implement machine learning for a dataset with 1059 rows and 4 columns but I am getting the following error when trying to fit the model with: knn.fit(myData['RAB'], myData['ETAPE']) ValueError: Found input variables with inconsistent…
tkyo
  • 75
  • 1
  • 12