Questions tagged [machine-learning]

Machine learning provides computer algorithms that automatically discover patterns in data and make intelligent decisions from them.

Filter by
Sorted by
Tagged with
1
vote
1answer
822 views

MemoryError for a small-ish dataset with RandomForestClassifier()

I have a not-so-big dataset having 100,000 rows and 6k columns and I'm using the following code to fit a Random Forest to it: ...
1
vote
0answers
226 views

sklearn request: pipeline for regression analysis on entering student data

My jupyter notebook is here. I would love to hear any feedback about any problems that may be occurring in my data pipeline. I already know that I still need to develop the following features: ...
5
votes
0answers
698 views

Low accuracy of LSTM model tensorflow [closed]

I am trying to learn LSTM model for sentiment analysis using Tensorflow, I have gone through the LSTM model. Following code (create_sentiment_featuresets.py) generates the lexicon from 5000 positive ...
2
votes
1answer
253 views

Predicting outliers in network data [closed]

I'm implementing KNN algorithm to predict outliers in network data which contains the following columns: source IP address, source port number, protocol and total bytes transferred. To achieve this, I'...
2
votes
0answers
716 views

Implementing Adagrad in Python

I'm trying to implement Adagrad in Python. For learning purposes, I am using matrix factorisation as an example. I'd be using Autograd for computing the gradients. My main question is if the ...
3
votes
0answers
63 views

Time calculation for NLTK tagging

I am trying to calculate the time required to tag one sentence/file by one trained NLTK HMM Tagger. To do this I am writing the following code, please suggest if I need to revise anything here. ...
1
vote
0answers
130 views

Naïve Bayes classifier to group questions by intent

I am trying to train a question-answer system, where I am trying to group similar questions, and identify the most apt response. The program should identify the intent/focus. To do it, I have tagged ...
4
votes
0answers
4k views

Calculate relationship between 2 categorical variables in a pandas Dataset with chi square test

I'm working on a Machine Learning project and I'm in Data Exploration step, and my dataset has both categorical and continuous attributes. I decided to compute a chi square test between 2 categorical ...
1
vote
0answers
77 views

Bare minimum neural network, random weight update etc

I'm trying to understand that how a simple neural network works. The program below (that I wrote to test my understanding) aims to train a network that will eventually be able to distinguish whether ...
0
votes
1answer
221 views

Python code to parse JSON data from CuckooML, involving many file operations

I have written a code that will parse JSON file from a cuckoo report. The issue is am not a good coder. I have got the program to give me the desired output. The real challenge that I am facing is I ...
5
votes
0answers
7k views

Implementation of Single Layer Perceptron Learning Algorithm in C

I have implemented a working version of perceptron learning algorithm in C. Right now, it only works on single layer perceptrons and only takes two inputs. I plan on making it work with more than two ...
5
votes
0answers
120 views

Stacking and folding machine-learning algorithm

I am trying to use the code of this guy. Written in 2013 but it is a bit obsolete on some points. Basically, the idea is to create folders from 1 dataset to train several models independently on the ...
0
votes
1answer
336 views

Reinforcement learning example (chap. 1) from Sutton's book

