Search Results

Search found 7897 results on 316 pages for 'generate'.

Page 46/316 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • How to generate a monotone MART ROC in R?

    - by user1521587
    I am using R and applying MART (Alg. for multiple additive regression trees) on a training set to build prediction models. When I look at the ROC curve, it is not monotone. I would be grateful if someone can help me with how I should fix this. I am guessing the issue is that initially, MART generates n trees and if these trees are not the same for all the models I am building, the results will not be comparable. Here are the steps I take: 1) Fix the false-negative cost, c_fn. Let cost = c(0, 1, c_fn, 0). 2) use the following line to build the mart model: mart(x, y, lx, martmode='class', niter=2000, cost.mtx=cost) where x is the matrix of training set variables, y is the observation matrix, lx is the matrix which specifies which of the variables in x is numerical, which one categorical. 3) I predict the test set observations using the mart model found in step 2 using this line: y_pred = martpred(x_test, probs=T) 4) I compute the false-positive and false-negative errors as follows: t = 1/(1+c_fn) %threshold based on Bayes optimal rule where c_fp=1 and c_fn. p_0 = length(which(y_test==1))/dim(y_test)[1] p_01 = sum(1*(y_pred[,2]t & y_test==0))/dim(y_test)[1] p_11 = sum(1*(y_pred[,2]t & y_test==1))/dim(y_test)[1] p_fp = p_01/(1-p_0) p_tp = p_11/p_0 5) repeat step 1-4 for a new false-negative cost.

    Read the article

  • Mysql: how to generate count table by PATTERN / LIKE statement ? very tricky

    - by Abdulrahman Al-Qabandi
    to simplify, I got a database of registered users, I want to count how many emails there are for each email domain name (note I do not know all domain names) for example, Users table- id | email ------------------ 1 | [email protected] 2 | [email protected]<--unknown to me 3 | [email protected]<--unknown to me 4 | [email protected] 5 | [email protected]<--unknown to me 6 | [email protected] 7 | [email protected] 8 | [email protected] ( note: I want to count each email without specifying which email exactly ) so the result I want is suffix | count hotmail.com | 3 somesite.aaa | 2 unknownsite.aaa| 1 yahoo.com | 2 again, I stress this, I do not know unknownsite.aaa nor can i mention it in a statement because it is unknown to me, i hope I am clear. So essentially I want to make a statistic of what my website users use as an email host website. but like I said and I will repeat the third time, I do not know every mailhost that exists. I am going to investigate this more, I have a feeling this is something mysql cannot handle.

    Read the article

  • 1 bug to kill... Letting PHP Generate The Canonical.

    - by Sam
    Hi folks, for building a clean canonical url, that always returns 1 base URL, im stuck in following case: <?php # every page $extensions = $_SERVER['REQUEST_URI']; # path like: /en/home.ast?ln=ja $qsIndex = strpos($extensions, '?'); # removes the ?ln=de part $pageclean = $qsIndex !== FALSE ? substr($extensions, 0, $qsIndex) : $extensions; $canonical = "http://website.com" . $pageclean; # basic canonical url ?> <html><head><link rel="canonical" href="<?=$canonical?>"></head> when URL : http://website.com/de/home.ext?ln=de canonical: http://website.com/de/home.ext BUT I want to remove the file extension aswell, whether its .php, .ext .inc or whatever two or three char extension .[xx] or .[xxx] so the base url becomes: http://website.com/en/home Aaah much nicer! but How do i achieve that in current code? Any hints are much appreciated +! (other advices for proper canonical usage in this multi-lingual environment are welcome as well)

    Read the article

  • Qt: any way to automatically generate QSharedData-based structures?

    - by Eye of Hell
    Hello. Qt has a build-in supprt for creating objects with integrated reference counting via QSharedData and QSharedDataPointer. All wordks great, but for each such object i need to write a lot of code: QSharedData-based implementation class with constructor and copy constructor, object class itsef with accessor methods for each filed. For a simple structures with 5-10 fields this requires really lot of near same code. Is it some ways to automate such classes generation? Maybe it's some generators exists that take a short description and automatically generates implementation class and object class with all accessors?

    Read the article

  • What requests do browsers' "F5" and "Ctrl + F5" refreshes generate?

    - by Morgan Cheng
    Is there a standard for what actions F5 and Ctrl+F5 trigger in web browsers? I once did experiment in IE6 and Firefox 2.x. The "F5" refresh would trigger a HTTP request sent to the server with an "If-Modified-Since" header, while "Ctrl+F5" would not have such a header. In my understanding, F5 will try to utilize cached content as much as possible, while "Ctrl+F5" is intended to abandon all cached content and just retrieve all content from the servers again. But today, I noticed that in some of the latest browsers (Chrome, IE8) it doesn't work in this way anymore. Both "F5" and "Ctrl+F5" send the "If-Modified-Since" header. So how is this supposed to work, or (if there is no standard) how do the major browsers differ in how they implement these refresh features?

    Read the article

  • How can I generate XML application configuration using Zend_Tool?

    - by wimvds
    When creating a new project using zf create project myproject it will create a default project layout with an application.ini in the configs folder. Where can I change these default settings so that it generates (and uses) an XML file (application.xml)? I've looked at the documentation for Zend_Tool (http://framework.zend.com/manual/en/zend.tool.html), but there seems to be no information on how to do this. And suppose you'd like to use a different default folder layout (ie. use htdocs instead of public as your document root), is there a way to specify this as well? Any pointers to relevant information (btw I've looked at the Quickstart, nothing relevant is mentioned there unless I'm overlooking it)? edit I already tried creating a profile (stored in .zf/project/profiles), and used that to create a project (using zf create project myproject myprofile) but that doesn't change anything, even though the .zfproject.xml file in the root of the new project does contain the <applicationConfigFile type="xml"/> setting... The new project contains this (as you can see, it's just the default settings, only the type of applicationConfigFile has been changed) : <?xml version="1.0"?> <projectProfile type="default" version="1.10"> <projectDirectory> <projectProfileFile filesystemName=".zfproject.xml"/> <applicationDirectory classNamePrefix="Application_"> <apisDirectory enabled="false"/> <configsDirectory> <applicationConfigFile type="xml"/> </configsDirectory> <controllersDirectory> <controllerFile controllerName="Index"> <actionMethod actionName="index"/> </controllerFile> <controllerFile controllerName="Error"/> </controllersDirectory> <formsDirectory enabled="false"/> <layoutsDirectory enabled="false"/> <modelsDirectory/> <modulesDirectory enabled="false"/> <viewsDirectory> <viewScriptsDirectory> <viewControllerScriptsDirectory forControllerName="Index"> <viewScriptFile forActionName="index"/> </viewControllerScriptsDirectory> <viewControllerScriptsDirectory forControllerName="Error"> <viewScriptFile forActionName="error"/> </viewControllerScriptsDirectory> </viewScriptsDirectory> <viewHelpersDirectory/> <viewFiltersDirectory enabled="false"/> </viewsDirectory> <bootstrapFile filesystemName="Bootstrap.php"/> </applicationDirectory> <dataDirectory enabled="false"> <cacheDirectory enabled="false"/> <searchIndexesDirectory enabled="false"/> <localesDirectory enabled="false"/> <logsDirectory enabled="false"/> <sessionsDirectory enabled="false"/> <uploadsDirectory enabled="false"/> </dataDirectory> <docsDirectory> <file filesystemName="README.txt"/> </docsDirectory> <libraryDirectory> <zfStandardLibraryDirectory enabled="false"/> </libraryDirectory> <publicDirectory> <publicStylesheetsDirectory enabled="false"/> <publicScriptsDirectory enabled="false"/> <publicImagesDirectory enabled="false"/> <publicIndexFile filesystemName="index.php"/> <htaccessFile filesystemName=".htaccess"/> </publicDirectory> <projectProvidersDirectory enabled="false"/> <temporaryDirectory enabled="false"/> <testsDirectory> <testPHPUnitConfigFile filesystemName="phpunit.xml"/> <testApplicationDirectory> <testApplicationBootstrapFile filesystemName="bootstrap.php"/> </testApplicationDirectory> <testLibraryDirectory> <testLibraryBootstrapFile filesystemName="bootstrap.php"/> </testLibraryDirectory> </testsDirectory> </projectDirectory> </projectProfile>

    Read the article

  • Can I assume Flash and PHP will generate the same floating point numbers?

    - by Fragsworth
    In a multiplayer game I'm developing, we have a few values that are floating point numbers. The back-end (in PHP) and the front-end (in Flash) occasionally perform the same calculations on these numbers, to minimize communication. I am currently making sure that both sides are using 64-bit doubles, but am I safe to assume that all calculations will be the same? For instance, what about string to float conversion - should I worry about Flash having a potentially different implementation as PHP? (If this happens, our game will go out of sync - the client will think it is in one state while the server is in another) With some testing, it appears to be the same, but I'm just not sure. Can someone clarify this for me?

    Read the article

  • How could I generate instances of an object randomly at the top of the screen and make them "fall"?

    - by Custard
    I am making a game in Flash CS4 (actionscript 3) and I would like to be able to make "copies" of an instance that would randomly appear at the top of the screen and fall. For example, multiple objects(that are the same one) are falling from the top of the screen continuously, starting at random X positions. (i think this would be considered Real-Time effect). P.S., please tell me if the information is insufficient for an answer, I couldn't think of much more to add to it. Thanks for your time and answers, -Custard

    Read the article

  • Run Reporting Service in local mode and generate columns automatically?

    - by grady
    Hi, I have a SQL query right now which I want to use with the MS reporting services in my ASP.NET application. So I created a report in local mode (rdlc) and attached this to a report viewer. Since my query uses parameters, I created a stored procedure, which had exactly those parameters. In addition to that I had some textboxes which are used for entering the params for the query and a button to call the stored proc and to fill the datatset which is bound to the report viewer. This works, I press the button and according to what I entred the correct data is shown. Now my question: In the future I plan to have multiple reports (which will be selected in a dropdown) and I wonder if I can somehow just call the correct stored procedure and according to the columns which are *SELECT*ed in the procedure, the columns are shown in the report. Example: I select report1 from the dropdown (procedure for report 1 is called), 5 columns are shown in the reportviewer. I select report2 from dropdown (procedure for report 2 is called), 8 columns are shown. Is that possible somehow? Thanks :-)

    Read the article

  • What is the easiest way to generate a Valid x:Name?

    - by just in case
    I am generating some Xaml based on some other source of input. In some cases I am generating x:Name values but they have invalid characters. I found this article on MSDN: XamlName Grammar Which describes the grammar of a x:Name tag but doesn't tell me how to actually apply this. Clearly there is some code to validate this name at runtime but what is the easiest way to actually fix up a string with invalid characters?

    Read the article

  • What is the best way to generate XML from a C based CGI application using the SQLite API?

    - by Tommy
    Learning the basics of XML for the first time from W3C tutorials. How are most XML files generated? Does the server side application usually print a complete XML file to be parsed each time there is new data? I have a CGI application in C and it includes the SQLite API. Is the best way to do some sort of printf to a XML file (using my data from the database) so it can be parsed? Thanks.

    Read the article

  • What wiki tools exist to generate shippable user doc from a wiki?

    - by tletnes
    I am looking into using a wiki (prefer mediawiki, but not a req.) as the repository for developer generated documentation (User Guides, Release Notes, Application Notes, Errata, etc.) from a collaborative/easy-to-update point of view a wiki seems like a good match, however since this documentation will ultimately ship to customers we want to be able to export the documents in their final state (e.g. during the release cycle) to static versions that no longer include histories. Ideally the export would leave the document n a form where errors could be easily fixed by a non-programmer It would be good if niceties like section ordering and table of contents were available, or easy to add after the fact. Are any tools with features like these avalible?

    Read the article

  • Detect if NSString contains a URL and generate a "link" to open inside the app a Safari View

    - by Cy
    I have am reading a twitter feed in my iPhone application and can do it correctly, but I'd like to evolve it in a way to detect if the whole NSString contains any URL or URLs and create a "link" that will open a UIWebView within the same application. Can you guide me on how to perform this task? -(void) setTextTwitter:(NSString *)text WithDate:(NSString*)date { [text retain]; [textTwitter release], textTwitter = nil; textTwitter = text; [date retain]; [dateTwitter release], dateTwitter = nil; dateTwitter = date; [self setNeedsDisplay]; }

    Read the article

  • How should I generate HTML to represent class and its properties?

    - by Mike
    Currently I have a class that represents a document. This document needs to be displayed as HTML. I would like to have a method to call such as GetHTML() that would then call GetHTML() on any properties/sections of the document that needed to be rendered. I was initially thinking about using linq and XElement but am wondering if that may cause issues with certain tags in HTML. Would I better off using an HtmlTextWriter? I am open to any suggestions or best practives for this situation. Thanks!

    Read the article

  • How to generate random strings that match a given regexp?

    - by Pies
    Duplicate: Random string that matches a regexp No, it isn't. I'm looking for an easy and universal method, one that I could actually implement. That's far more difficult than randomly generating passwords. I want to create an application that takes a regular expression, and shows 10 randomly generated strings that match that expression. It's supposed to help people better understand their regexps, and to decide i.e. if they're secure enough for validation purposes. Does anyone know of an easy way to do that? One obvious solution would be to write (or steal) a regexp parser, but that seems really over my head. I repeat, I'm looking for an easy and universal way to do that. Edit: Brute force approach is out of the question. Assuming the random strings would just be [a-z0-9]{10} and 1 million iterations per second, it would take 65 years to iterate trough the space of all 10-char strings.

    Read the article

  • How to generate all permutations of a string in PHP ?

    - by Johan
    I need an algorithm that return all possible combination of all characters in one string. I've tried: $langd = strlen($input); for($i = 0;$i < $langd; $i++){ $tempStrang = NULL; $tempStrang .= substr($input, $i, 1); for($j = $i+1, $k=0; $k < $langd; $k++, $j++){ if($j > $langd) $j = 0; $tempStrang .= substr($input, $j, 1); } $myarray[] = $tempStrang; } But that only returns the same amount combination as the length of the string. Say the $input is = "hey", the result would be: hey, hye, eyh, ehy, yhe, yeh.

    Read the article

  • Is there a tool to generate MVC code in C#?

    - by Rity
    I was working on a project with a colleague and went out for lunch one day. Given that we only spent a few days doing design and no coding, I was surprised to find out that after lunch, he had over 40 files completed (various classes, interfaces, DTOs, etc). He told me he is just a fast typist but I need to know the real deal. He hasn't been able to sustain that kind of productivity just the initial skeletal code but still, any ideas how he did this?

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >