Aditya
  • Member for 4 years, 6 months
  • Last seen this week
Feature selection vs Feature extraction. Which to use when?
Accepted answer
24 votes

Adding to The answer given by Toros, These(see below bullets) three are quite similar but with a subtle differences-:(concise and easy to remember) feature extraction and feature engineering: ...

View answer
What does "baseline" mean in the context of machine learning?
22 votes

A baseline is a method that uses heuristics, simple summary statistics, randomness, or machine learning to create predictions for a dataset. You can use these predictions to measure the baseline's ...

View answer
Using a pre trained CNN classifier and apply it on a different image dataset
15 votes

Do Read - When Transfer Learning is Disadvantageous ?(thanks to @media) (looks very informative to me, so added here to make this answer a complete one...) Answer to your Question..(starts here) ...

View answer
Are there free cloud services to train machine learning models?
14 votes

Check out Crestle.(Free one hour GPU compute time) Google's colab Floyd-hub Paperspace (not free but it's easy to use referrals and earn 15$ compute time..) Azure ($200) deepcognition.ai (2 hours on ...

View answer
Scatter plot for binary class dataset with two features in python
5 votes

One approach is to plot the data as a scatter plot with a low alpha, so you can see the individual points as well as a rough measure of density. from sklearn.datasets import load_iris iris = ...

View answer
How to plot cost versus number of iterations in scikit learn?
5 votes

Note The Code Is Self Explanatory(It's Hard-coded).. Here's the function which we are considering def f(a,b): return a**2 + b**2 fig = plt.figure(figsize=(10, 6)) ax = fig.gca(projection='3d'...

View answer
Export pandas to dictionary by combining multiple row values
4 votes

The to_dict() method sets the column names as dictionary keys so you'll need to reshape your DataFrame slightly. Setting the 'ID' column as the index and then transposing the DataFrame is one way to ...

View answer
Plots with shaded standard deviation
4 votes

The below piece of code will generate the following Image(your's is Subplotting Three of them, so you will get 3 different axe's and per axes you have to use fill-between) (Kindly ignore the Axis ...

View answer
How to arrange the image dataset in CNN?
Accepted answer
4 votes

Directory structure like in dogscats/.(atleast I kept it this way) dogscats     |-- train           |-- cats                 |-- catpic0, catpic1, …           |-- dogs/                 |-- ...

View answer
'DecisionTreeClassifier' object has no attribute 'importances_'
Accepted answer
4 votes

Do Checkout this Link To Visualise The Tree Itself from sklearn.tree import export_graphviz import graphviz export_graphviz(tree, out_file="mytree.dot") with open("mytree.dot") as f: ...

View answer
Why I get AttributeError: 'float' object has no attribute '3f'?
Accepted answer
3 votes

Try this instead, print( "{:.3f}% {} ({} sentences)".format(pcent, gender, nsents) ) Refer the latest docs for more examples and check the Py version!

View answer
Is it advisable to combine two dataset?
3 votes

Adding to what @Super_John said, if adding continents as a Feature, then you can also probably have at-least 2 more features as well, The Latitude The Longitude Also add another temporary column to ...

View answer
how to print kmeans cluster python
3 votes

Code Is Self Explanatory... from sklearn.cluster import KMeans from sklearn.datasets.samples_generator import make_blobs np.random.seed(0) centers = [[1, 1], [-1, -1]] n_clusters =...

View answer
Do I need a next for loop in order to get all values?
Accepted answer
3 votes

Don't forget to open the file first.. Py 2.6 For item in list: the_opened_file.write("%s\n" % item) Py 3.x with open(filepath,'w') as fileptr: for item in list: fileptr.write("{}\n"...

View answer
Error: Input 0 is incompatible with layer lstm_1: expected ndim=3, found ndim=2
3 votes

It's probably this way..(not sure , give it a try) Iputs needs to be reshaped to be [samples, time steps, features] so TrainX= np.reshape(TrainX,(TrainX.shape[0], 1, TrainX.shape[1])) You need to ...

View answer
Uploading images folder from my system into Google Colab
3 votes

You don't need to upload them if you have a download link ...( it would be faster if you can upload them all as either ways you have to do so.. So its better to upload them first and then download ...

View answer
What does it mean when your NN model has "multiple" inputs or outputs in Keras?
2 votes

A Sequential model is not appropriate when: - Your model has multiple inputs or multiple outputs - Any of your layers has multiple inputs or multiple outputs - You need to do layer sharing - You want ...

View answer
Pandas grouped data to Bokeh graph
Accepted answer
2 votes

You can make the plots by looping over the groups from groupby... Or this should also work.. import matplotlib import matplotlib.pyplot as plt df['company_score'].groupby(df['company_id']).rolling(10)....

View answer
How to use flow_from_directory in keras for csv
Accepted answer
2 votes

Something Like This Should Do The Job When you are doing something new, Mistakes are likely.. Use At Your own Risk Or Try It Out on A Sample And Try it on a Seperate Directory Completely import ...

View answer
the relationship between the number of filters/kernels and the number of feature maps
2 votes

The output of a convolution layer is computed as the following: the depth (No of feature maps) is equal to the number of filters applied in this layer (because each added channel is a result of one ...

View answer
drop_duplicates() doesn't work in pandas
Accepted answer
2 votes

So basically you want to drop the 1st row, which is indexed as 0 in the DataFrame. This can be done by df.drop(df.index[0], inplace = True)

View answer
Alternatives to Logistic Regression
Accepted answer
2 votes

If you choose your alternative to Tree based models, then you really have an upper edge here as compared to all other linear/logistic Regressions etc.. People generally useCo-relation, Co-variance ...

View answer
Error in Neural Network
2 votes

Since we know that sin(x) can have -ve values as well, Relu will kill all those mercilessly.. Also we can't have relu just before the output layer as it doesn't makes any sense..(Atleast I have never ...

View answer
Incremental learning with new samples
2 votes

This is what Machine Learning models are used for..(to predict what they think will happen in the near time based on the data they have been fed into....) A simple answer is this The first couple ...

View answer
How to plot similarity of two datasets?
2 votes

Here we have 50000 points, 10000 in each of five categories with associated numerical values. Instead of using Logarithms, you can also use O( log* N ) is "iterated logarithm": In computer ...

View answer
Classification of very similar images
2 votes

Based on the given Example If they are literally the same everywhere except in a small region, just subtract image 1 from image 2 to find the differences... And then we can check the positive and ...

View answer
Boostrap parameter in random forest regressor?
1 votes

Refer this answer on stack The benefit of random forests comes from its creating a large variety of trees by sampling both observations and features. Bootstrap = False is telling it to sample ...

View answer
how to take CSV file input in list of tuples
Accepted answer
1 votes

Don't bring everything into memory at once... It's won't work for many cases as well.. csv's are , separated files and tsv's are tab(\t) separated.. They fall in the same category though.. tqdm is ...

View answer
how to calculate number of datapoints within a given time interval?
1 votes

You can do this doing resample. First we should index on the timestamp column, if you have not already done so: df.set_index('time', inplace=True) The we will add a temporary column(you need ...

View answer
How to get a count the number of observations for each year with a Pandas datetime column?
1 votes

If you Have alreday converted it to datetime object, and want to extract other time related info, it can be done in this way, pd.to_datetime(df_raw['time']).dt.year.value_counts()

View answer