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

learn more… | top users | synonyms

3
votes
1answer
47 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 ...
0
votes
0answers
14 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. ...
2
votes
0answers
45 views

Traning and testing of sentiment analysis

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
116 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
59 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
2
votes
1answer
67 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
53 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 ...
13
votes
0answers
246 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 ...
1
vote
1answer
90 views

Naive Bayes Classifier in C#

The following is my implementation of Naive Bayes Classifier. https://github.com/edurazee/NaiveBayesClassifier I took the source code from here and tried to simplify it. How can I simplify my code ...
3
votes
0answers
63 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 ...
0
votes
0answers
15 views

Sending the accuracies of 4 cross-validations to a pandas dataframe

I want to improve my code. It performs 4 cross-validations: 10x20, 10x10, 10x5 10x2. Then it stores the values in Pandas where I will get the average of each column and multiply them by 100. You ...
4
votes
0answers
43 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 ...
3
votes
1answer
58 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
56 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
60 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
23 views

Efficient implementation of aggregating test/train data

Here is a short python snippet to ingest train data: ...
2
votes
1answer
40 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
1answer
195 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
187 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
274 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 ...
6
votes
1answer
151 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
121 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
110 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 ...
7
votes
1answer
185 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
223 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:...
3
votes
1answer
247 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
48 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 ...
5
votes
1answer
830 views

k-means clustering algorithm implementation

Here is my personal implementation of the clustering k-means algorithm. ...
5
votes
1answer
89 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 ...
11
votes
1answer
292 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
67 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, ...
0
votes
1answer
225 views

csv loader and kNN algorithm in Java

I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64.. As it stands my code applies the kNN ...
1
vote
1answer
64 views

SKlearn automate data pre treatment

I want to make a simple wrapper for sklearn models. The idea is that the wrapper automatically takes care of factors (columns of type "object") replacing them with ...
2
votes
1answer
123 views

ImprSimple chat bot written in python

I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too. So far, it's warning a user if it's using some bad words (which are parsed from ...
0
votes
0answers
40 views

Naive-Bayes classifier, to be packaged in a function

I need to create a Naive-Bayes classifier. I have eight labels (S) stored in tumors object, and 20531 attributes (A), I have stored the P(S,A) in objects of name <...
4
votes
2answers
264 views

Tic-Tac-Toe machine learning

I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
1
vote
0answers
144 views

Increase performance of Spark-job Collaborative Recommendation.

This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins. Note: I think takeOrdered is the ...
1
vote
0answers
92 views

Predicting a win/loss given prior game stats

The project: create a model that can (somewhat) accurately predict a win/loss given prior game stats. Wanted a review of code in general, in particular my use of the ...
4
votes
0answers
219 views

RandomForest multi-class classification

Below is the code I have for a RandomForest multiclass-classification model. I am reading from a CSV file and doing various transformations as seen in the code. I ...
3
votes
0answers
128 views

Logistic regression with eigen

I am a new to Eigen, and I implemented a logistic regression model with it. It works but I don't know whether it is implemented in an efficient way. ...
2
votes
1answer
423 views

Cross validation of gradient boosting machines

I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods. ...
6
votes
1answer
718 views

Calculate conditional probabilities and perform naive Bayes classification on a given data set

I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is ...
3
votes
1answer
145 views

File-write operations

Below is the code for user recommendations using mahout. ...
1
vote
1answer
175 views

Latent Dirichlet Allocation in Python

I've recently finished writing a "simple-as-possible" LDA code in Python. The theory from which I've developed my code can be found in the book Computer Vision by Simon Prince, free (courtesy of ...
3
votes
1answer
7k views

ID3 Decision Tree in python

I've been working my way through Pedro Domingos' machine learning course videos (although the course is not currently active). His first homework assignment starts with coding up a decision tree (ID3)....
3
votes
2answers
48 views

Asynchronous model fitting that allows termination in Python

The problem When you work with Python interactively (e.g. in an IPython shell or notebook) and run a computationally intensive operation like fitting a machine-learning model that is implemented in a ...
4
votes
1answer
102 views

Random Forest Code Optimization

I am new to Python. I have built a model with randomforest in python. But I think my code is not optimized. Please look into my code and suggest if I have deviated from best practices. Overview about ...
2
votes
2answers
51 views

ML Retraining project

Tear me to shreds. The class RandomForestRetrainer will be used to retrain a machine learning algorithm. It has functionality for taking in a directory containing malware or benignware files and ...
2
votes
1answer
56 views

Randomly learning a neuron to act as a signal counter

I have this small program for learning an artificial neuron to act as a simple signal counter: my cell has four input wires (also called dendrites) and a single output wire (also called axon). If at ...
3
votes
1answer
70 views

Batch Gradient Descent running too slowly

Following Data Science from Scratch by Joel Grus, I wrote a simple batch gradient descent solver in Python 2.7. I know this isn't the most efficient way to solve this problem, but this code should be ...