2017暑期数学建模_三模

http://sbp810050504.blog.51cto.com/2799422/1269572 最小二乘法! 特别重要! 这段时间学习《机器学习》,学到第5章的“Logistic回归”,感觉相当吃力。追本溯源,从“Logistic回归”到“线性回归”,再到“最小二乘法”。最终定格到了《高等数学》(第六版·下册)第九章第10节“最小二乘法”,这才了解到最小二乘法背后的数学原理出自哪里。 “最小二乘法”是最优化问题中建立经验公式的一种实现方法。了解它的原理,对于了解“Logistic回归”和“支持向量机的学习”都很有裨益。

注意:进行同步的学习!!Ajax:异步的从远端(服务器)提供需要的数据! .load(url,[data],[callback]) $.get(url,[data],[callback]) $.post(url,[data],[callback],[type]) $.getScript(url,[callback]) $.ajax 事件(有安全机制 所以xw推荐我们使用它!) $.ajax 事件 ```javascript // Using the core $.ajax() method $.ajax({ // the URL for the request url: “post.php”, // the data to send (will be converted to a query string) data: { id: 123 }, // whether this is a POST or GET request type: “GET”, // the type of data we expect back dataType : “json”, // code to run if the request succeeds; // the response is passed to the function success: function( json ) { $( “

“ ).text( json.title ).appendTo( “body” ); $( “
“).html( json.html ).appendTo( “body” ); }, // code to run if the request fails; the raw request and // status codes are passed to the function error: function( xhr, status, errorThrown ) { alert( “Sorry, there was a problem!” ); console.log( “Error: “ + errorThrown ); console.log( “Status: “ + status ); console.dir( xhr ); }, // code to run regardless of success or failure complete: function( xhr, status ) { alert( “The request is complete!” ); }, beforeSend: function() { }, //在于全部的ajax方法之前 进行加载load, 在complete完成后 进行取消load即可! cache: true //false 每一秒 每一时都有变动api需要变为false 但是一般时规则是变为true }); ``` beforeSend, cache 具体参数 请参见markdown(前端学习 JQuery) 注意 在F12模式下的 network模式下可以查看进行的ajax等js的操作并且 我们可以在 Sources 模式下进行点击前面的行号。进行 js的调试!鼠标放在 变量上还能进行查看变量的 值! # JQuery AJAX >其中用到了 $(‘#result’).html(‘’).load(loadUrl+’ #item1’)//这是change 方法?! 注意这里string里面是有字符的!! > load( url, [data], [callback] ) :载入远程 HTML 文件代码并插入至 DOM 中。 url (String) : 请求的HTML页的URL地址。 data (Map) : (可选参数) 发送至服务器的 key/value 数据。 callback (Callback) : (可选参数) 请求完成时(不需要是success的)的回调函数。 $.get( url, [data], [callback] ):使用GET方式来进行异步请求 url (String) : 发送请求的URL地址. data (Map) : (可选) 要发送给服务器的数据,以 Key/value 的键值对形式表示,会做为QueryString附加到请求URL中。 同上个参数:有时用的 {action:”get”,Name:”Ryan”},//这是一个json 对象!因为 api接口里面就是 json对! callback (Function) : (可选) 载入成功时回调函数(只有当Response的返回状态是success才是调用该方法) 。返回 data,textStatus $.post( url, [data], [callback], [type] ) :使用POST方式来进行异步请求 url (String) : 发送请求的URL地址. data (Map) : (可选) 要发送给服务器的数据,以 Key/value 的键值对形式表示。 callback (Function) : (可选) 载入成功时回调函数(只有当Response的返回状态是success才是调用该方法)。 type (String) : (可选)官方的说明是:Type of data to be sent。其实应该为客户端请求的类型(JSON,XML,等等) $.getScript( url, [callback] ) : 通过 GET 方式请求载入并执行一个 JavaScript 文件。 url (String) : 待载入 JS 文件地址。 callback (Function) : (可选) 成功载入后回调函数。 * $.ajax 事件 ```javascript // Using the core $.ajax() method $.ajax({ // the URL for the request url: “post.php”, // the data to send (will be converted to a query string) data: { id: 123 }, // whether this is a POST or GET request type: “GET”, // the type of data we expect back dataType : “json”, // code to run if the request succeeds; // the response is passed to the function success: function( json ) { $( “

“ ).text( json.title ).appendTo( “body” ); $( “
“).html( json.html ).appendTo( “body” ); }, // code to run if the request fails; the raw request and // status codes are passed to the function error: function( xhr, status, errorThrown ) { alert( “Sorry, there was a problem!” ); console.log( “Error: “ + errorThrown ); console.log( “Status: “ + status ); console.dir( xhr ); }, // code to run regardless of success or failure complete: function( xhr, status ) { alert( “The request is complete!” ); }, beforeSend: function() { }, //在于全部的ajax方法之前 进行加载load, 在complete完成后 进行取消load即可! cache: true //false 每一秒 每一时都有变动api需要变为false 但是一般时规则是变为true }); ``` beforeSend, cache

(っ•̀ω•́)っ✎⁾⁾ 坚持技术学习、内容输出与分享,您的支持将鼓励我继续创作!(*/ω\*)
( • ̀ω•́ )✧如有疑问或需要技术讨论,请留言或发邮件到 aclearzhang@qq.com.(*・ω< ) 
  • 本文作者:: AClearZhang
  • 本文链接:: 709.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!