我尝试在我的Ubuntu 14.04上运行vagrant.所以,我做了以下步骤:
-Install vagrant -Install virtualbox -added box for provider
然后我跑了
流浪汉
命令.
运行命令后,我接受这些输出,并且有一条错误消息,我无法弄清楚如何解决并正确运行它.
使用'virtualbox'提供程序将计算机'默认'打开...
==>默认:检查框'udacity/ud381'是否是最新的...
==>默认:清除以前设置的转发端口...
==>默认:清除以前设置的任何网络接口......
==>默认:根据配置准备网络接口...
Run Code Online (Sandbox Code Playgroud)default: Adapter 1: nat==>默认:转发端口......
Run Code Online (Sandbox Code Playgroud)default: 5000 (guest) => 5000 (host) (adapter 1) default: 22 (guest) => 2222 (host) (adapter 1)==>默认值:引导VM ...执行时出错
VBoxManage,Vagrant用于控制VirtualBox的CLI.命令和stderr如下所示.命令:["startvm","0399f946-6a87-4310-a22d-c1a4525ae2f0"," - type","headless"]
Stderr:VBoxManage:错误:虚拟机'ud381_default_1463617458900_49294'在启动期间意外终止,退出代码为1(0x1)VBoxManage:错误:详细信息:代码NS_ERROR_FAILURE(0x80004005),组件MachineWrap,接口IMachine
我该怎么做才能解决这些错误?
我正在研究机器学习项目,我想在网上用php做.它是否可能,如果是的话,你对图书馆或想法有什么建议吗?如果不是,我将使用Weka工具继续我的Java项目.
我在python中有一个列表.
article_ids = [1,2,3,4,5,6]
Run Code Online (Sandbox Code Playgroud)
我需要在sql语句中使用这个列表,如下所示:
SELECT id FROM table WHERE article_id IN (article_ids)
Run Code Online (Sandbox Code Playgroud)
我怎样才能将这个清单提供给我的IN()条款?
我已经尝试了一些谷歌搜索方式,但我无法理解.
>> print ids_list
placeholders= ', '.join('?'*len(ids_list)) # "?, ?, ?, ... ?"
query = 'SELECT article_id FROM article_author_institution WHERE institution_id IN ({})'.format(placeholders)
print query
cursor.execute(query, ids_list)
Run Code Online (Sandbox Code Playgroud)
我得到的错误消息:
SELECT article_id FROM article_author_institution WHERE institution_id IN (?)
query = query % db.literal(args)
TypeError: not all arguments converted during string formatting
Run Code Online (Sandbox Code Playgroud)
例如:
ids_list = [9,10]
placeholders= ', '.join('%'*len(ids_list)) # "?, ?, ?, ... ?"
query = …Run Code Online (Sandbox Code Playgroud) 我正在尝试评估多元线性回归模型.我有这样的数据集:

该数据集有157行*54列.
我需要预测文章中的ground_truth值.我将在en_Amantadine和en_Common之间添加我的多个线性模型7篇文章.
我有多线性回归的代码:
from sklearn.linear_model import LinearRegression
X = [[6, 2], [8, 1], [10, 0], [14, 2], [18, 0]] // need to modify for my problem
y = [[7],[9],[13],[17.5], [18]] // need to modify
model = LinearRegression()
model.fit(X, y)
Run Code Online (Sandbox Code Playgroud)
我的问题是,我无法从我的DataFrame中提取X和y变量的数据.在我的代码中X应该是:
X = [[4984, 94, 2837, 857, 356, 1678, 29901],
[4428, 101, 4245, 906, 477, 2313, 34176],
....
]
y = [[3.135999], [2.53356] ....]
Run Code Online (Sandbox Code Playgroud)
我无法将DataFrame转换为此类结构.我怎样才能做到这一点 ?
任何帮助表示赞赏.
我有一个158行10列的数据集.我尝试建立多元线性回归模型,并尝试预测未来的价值.
我使用GridSearchCV来调整参数.
这是我的GridSearchCV和回归函数:
def GridSearch(data):
X_train, X_test, y_train, y_test = cross_validation.train_test_split(data, ground_truth_data, test_size=0.3, random_state = 0)
parameters = {'fit_intercept':[True,False], 'normalize':[True,False], 'copy_X':[True, False]}
model = linear_model.LinearRegression()
grid = GridSearchCV(model,parameters)
grid.fit(X_train, y_train)
predictions = grid.predict(X_test)
print "Grid best score: ", grid.best_score_
print "Grid score function: ", grid.score(X_test,y_test)
Run Code Online (Sandbox Code Playgroud)
此代码的输出是:
网格最佳得分:0.720298870251
网格评分函数:0.888263112299
我的问题是best_score_和score功能有什么区别?
score功能如何比best_score功能更好?
提前致谢.
我正在尝试在 Inno Setup 创建一个新窗口。在这个窗口中:
任何帮助表示赞赏。
该窗口的屏幕截图:

所以现在,我的代码如下:
#define MyAppName "CDV Client"
#define MyAppVersion "3.6.1 build 2"
#define MyAppPublisher " CDV"
#define MyAppURL "https://example-cm-1"
#define MyAppExeName "example.exe"
[Setup]
AlwaysUsePersonalGroup=true
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppID={{7C9325AD-6818-42CA-839E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL} …Run Code Online (Sandbox Code Playgroud) 我在Pandas中有一个数据框,其形状为(136,1445)。我尝试为我的136行创建correlation(Pearson)矩阵。因此,结果是,我需要一个尺寸为136x136的矩阵。
我尝试了两种不同的方法,但是无法从中获得结果,或者当我创建136x136相关矩阵时,我丢失了数据框的列名。
第一,
gene_expression = pd.read_csv('padel_all_drug_results_original.csv',dtype='unicode')
gene_expression = gene_expression.convert_objects(convert_numeric=True)
gene_expression.corr()
Run Code Online (Sandbox Code Playgroud)
这给出了基于列的皮尔逊相关矩阵(1445 * 1445),当我尝试转置我的数据框然后尝试找到相关时,数据框的结构被破坏(例如列名丢失或我什至不确定该相关性是正确的)。
其次,
distance = lambda column1, column2: pearsonr(column1,column2)[0]
result = gene_expression.apply(lambda col1: gene_expression.apply(lambda col2: distance(col1, col2)))
Run Code Online (Sandbox Code Playgroud)
我应该如何计算136x136皮尔逊相关矩阵,以不更改原始数据帧?
另外,我有1445个功能,有些列几乎全为零。因此,我删除了这些列,因为它们是嘈杂的列,但是您有另一个想法来实现重用吗?
提前致谢
我试图选择已知目录中的所有.txt文件.例如,我知道路径:C:/../ Desktop /现在我想要获取桌面上的所有.txt文件.
那么我应该使用哪个regularExpression以及如何搜索它?关于java,我不太了解knowlegde.如果你帮助我,我会很开心.
String regularExpression = ?
String path = "C:/../Desktop/";
Pattern pattern = Pattern.compile(regularExpression);
boolean isMatched = Pattern.matches(regularExpression,path);
Run Code Online (Sandbox Code Playgroud) python ×4
pandas ×2
correlation ×1
in-clause ×1
inno-setup ×1
installation ×1
java ×1
linux ×1
numpy ×1
parameters ×1
path ×1
php ×1
r ×1
regex ×1
regression ×1
scikit-learn ×1
sql ×1
vagrant ×1
virtualbox ×1