how to do you count manually CART algorithm and gini index for decision tree using excel - indexing

I've been learning about CART algorithm, and now i want to do counting manually CART algorithm using excel. But i still dont know how to do it. can someone help me how to do manual counting for CART algorithm and Gini index using excel ? I appreciate every help.

Related

Adding Cost Data to OD Cost Matrix

I have a model that I built where I can add a point (Origin) and add another point (Destination). I run the model to get a mileage from the origin to the destination. It works well, but I’d like to add onto it.
Existing Model
I’d like to place a point on the map and the model to find the 5 closest destinations. Once that is done, I’d like for the model to take those mileages and add cost data to it. I know that I’ll need to build the model around OD Cost Matrix. After that I’m kind of lost as to how to calculate the values. I think it would be good to have the interface for the model have a box for Freight Rate, Material Amount, Material Rate, and Material Cost. The reason I think it would be good to have that option is so the user could change those numbers as conditions in the market change.The image below is what I have so far for the model and the interface. User clicks the Feature Point and adds it to the map. Then enters the information into each box in the interface. User hits start or go.
Interface
enter image description here
I've yet to get it to work, and I don't really know what I'm doing.
The goal is to get an output that looks something like this.
Possible Output
Thank you for any help.

historical index performance in Bloomberg / VBA

I am making a tool which plots the historical (12800 dates, 1980-today) stock performance of subsets of 3500 companies based on a set of sustainability rating criteria chosen by the user. For example, one could pick "worker health and safety" and then see the stock performances of the companies with the best and worst ratings in that area compared to the average.
After the user inputs constraints, I produce a list of Bloomberg tickers for which I want to analyze performance. Is there a way to upload such a list of tickers to Bloomberg, and have it return the historical performance data? Or even a well-documented source of help / examples? I asked the help desk but they just told me to read their documentation, which didn't prove to be of much use.
I am avoiding at all costs downloading the ~44,000,000 data points I might theoretically need (35 years of daily last price for all 3500 companies) - so any alternative ideas would be very much appreciated.
Using the Bloomberg Excel Add-In, you can automate functions through Historical Data-set Formulas. Once you have the core formula syntax down, you can easily do things like drag cells to update new tickers with similar data-sets.
Your goal appears to be something like a Stock Screener, however. In your example you mentioned that you would like to make it custom and flexible for a user to screen stocks based on a particular set of criteria.
Maybe you're trying to do something conceptually like this : https://www.google.com/finance/stockscreener
But with a wider breadth of data. What you would have to do to avoid the costs of Network Transactions and Data Storage is to be able to quickly eliminate a solid part of the Stock Screen Universe by using some data-sets or indicators that are stronger in filtering out the noise of stocks that may exhibit criteria that the user may not be interested in.

Size against best Bid or best Ask in Bloomberg Excel API

I need best ask and best bid at interval of five minutes along with the corresponding size. Using Intraday Bars in Excel, I am able to obtain the best ask and best bid but not able to able the corresponding size. The size that it shows is the summation of all sizes at a particular price, which is not the requirement. Using intraday ticks in Excel, I can see the size against the bid. But finding the best bid and then noting the corresponding size is very cumbersome process which will take years. Can you please help in obtaining size against the best bid. Also, it would be great if you could give me some template to obtain the best bid and the corresponding size or let me know the steps.
For the Refresh, you could do something like:
http://excelexperts.com/VBA-Tips-Run-Code-Every-Hour-Minute-or-Second
Bloomberg has fields for BID, ASK, and BID_SIZE -- so you should just be able to use the built in fields. Field "RQ014 - Bid Size (BID_SIZE)" says it uses the "best bid" level.

How can I distribute a number of values Normally in Excel VBA

Sorry I know the question isnt as specific as it could be. I am currently working on a replenishment forecasting system for a clothing company (dont ask why it's in VBA). The module I am currently working on is distribution forecasts down to a size level. The idea is that the planners can forecast the number to sell, then can specify a ratio between the sizes.
In order to make the interface a bit nicer I was going to give them 4 options; Assess trend, manual entry, Poisson and Normal. The last two is where I am having an issue. Given a mean and SD I'd like to drop in a ratio (preferably as %s) between the different sizes. The number of the sizes can vary from 1 to ~30 so its going to need to be a calculation.
If anyone could point me towards a method I'd be etenaly greatfull - likewise if you have suggestions for a better method.
Cheers
For the sake of anyone searching this, whilst only a temporary solution I used probability mass functions to get ratios this allowed the user to modify the mean and SD and thus skew the curve as they wished. I could then use the ratios for my calculations. Poisson also worked with this method but turned out to be a slightly stupid idea in terms of choice.

I am looking for a radio advertising scheduling algorithm / example / experience

Tried doing a bit of research on the following with no luck. Thought I'd ask here in case someone has come across it before.
I help a volunteer-run radio station with their technology needs. One of the main things that have come up is they would like to schedule their advertising programmatically.
There are a lot of neat and complex rule engines out there for advertising, but all we need is something pretty simple (along with any experience that's worth thinking about).
I would like to write something in SQL if possible to deal with these entities. Ideally if someone has written something like this for other advertising mediums (web, etc.,) it would be really helpful.
Entities:
Ads (consisting of a category, # of plays per day, start date, end date or permanent play)
Ad Category (Restaurant, Health, Food store, etc.)
To over-simplify the problem, this will be a elegant sql statement. Getting there... :)
I would like to be able to generate a playlist per day using the above two entities where:
No two ads in the same category are played within x number of ads of each other.
(nice to have) high promotion ads can be pushed
At this time, there are no "ad slots" to fill. There is no "time of day" considerations.
We queue up the ads for the day and go through them between songs/shows, etc. We know how many per hour we have to fill, etc.
Any thoughts/ideas/links/examples? I'm going to keep on looking and hopefully come across something instead of learning it the long way.
Very interesting question, SMO. Right now it looks like a constraint programming problem because you aren't looking for an optimal solution, just one that satisfies all the constraints you have specified. In response to those who wanted to close the question, I'd say they need to check out constraint programming a bit. It's far closer to stackoverflow that any operations research sites.
Look into constraint programming and scheduling - I'll bet you'll find an analogous problem toot sweet !
Keep us posted on your progress, please.
Ignoring the T-SQL request for the moment since that's unlikely to be the best language to write this in ...
One of my favorites approaches to tough 'layout' problems like this is Simulated Annealing. It's a good approach because you don't need to think HOW to solve the actual problem: all you define is a measure of how good the current layout is (a score if you will) and then you allow random changes that either increase or decrease that score. Over many iterations you gradually reduce the probability of moving to a worse score. This 'simulated annealing' approach reduces the probability of getting stuck in a local minimum.
So in your case the scoring function for a given layout might be based on the distance to the next advert in the same category and the distance to another advert of the same series. If you later have time of day considerations you can easily add them to the score function.
Initially you allocate the adverts sequentially, evenly or randomly within their time window (doesn't really matter which). Now you pick two slots and consider what happens to the score when you switch the contents of those two slots. If either advert moves out of its allowed range you can reject the change immediately. If both are still in range, does it move you to a better overall score? Initially you take changes randomly even if they make it worse but over time you reduce the probability of that happening so that by the end you are moving monotonically towards a better score.
Easy to implement, easy to add new 'rules' that affect score, can easily adjust run-time to accept a 'good enough' answer, ...
Another approach would be to use a genetic algorithm, see this similar question: Best Fit Scheduling Algorithm this is likely harder to program but will probably converge more quickly on a good answer.