I ported the Lisp Tic Tac Toe code from Chapter 1. to Haskell. The original code repo is down for some reason. I believe I have completely rewritten that in Haskell (Less functional than one would ...
5
votes
2answers
2k views

C++ Feed-Forward Neural Network

After a few days of reading articles, watching videos and bugging my head around neural networks, I have finally managed to understand it just so I could write my own feed-forward implementation in C++...
4
votes
1answer
2k views

Keras: multiclass classification with Recurrent Neural Network

Dataset: Labelled epidemic data consisting of number of infectious individuals per unit time. Challenge: Use supervised classification via a recurrent neural network to classify each epidemic as ...
8
votes
1answer
758 views
6
votes
1answer
337 views

Python Perceptron

This is my finished perceptron written in python. Is there anything that I can improve/suggestions? I'm a beginner with python so anything would be helpful! ...
2
votes
1answer
274 views

Multiword Expression Tagging in Python

I am trying to write a small python code,where I am reading a text file-which contains both Multiwords (MWEs) and singular words (NMWEs). I am trying to tag each one, as follows. I have a ...
3
votes
0answers
1k views

Implementing the stochastic gradient descent algorithm of the softmax regression with only NumPy [closed]

I am implementing the stochastic gradient descent algorithm. I think there is plenty of room for improvement. ...
1
vote
0answers
114 views

Implementation of a KNN in OCaml

I wrote the following implementation of the k-nearest neighbor algorithm (for a binary classification task). I am not familiar with OCaml's built in functions, I have the feeling that some of them ...
2
votes
1answer
3k views

Multivariable Gradient Descent in Numpy

Just recently started learning ML, first I've gone through the notes of Ng's Coursera stuff. While I have nothing against Octave, I'm trying to solve exercises in Python. It's my beginning with that ...
1
vote
0answers
2k views

Sentences Clustering - Affinity Propagation & Cosine Similarity - Python & SciKit

I am looking for advices regarding my code. I am interested about the correctness, legibility and minimality of the solution. ...
1
vote
0answers
306 views

Traning and testing of sentiment analysis [closed]

Here is my code which takes two files of positive and negative comments and creates a training and testing set for sentiment analysis using nltk, sklearn, Python and statistical algorithms. The ...
1
vote
2answers
2k views

Decision tree node split by Gini coefficient (used in RandomFerns/RandomForest algorithm)

I am implementing the Random Ferns Algorithm for Classification. For simplicity, let's imagine a single decision tree with only a single node. As input we have a feature and the label of each dataset. ...
3
votes
0answers
95 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
2
votes
1answer
416 views

Parzen Window Density Estimation in C#

Is my implementation correct (it is matching this result)? How can I improve this code? ...
1
vote
0answers
64 views

Linear SVM(in R) giving suspiciously high CV accuracy

Here is my code that reads a text dataset, featurizes the text column and then does CV using Linear SVM. Could I be leaking labels from somewhere as the accuracy I get is suspiciously high and way ...
25
votes
1answer
1k views

Backpropagation in simple Neural Network

I've been working on a simple neural network implemented in python. Currently, it seems to be learning, but unfortunately it doesn't seem to be learning effectively. The graph below shows the output ...
3
votes
1answer
2k views

Naive Bayes Classifier in C#

I took the code from internet and tried to simplify it. So, what can I do? How can I simplify my code more to make it easily understandable? ...
3
votes
0answers
243 views

Naive implementation of Naive Bayes in Haskell

A simple implementation of Naive Bayes, as I'm a Haskell beginner I've tried to put an emphasis on clarity and documentation. I've tried to incorporate the feedback from a similar question. This is ...
4
votes
0answers
64 views

sk-learn like model

I am trying to make a simple model that returns the conditional expectation of a target with respect to the value observed for another variable. Basically, given a feature \$F\$, a level of this ...
2
votes
1answer
3k views

ROC and AUC calculation

Using Python 2.7 and here is my code to calculate ROC/AUC and I compare my results of tpr/fpr with threshold, it is the same result of whay scikit-learn returns. My questions, (1) any ideas for ...
1
vote
1answer
131 views

Streaming learning OCaml

I wrote a simple online logistic regression, calibrated using gradient descent to compare the speed of an OCaml implementation vs the same Python script, executed with Pypy. It turned out that the ...
3
votes
1answer
724 views

A simple fully connected ANN module

I've written a simple module that creates a fully connected neural network of any size. The arguments of the train function are list of tuples with a training example array first and an array ...
3
votes
1answer
34 views

Efficient implementation of aggregating test/train data

Here is a short python snippet to ingest train data: ...
2
votes
1answer
424 views

Multi or n-armed bandit reinforcement learning in R

I am learning about reinforcement learning and came across the first and simplest form of reinforcement learning system called multi-armed reinforcement learning (also called as n-armed bandit). I ...
1
vote
0answers
3k views

Using pandas and sklearn for forecasting stock market return

I have been using R for stock analysis and machine learning purpose but read somewhere that python is lot faster than R, so I am trying to learn Python for that. I am using Yhat's rodeo IDE (Python ...
3
votes
1answer
271 views

Clustering 16 million records in parallel

I have a dataset with 16 million rows and may increase upwards of 30 million. I am using the parLapply to run across three cores in R. But it's taking two days to ...
5
votes
1answer
6k views

Apriori algorithm in Python 2

This takes in a dataset, the minimum support and the minimum confidence values as its options, and returns the association rules. I'm looking for pointers towards better optimization, documentation ...
7
votes
1answer
654 views

Similarity research : K-Nearest Neighbour(KNN) using a linear regression to determine the weights

I have a set of houses with categorical and numerical data. Later I will have a new house and my goal will be to find the 20 closest houses. The code is working fine, and the result are not so bad but ...
1
vote
1answer
851 views

Entity resolution with NLTK

I am trying to write a script of Python code, for entity extraction and resolution. The excerpts of the algorithm: It is trying to extract the entity as PoS Tag with Hidden Markov Model(HMM). After ...
6
votes
1answer
312 views

Random forest and machine learning

I am quite new to using python for machine learning. I come from a background of programming in Fortran, so as you may imagine, python is quite a leap. I work in chemistry and have become involved in ...
11
votes
1answer
3k views

A CNN in Python WITHOUT frameworks

Here's some code that I've written for implementing a Convolutional Neural Network for recognising handwritten digits from the MNIST dataset over the last two days (after a lot of research into ...
1
vote
1answer
1k views

Pattern recognition and machine learning - Bernoulli mixture model

I have been reading the book Pattern Recognition and Machine Learning (Bishop) for a while, and recently I came across this figure, which was created using Bernoulli mixture model on the MNIST dataset:...
5
votes
1answer
13k views

Different neural network activation functions and gradient descent

I've implemented a bunch of activation functions for neural networks, and I just want have validation that they work correctly mathematically. I implemented sigmoid, tanh, relu, arctan, step function, ...
1
vote
0answers
85 views

Self organizing maps

I have already asked similar question here, but I figured this place might be better on getting some actual implementation feedback. I tried to implement a simple SOM. You can see the training ...
7
votes
1answer
6k views

k-means clustering algorithm implementation

Here is my personal implementation of the clustering k-means algorithm. ...
5
votes
1answer
364 views

Classification tree in Swift

As an effort to teach myself Swift as well as to get familiar with machine learning algorithms, I've been trying to implement common algorithms, starting with a Random Forest. This is, for the moment ...
12
votes
1answer
435 views

Make a summary from a larger text-file

This code makes summaries from larger texts. I have searched around for an algorithm and found the following: Associate words with their grammatical counterparts. (e.g. "city" and "cities") ...
2
votes
1answer
728 views

Nested loops - Random Forest, multiple parameters

I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short: Firstly, I declare a data frame in which model parameters and some stats will be saved. Secondly, ...